Add buffer stats to love.graphics.getStats.

- Add 'buffers' field, to count the total number of graphics buffer objects.
- Add 'buffermemory' field, to estimate the total number of bytes of graphics memory used by all buffers.
This commit is contained in:
Sasha Szpakowski
2023-12-25 23:25:46 +01:00
parent 9c6417776f
commit e42019c59e
5 changed files with 23 additions and 2 deletions
+7 -1
View File
@@ -3005,9 +3005,15 @@ int w_getStats(lua_State *L)
lua_pushinteger(L, stats.fonts);
lua_setfield(L, -2, "fonts");
lua_pushinteger(L, stats.textureMemory);
lua_pushinteger(L, stats.buffers);
lua_setfield(L, -2, "buffers");
lua_pushnumber(L, (lua_Number) stats.textureMemory);
lua_setfield(L, -2, "texturememory");
lua_pushnumber(L, (lua_Number) stats.bufferMemory);
lua_setfield(L, -2, "buffermemory");
return 1;
}