Refactor graphics stats;

This commit is contained in:
bjorn 2018-07-14 23:52:01 -07:00
parent 0ee5d0b8f2
commit 4239bc46ea
5 changed files with 5 additions and 10 deletions

View File

@ -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");

View File

@ -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);

View File

@ -144,10 +144,6 @@ void lovrGraphicsGetDimensions(int* width, int* height) {
glfwGetFramebufferSize(state.window, width, height);
}
GpuStats lovrGraphicsGetStats() {
return gpuGetStats();
}
// State
Color lovrGraphicsGetBackgroundColor() {

View File

@ -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();

View File

@ -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;
}