Rename setBackground back to setBackgroundColor;

The "fancy background" idea won't go here.
This commit is contained in:
bjorn 2022-08-13 21:10:58 -07:00
parent 6052ed7a95
commit 5799b0effb
5 changed files with 12 additions and 12 deletions

View File

@ -176,7 +176,7 @@ function lovr.errhand(message)
local y = math.min(height / 2, 10)
local z = -10
lovr.graphics.setBackground(.11, .10, .14)
lovr.graphics.setBackgroundColor(.11, .10, .14)
font:setPixelDensity()
local function render(pass)

View File

@ -14,7 +14,7 @@ function lovr.load()
return
end
lovr.graphics.setBackground(0x20232c)
lovr.graphics.setBackgroundColor(0x20232c)
--[=[
logo = lovr.graphics.newShader([[

View File

@ -812,9 +812,9 @@ static int l_lovrGraphicsIsFormatSupported(lua_State* L) {
return 1;
}
static int l_lovrGraphicsGetBackground(lua_State* L) {
static int l_lovrGraphicsGetBackgroundColor(lua_State* L) {
float color[4];
lovrGraphicsGetBackground(color);
lovrGraphicsGetBackgroundColor(color);
lua_pushnumber(L, color[0]);
lua_pushnumber(L, color[1]);
lua_pushnumber(L, color[2]);
@ -822,10 +822,10 @@ static int l_lovrGraphicsGetBackground(lua_State* L) {
return 4;
}
static int l_lovrGraphicsSetBackground(lua_State* L) {
static int l_lovrGraphicsSetBackgroundColor(lua_State* L) {
float color[4];
luax_readcolor(L, 1, color);
lovrGraphicsSetBackground(color);
lovrGraphicsSetBackgroundColor(color);
return 0;
}
@ -1502,8 +1502,8 @@ static const luaL_Reg lovrGraphics[] = {
{ "getFeatures", l_lovrGraphicsGetFeatures },
{ "getLimits", l_lovrGraphicsGetLimits },
{ "isFormatSupported", l_lovrGraphicsIsFormatSupported },
{ "getBackground", l_lovrGraphicsGetBackground },
{ "setBackground", l_lovrGraphicsSetBackground },
{ "getBackgroundColor", l_lovrGraphicsGetBackgroundColor },
{ "setBackgroundColor", l_lovrGraphicsSetBackgroundColor },
{ "getWindowPass", l_lovrGraphicsGetWindowPass },
{ "getDefaultFont", l_lovrGraphicsGetDefaultFont },
{ "getBuffer", l_lovrGraphicsGetBuffer },

View File

@ -779,14 +779,14 @@ void lovrGraphicsGetShaderCache(void* data, size_t* size) {
gpu_pipeline_get_cache(data, size);
}
void lovrGraphicsGetBackground(float background[4]) {
void lovrGraphicsGetBackgroundColor(float background[4]) {
background[0] = lovrMathLinearToGamma(state.background[0]);
background[1] = lovrMathLinearToGamma(state.background[1]);
background[2] = lovrMathLinearToGamma(state.background[2]);
background[3] = state.background[3];
}
void lovrGraphicsSetBackground(float background[4]) {
void lovrGraphicsSetBackgroundColor(float background[4]) {
state.background[0] = lovrMathGammaToLinear(background[0]);
state.background[1] = lovrMathGammaToLinear(background[1]);
state.background[2] = lovrMathGammaToLinear(background[2]);

View File

@ -103,8 +103,8 @@ void lovrGraphicsGetLimits(GraphicsLimits* limits);
bool lovrGraphicsIsFormatSupported(uint32_t format, uint32_t features);
void lovrGraphicsGetShaderCache(void* data, size_t* size);
void lovrGraphicsGetBackground(float background[4]);
void lovrGraphicsSetBackground(float background[4]);
void lovrGraphicsGetBackgroundColor(float background[4]);
void lovrGraphicsSetBackgroundColor(float background[4]);
void lovrGraphicsSubmit(Pass** passes, uint32_t count);
void lovrGraphicsPresent(void);