diff --git a/core/platform/desktop/CCGLViewImpl-desktop.cpp b/core/platform/desktop/CCGLViewImpl-desktop.cpp index 9076864f05..15b3a2cbed 100644 --- a/core/platform/desktop/CCGLViewImpl-desktop.cpp +++ b/core/platform/desktop/CCGLViewImpl-desktop.cpp @@ -489,7 +489,7 @@ bool GLViewImpl::initWithRect(std::string_view viewName, Rect rect, float frameZ } // Will cause OpenGL error 0x0500 when use ANGLE-GLES on desktop -#if defined(AX_USE_GL) +#if !defined(AX_USE_GLES) // Enable point size by default. # if defined(GL_VERSION_2_0) glEnable(GL_VERTEX_PROGRAM_POINT_SIZE); @@ -1198,7 +1198,7 @@ bool GLViewImpl::loadGL() // glad: load all OpenGL function pointers // --------------------------------------- -# if defined(AX_USE_GL) +# if !defined(AX_USE_GLES) if (!gladLoadGL(glfwGetProcAddress)) { log("glad: Failed to Load GL"); diff --git a/core/renderer/backend/opengl/CommandBufferGL.cpp b/core/renderer/backend/opengl/CommandBufferGL.cpp index 9791e1dbad..8650bb56d5 100644 --- a/core/renderer/backend/opengl/CommandBufferGL.cpp +++ b/core/renderer/backend/opengl/CommandBufferGL.cpp @@ -214,13 +214,13 @@ void CommandBufferGL::setProgramState(ProgramState* programState) void CommandBufferGL::drawArrays(PrimitiveType primitiveType, std::size_t start, std::size_t count, bool wireframe) { prepareDrawing(); -#ifdef AX_USE_GL // glPolygonMode is only supported in Desktop OpenGL +#ifndef AX_USE_GLES // glPolygonMode is only supported in Desktop OpenGL if (wireframe) glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); #else if (wireframe) primitiveType = PrimitiveType::LINE; #endif glDrawArrays(UtilsGL::toGLPrimitiveType(primitiveType), start, count); -#ifdef AX_USE_GL // glPolygonMode is only supported in Desktop OpenGL +#ifndef AX_USE_GLES // glPolygonMode is only supported in Desktop OpenGL if (wireframe) glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); #endif cleanResources(); @@ -233,7 +233,7 @@ void CommandBufferGL::drawElements(PrimitiveType primitiveType, bool wireframe) { prepareDrawing(); -#ifdef AX_USE_GL // glPolygonMode is only supported in Desktop OpenGL +#ifndef AX_USE_GLES // glPolygonMode is only supported in Desktop OpenGL if (wireframe) glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); #else if (wireframe) primitiveType = PrimitiveType::LINE; @@ -242,7 +242,7 @@ void CommandBufferGL::drawElements(PrimitiveType primitiveType, glDrawElements(UtilsGL::toGLPrimitiveType(primitiveType), count, UtilsGL::toGLIndexType(indexType), (GLvoid*)offset); CHECK_GL_ERROR_DEBUG(); -#ifdef AX_USE_GL // glPolygonMode is only supported in Desktop OpenGL +#ifndef AX_USE_GLES // glPolygonMode is only supported in Desktop OpenGL if (wireframe) glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); #endif cleanResources(); diff --git a/core/renderer/backend/opengl/DeviceInfoGL.cpp b/core/renderer/backend/opengl/DeviceInfoGL.cpp index f6be545686..2324fd1114 100644 --- a/core/renderer/backend/opengl/DeviceInfoGL.cpp +++ b/core/renderer/backend/opengl/DeviceInfoGL.cpp @@ -68,7 +68,7 @@ static bool checkReallySupportsASTC() astctexels); auto error = glGetError(); -#if defined(AX_USE_GL) +#if !defined(AX_USE_GLES) if (!error && glGetTexImage) { // read pixel RGB: should be: 255, 128, 0 diff --git a/extensions/ImGui/ImGuiPresenter.cpp b/extensions/ImGui/ImGuiPresenter.cpp index aef16b139c..20dfbec868 100644 --- a/extensions/ImGui/ImGuiPresenter.cpp +++ b/extensions/ImGui/ImGuiPresenter.cpp @@ -8,7 +8,7 @@ #include "imgui_internal.h" // TODO: mac metal -#if (defined(AX_USE_GL) || defined(AX_USE_GLES)) +#if defined(AX_USE_GL) # define AX_IMGUI_ENABLE_MULTI_VIEWPORT 1 #else # define AX_IMGUI_ENABLE_MULTI_VIEWPORT 0