mirror of https://github.com/bjornbytes/lovr.git
lovr.graphics.getSupported;
This commit is contained in:
parent
f6f322fc7f
commit
1b7261de5c
|
@ -327,6 +327,14 @@ int l_lovrGraphicsGetDimensions(lua_State* L) {
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int l_lovrGraphicsGetSupported(lua_State* L) {
|
||||||
|
GraphicsFeatures features = lovrGraphicsGetSupported();
|
||||||
|
lua_newtable(L);
|
||||||
|
lua_pushboolean(L, features.writableBlocks);
|
||||||
|
lua_setfield(L, -2, "writableBlocks");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
int l_lovrGraphicsGetSystemLimits(lua_State* L) {
|
int l_lovrGraphicsGetSystemLimits(lua_State* L) {
|
||||||
GraphicsLimits limits = lovrGraphicsGetLimits();
|
GraphicsLimits limits = lovrGraphicsGetLimits();
|
||||||
lua_newtable(L);
|
lua_newtable(L);
|
||||||
|
@ -1202,6 +1210,7 @@ const luaL_Reg lovrGraphics[] = {
|
||||||
{ "getWidth", l_lovrGraphicsGetWidth },
|
{ "getWidth", l_lovrGraphicsGetWidth },
|
||||||
{ "getHeight", l_lovrGraphicsGetHeight },
|
{ "getHeight", l_lovrGraphicsGetHeight },
|
||||||
{ "getDimensions", l_lovrGraphicsGetDimensions },
|
{ "getDimensions", l_lovrGraphicsGetDimensions },
|
||||||
|
{ "getSupported", l_lovrGraphicsGetSupported },
|
||||||
{ "getSystemLimits", l_lovrGraphicsGetSystemLimits },
|
{ "getSystemLimits", l_lovrGraphicsGetSystemLimits },
|
||||||
{ "getStats", l_lovrGraphicsGetStats },
|
{ "getStats", l_lovrGraphicsGetStats },
|
||||||
|
|
||||||
|
|
|
@ -67,6 +67,10 @@ typedef enum {
|
||||||
WINDING_COUNTERCLOCKWISE
|
WINDING_COUNTERCLOCKWISE
|
||||||
} Winding;
|
} Winding;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
bool writableBlocks;
|
||||||
|
} GraphicsFeatures;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
bool initialized;
|
bool initialized;
|
||||||
float pointSizes[2];
|
float pointSizes[2];
|
||||||
|
@ -165,6 +169,7 @@ void lovrGraphicsCreateWindow(int w, int h, bool fullscreen, int msaa, const cha
|
||||||
void lovrGraphicsGetDimensions(int* width, int* height);
|
void lovrGraphicsGetDimensions(int* width, int* height);
|
||||||
int lovrGraphicsGetMSAA();
|
int lovrGraphicsGetMSAA();
|
||||||
void lovrGraphicsSetCamera(Camera* camera, bool clear);
|
void lovrGraphicsSetCamera(Camera* camera, bool clear);
|
||||||
|
GraphicsFeatures lovrGraphicsGetSupported();
|
||||||
GraphicsLimits lovrGraphicsGetLimits();
|
GraphicsLimits lovrGraphicsGetLimits();
|
||||||
GraphicsStats lovrGraphicsGetStats();
|
GraphicsStats lovrGraphicsGetStats();
|
||||||
|
|
||||||
|
|
|
@ -801,6 +801,16 @@ void lovrGpuPresent() {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GraphicsFeatures lovrGraphicsGetSupported() {
|
||||||
|
return (GraphicsFeatures) {
|
||||||
|
#ifdef EMSCRIPTEN
|
||||||
|
.writableBlocks = GLAD_GL_ARB_shader_storage_blocks
|
||||||
|
#else
|
||||||
|
.writableBlocks = false
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
GraphicsLimits lovrGraphicsGetLimits() {
|
GraphicsLimits lovrGraphicsGetLimits() {
|
||||||
if (!state.limits.initialized) {
|
if (!state.limits.initialized) {
|
||||||
#ifdef EMSCRIPTEN
|
#ifdef EMSCRIPTEN
|
||||||
|
|
Loading…
Reference in New Issue