[client] interface: rename LG_Renderer to LG_RendererOps

Part of the standardisation of using the `Ops` suffix for all interfaces
This commit is contained in:
Geoffrey McRae 2021-08-08 14:43:04 +10:00
parent 1a8267d55a
commit 45d1f27fb4
6 changed files with 9 additions and 9 deletions

View File

@ -94,7 +94,7 @@ typedef enum LG_RendererCursor
} }
LG_RendererCursor; LG_RendererCursor;
typedef struct LG_Renderer typedef struct LG_RendererOps
{ {
/* returns the friendly name of the renderer */ /* returns the friendly name of the renderer */
const char * (*get_name)(void); const char * (*get_name)(void);
@ -163,4 +163,4 @@ typedef struct LG_Renderer
bool (*render)(void * opaque, LG_RendererRotate rotate, const bool newFrame, bool (*render)(void * opaque, LG_RendererRotate rotate, const bool newFrame,
const bool invalidateWindow, void (*preSwap)(void * udata), void * udata); const bool invalidateWindow, void (*preSwap)(void * udata), void * udata);
} }
LG_Renderer; LG_RendererOps;

View File

@ -5,7 +5,7 @@ set(RENDERER_H "${CMAKE_BINARY_DIR}/include/dynamic/renderers.h")
set(RENDERER_C "${CMAKE_BINARY_DIR}/src/renderers.c") set(RENDERER_C "${CMAKE_BINARY_DIR}/src/renderers.c")
file(WRITE ${RENDERER_H} "#include \"interface/renderer.h\"\n\n") file(WRITE ${RENDERER_H} "#include \"interface/renderer.h\"\n\n")
file(APPEND ${RENDERER_H} "extern LG_Renderer * LG_Renderers[];\n\n") file(APPEND ${RENDERER_H} "extern LG_RendererOps * LG_Renderers[];\n\n")
file(WRITE ${RENDERER_C} "#include \"interface/renderer.h\"\n\n") file(WRITE ${RENDERER_C} "#include \"interface/renderer.h\"\n\n")
file(APPEND ${RENDERER_C} "#include <stddef.h>\n\n") file(APPEND ${RENDERER_C} "#include <stddef.h>\n\n")
@ -33,10 +33,10 @@ list(LENGTH RENDERERS RENDERER_COUNT)
file(APPEND ${RENDERER_H} "#define LG_RENDERER_COUNT ${RENDERER_COUNT}\n") file(APPEND ${RENDERER_H} "#define LG_RENDERER_COUNT ${RENDERER_COUNT}\n")
foreach(renderer ${RENDERERS}) foreach(renderer ${RENDERERS})
file(APPEND ${RENDERER_C} "extern LG_Renderer LGR_${renderer};\n") file(APPEND ${RENDERER_C} "extern LG_RendererOps LGR_${renderer};\n")
endforeach() endforeach()
file(APPEND ${RENDERER_C} "\nconst LG_Renderer * LG_Renderers[] =\n{\n") file(APPEND ${RENDERER_C} "\nconst LG_RendererOps * LG_Renderers[] =\n{\n")
foreach(renderer ${RENDERERS}) foreach(renderer ${RENDERERS})
file(APPEND ${RENDERER_C} " &LGR_${renderer},\n") file(APPEND ${RENDERER_C} " &LGR_${renderer},\n")
endforeach() endforeach()

View File

@ -1064,7 +1064,7 @@ static bool egl_render(void * opaque, LG_RendererRotate rotate, const bool newFr
return true; return true;
} }
struct LG_Renderer LGR_EGL = struct LG_RendererOps LGR_EGL =
{ {
.get_name = egl_get_name, .get_name = egl_get_name,
.setup = egl_setup, .setup = egl_setup,

View File

@ -610,7 +610,7 @@ static void render_wait(struct Inst * this)
glDisable(GL_BLEND); glDisable(GL_BLEND);
} }
const LG_Renderer LGR_OpenGL = const LG_RendererOps LGR_OpenGL =
{ {
.get_name = opengl_get_name, .get_name = opengl_get_name,
.setup = opengl_setup, .setup = opengl_setup,

View File

@ -777,7 +777,7 @@ void intHandler(int sig)
static bool tryRenderer(const int index, const LG_RendererParams lgrParams, static bool tryRenderer(const int index, const LG_RendererParams lgrParams,
bool * needsOpenGL) bool * needsOpenGL)
{ {
const LG_Renderer *r = LG_Renderers[index]; const LG_RendererOps *r = LG_Renderers[index];
if (!IS_LG_RENDERER_VALID(r)) if (!IS_LG_RENDERER_VALID(r))
{ {

View File

@ -89,7 +89,7 @@ struct AppState
bool posInfoValid; bool posInfoValid;
bool alignToGuest; bool alignToGuest;
const LG_Renderer * lgr; const LG_RendererOps * lgr;
void * lgrData; void * lgrData;
atomic_int lgrResize; atomic_int lgrResize;
LG_Lock lgrLock; LG_Lock lgrLock;