mirror of https://github.com/bjornbytes/lovr.git
Rename clearColor to backgroundColor;
This commit is contained in:
parent
d9977a6b99
commit
ab14cf5d31
|
@ -104,7 +104,7 @@ void lovrGraphicsPrepare() {
|
|||
}
|
||||
}
|
||||
|
||||
void lovrGraphicsGetClearColor(float* r, float* g, float* b, float* a) {
|
||||
void lovrGraphicsGetBackgroundColor(float* r, float* g, float* b, float* a) {
|
||||
GLfloat clearColor[4];
|
||||
glGetFloatv(GL_COLOR_CLEAR_VALUE, clearColor);
|
||||
*r = clearColor[0];
|
||||
|
@ -113,7 +113,7 @@ void lovrGraphicsGetClearColor(float* r, float* g, float* b, float* a) {
|
|||
*a = clearColor[3];
|
||||
}
|
||||
|
||||
void lovrGraphicsSetClearColor(float r, float g, float b, float a) {
|
||||
void lovrGraphicsSetBackgroundColor(float r, float g, float b, float a) {
|
||||
glClearColor(r / 255, g / 255, b / 255, a / 255);
|
||||
}
|
||||
|
||||
|
|
|
@ -23,8 +23,8 @@ void lovrGraphicsReset();
|
|||
void lovrGraphicsClear(int color, int depth);
|
||||
void lovrGraphicsPresent();
|
||||
void lovrGraphicsPrepare();
|
||||
void lovrGraphicsGetClearColor(float* r, float* g, float* b, float* a);
|
||||
void lovrGraphicsSetClearColor(float r, float g, float b, float a);
|
||||
void lovrGraphicsGetBackgroundColor(float* r, float* g, float* b, float* a);
|
||||
void lovrGraphicsSetBackgroundColor(float r, float g, float b, float a);
|
||||
void lovrGraphicsGetColorMask(char* r, char* g, char* b, char* a);
|
||||
void lovrGraphicsSetColorMask(char r, char g, char b, char a);
|
||||
Shader* lovrGraphicsGetShader();
|
||||
|
|
|
@ -9,8 +9,8 @@ const luaL_Reg lovrGraphics[] = {
|
|||
{ "reset", l_lovrGraphicsReset },
|
||||
{ "clear", l_lovrGraphicsClear },
|
||||
{ "present", l_lovrGraphicsPresent },
|
||||
{ "getClearColor", l_lovrGraphicsGetClearColor },
|
||||
{ "setClearColor", l_lovrGraphicsSetClearColor },
|
||||
{ "getBackgroundColor", l_lovrGraphicsGetBackgroundColor },
|
||||
{ "setBackgroundColor", l_lovrGraphicsSetBackgroundColor },
|
||||
{ "getColorMask", l_lovrGraphicsGetColorMask },
|
||||
{ "setColorMask", l_lovrGraphicsSetColorMask },
|
||||
{ "setShader", l_lovrGraphicsSetShader },
|
||||
|
@ -66,9 +66,9 @@ int l_lovrGraphicsPresent(lua_State* L) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int l_lovrGraphicsGetClearColor(lua_State* L) {
|
||||
int l_lovrGraphicsGetBackgroundColor(lua_State* L) {
|
||||
float r, g, b, a;
|
||||
lovrGraphicsGetClearColor(&r, &g, &b, &a);
|
||||
lovrGraphicsGetBackgroundColor(&r, &g, &b, &a);
|
||||
lua_pushnumber(L, r);
|
||||
lua_pushnumber(L, g);
|
||||
lua_pushnumber(L, b);
|
||||
|
@ -76,7 +76,7 @@ int l_lovrGraphicsGetClearColor(lua_State* L) {
|
|||
return 4;
|
||||
}
|
||||
|
||||
int l_lovrGraphicsSetClearColor(lua_State* L) {
|
||||
int l_lovrGraphicsSetBackgroundColor(lua_State* L) {
|
||||
float r = luaL_checknumber(L, 1);
|
||||
float g = luaL_checknumber(L, 2);
|
||||
float b = luaL_checknumber(L, 3);
|
||||
|
@ -84,7 +84,7 @@ int l_lovrGraphicsSetClearColor(lua_State* L) {
|
|||
if (lua_gettop(L) > 3) {
|
||||
a = luaL_checknumber(L, 4);
|
||||
}
|
||||
lovrGraphicsSetClearColor(r, g, b, a);
|
||||
lovrGraphicsSetBackgroundColor(r, g, b, a);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,8 +11,8 @@ int l_lovrGraphicsInit(lua_State* L);
|
|||
int l_lovrGraphicsReset(lua_State* L);
|
||||
int l_lovrGraphicsClear(lua_State* L);
|
||||
int l_lovrGraphicsPresent(lua_State* L);
|
||||
int l_lovrGraphicsGetClearColor(lua_State* L);
|
||||
int l_lovrGraphicsSetClearColor(lua_State* L);
|
||||
int l_lovrGraphicsGetBackgroundColor(lua_State* L);
|
||||
int l_lovrGraphicsSetBackgroundColor(lua_State* L);
|
||||
int l_lovrGraphicsGetColorMask(lua_State* L);
|
||||
int l_lovrGraphicsSetColorMask(lua_State* L);
|
||||
int l_lovrGraphicsGetShader(lua_State* L);
|
||||
|
|
Loading…
Reference in New Issue