Skip to content

Commit eeee4ef

Browse files
committed
Fix Non-Android GL ES
1 parent 9238201 commit eeee4ef

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

  • Backends/Graphics4/OpenGL/Sources/kinc/backend/graphics4

Backends/Graphics4/OpenGL/Sources/kinc/backend/graphics4/OpenGL.c.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ GL_APICALL void (*GL_APIENTRY glesEndQuery)(GLenum target);
8080
GL_APICALL void (*GL_APIENTRY glesGetQueryObjectuiv)(GLuint id, GLenum pname, GLuint *params);
8181
#endif
8282

83-
#if defined(KINC_OPENGL_ES)
83+
#if defined(KINC_OPENGL_ES) && defined(KINC_ANDROID)
8484
GL_APICALL void (*GL_APIENTRY glesDrawElementsBaseVertex)(GLenum mode, GLsizei count, GLenum type, void *indices, GLint basevertex) = NULL;
8585
#endif
8686

@@ -274,7 +274,7 @@ void kinc_g4_internal_init_window(int windowId, int depthBufferBits, int stencil
274274
glesGetQueryObjectuiv = (void *)eglGetProcAddress("glGetQueryObjectuiv");
275275
#endif
276276

277-
#if defined(KONC_OPENGL_ES)
277+
#if defined(KONC_OPENGL_ES) && defined(KINC_ANDROID)
278278
glesDrawElementsBaseVertex = (void *)eglGetProcAddress("glDrawElementsBaseVertex");
279279
#endif
280280

@@ -477,15 +477,19 @@ void kinc_g4_draw_indexed_vertices_from_to_from(int start, int count, int vertex
477477
GLenum type = sixteen ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT;
478478
void *_start = sixteen ? (void *)(start * sizeof(uint16_t)) : (void *)(start * sizeof(uint32_t));
479479
#ifdef KINC_OPENGL_ES
480+
#ifdef KINC_ANDROID
480481
if (glesDrawElementsBaseVertex != NULL) {
481482
glesDrawElementsBaseVertex(GL_TRIANGLES, count, type, _start, vertex_offset);
482483
}
483484
else {
485+
#endif
484486
if (vertex_offset != 0) {
485487
kinc_log(KINC_LOG_LEVEL_WARNING, "BaseVertex used but not supported");
486488
}
487489
glDrawElements(GL_TRIANGLES, count, type, _start);
490+
if defined(KINC_ANDROID)
488491
}
492+
#endif
489493
glCheckErrors();
490494
#else
491495
if (Kinc_Internal_ProgramUsesTessellation) {

0 commit comments

Comments
 (0)