Skip to content

Commit

Permalink
Layer count is implicitly 6 when creating cubemap;
Browse files Browse the repository at this point in the history
LÖVR understands me
  • Loading branch information
bjornbytes committed Nov 6, 2023
1 parent 8d58ad8 commit 9e82dc9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/api/l_graphics.c
Original file line number Diff line number Diff line change
Expand Up @@ -805,6 +805,10 @@ static int l_lovrGraphicsNewTexture(lua_State* L) {
lua_pop(L, 1);
}

if (lua_type(L, 1) == LUA_TNUMBER && lua_type(L, 3) != LUA_TNUMBER && info.type == TEXTURE_CUBE) {
info.layers = 6;
}

Texture* texture = lovrTextureCreate(&info);

for (uint32_t i = 0; i < info.imageCount; i++) {
Expand Down

0 comments on commit 9e82dc9

Please sign in to comment.