mirror of https://github.com/bjornbytes/lovr.git
Allow lovr.graphics.setFont(nil);
This commit is contained in:
parent
abbe5e36d0
commit
58931f01e2
|
@ -352,7 +352,7 @@ int l_lovrGraphicsGetFont(lua_State* L) {
|
|||
}
|
||||
|
||||
int l_lovrGraphicsSetFont(lua_State* L) {
|
||||
Font* font = luax_checktype(L, 1, Font);
|
||||
Font* font = lua_isnoneornil(L, 1) ? NULL : luax_checktype(L, 1, Font);
|
||||
lovrGraphicsSetFont(font);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -85,8 +85,8 @@ void lovrGraphicsInit() {
|
|||
}
|
||||
|
||||
void lovrGraphicsDestroy() {
|
||||
lovrGraphicsSetFont(NULL);
|
||||
lovrGraphicsSetShader(NULL);
|
||||
lovrGraphicsSetFont(NULL);
|
||||
glUseProgram(0);
|
||||
if (state.defaultFont) {
|
||||
lovrRelease(&state.defaultFont->ref);
|
||||
|
@ -134,10 +134,9 @@ void lovrGraphicsPresent() {
|
|||
}
|
||||
|
||||
void lovrGraphicsPrepare() {
|
||||
Shader* shader = lovrGraphicsGetShader();
|
||||
mat4 transform = state.transforms[state.transform];
|
||||
mat4 projection = state.canvases[state.canvas].projection;
|
||||
lovrShaderBind(shader, transform, projection, state.color, 0);
|
||||
lovrShaderBind(state.shader, transform, projection, state.color, 0);
|
||||
}
|
||||
|
||||
// State
|
||||
|
|
Loading…
Reference in New Issue