mirror of https://github.com/bjornbytes/lovr.git
Refactor graphics stats;
This commit is contained in:
parent
0ee5d0b8f2
commit
4239bc46ea
|
@ -374,7 +374,7 @@ int l_lovrGraphicsGetStats(lua_State* L) {
|
|||
lua_createtable(L, 0, 2);
|
||||
}
|
||||
|
||||
GpuStats stats = lovrGraphicsGetStats();
|
||||
GraphicsStats stats = lovrGraphicsGetStats();
|
||||
|
||||
lua_pushinteger(L, stats.drawCalls);
|
||||
lua_setfield(L, 1, "drawcalls");
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
typedef struct {
|
||||
int shaderSwitches;
|
||||
int drawCalls;
|
||||
} GpuStats;
|
||||
} GraphicsStats;
|
||||
|
||||
typedef enum {
|
||||
BLEND_ALPHA,
|
||||
|
@ -120,7 +120,6 @@ void gpuDestroy();
|
|||
void gpuClear(Canvas** canvas, int canvasCount, Color* color, float* depth, int* stencil);
|
||||
void gpuDraw(GpuDrawCommand* command);
|
||||
void gpuPresent();
|
||||
GpuStats gpuGetStats();
|
||||
|
||||
// Ephemeral
|
||||
void gpuBindFramebuffer(uint32_t framebuffer);
|
||||
|
|
|
@ -144,10 +144,6 @@ void lovrGraphicsGetDimensions(int* width, int* height) {
|
|||
glfwGetFramebufferSize(state.window, width, height);
|
||||
}
|
||||
|
||||
GpuStats lovrGraphicsGetStats() {
|
||||
return gpuGetStats();
|
||||
}
|
||||
|
||||
// State
|
||||
|
||||
Color lovrGraphicsGetBackgroundColor() {
|
||||
|
|
|
@ -72,7 +72,7 @@ void lovrGraphicsClear(Color* color, float* depth, int* stencil);
|
|||
void lovrGraphicsPresent();
|
||||
void lovrGraphicsCreateWindow(int w, int h, bool fullscreen, int msaa, const char* title, const char* icon);
|
||||
void lovrGraphicsGetDimensions(int* width, int* height);
|
||||
GpuStats lovrGraphicsGetStats();
|
||||
GraphicsStats lovrGraphicsGetStats();
|
||||
|
||||
// State
|
||||
Color lovrGraphicsGetBackgroundColor();
|
||||
|
|
|
@ -29,7 +29,7 @@ static struct {
|
|||
uint32_t vertexBuffer;
|
||||
uint32_t viewport[4];
|
||||
bool srgb;
|
||||
GpuStats stats;
|
||||
GraphicsStats stats;
|
||||
} state;
|
||||
|
||||
static void gammaCorrectColor(Color* color) {
|
||||
|
@ -353,7 +353,7 @@ void gpuPresent() {
|
|||
memset(&state.stats, 0, sizeof(state.stats));
|
||||
}
|
||||
|
||||
GpuStats gpuGetStats() {
|
||||
GraphicsStats lovrGraphicsGetStats() {
|
||||
return state.stats;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue