This commit is contained in:
halx99 2022-11-10 22:03:40 +08:00
parent 19e2a77bb4
commit fbb40dd47f
4 changed files with 8 additions and 8 deletions

View File

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

View File

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

View File

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

View File

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