Skip to content

Instantly share code, notes, and snippets.

@arajkumar
Last active December 25, 2015 05:19
Show Gist options
  • Save arajkumar/6924010 to your computer and use it in GitHub Desktop.
Save arajkumar/6924010 to your computer and use it in GitHub Desktop.
GLES2 Compilation Error
diff --git a/Source/WebCore/platform/graphics/OpenGLESShims.h b/Source/WebCore/platform/graphics/OpenGLESShims.h
index b495814..9683042 100644
--- a/Source/WebCore/platform/graphics/OpenGLESShims.h
+++ b/Source/WebCore/platform/graphics/OpenGLESShims.h
@@ -44,8 +44,12 @@
#define glIsRenderbufferEXT glIsRenderbuffer
#define glIsFramebufferEXT glIsFramebuffer
#define glGenerateMipmapEXT glGenerateMipmap
+#ifndef GL_COLOR_ATTACHMENT0_EXT
#define GL_COLOR_ATTACHMENT0_EXT GL_COLOR_ATTACHMENT0
+#endif
+#ifndef GL_DEPTH_ATTACHMENT_EXT
#define GL_DEPTH_ATTACHMENT_EXT GL_DEPTH_ATTACHMENT
+#endif
#define GL_FRAMEBUFFER_COMPLETE_EXT GL_FRAMEBUFFER_COMPLETE
#define GL_FRAMEBUFFER_EXT GL_FRAMEBUFFER
#define GL_DEPTH24_STENCIL8_EXT GL_DEPTH24_STENCIL8_OES
diff --git a/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp b/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp
index 174289b..786a323 100644
--- a/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp
+++ b/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp
@@ -37,9 +37,9 @@
#endif
#if USE(OPENGL_ES_2)
-#include "OpenGLESShims.h"
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
+#include "OpenGLESShims.h"
#elif PLATFORM(MAC)
#include <OpenGL/gl.h>
#elif PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(NIX)
diff --git a/Source/cmake/FindOpenGLES2.cmake b/Source/cmake/FindOpenGLES2.cmake
index db69b8d..3722df1 100644
--- a/Source/cmake/FindOpenGLES2.cmake
+++ b/Source/cmake/FindOpenGLES2.cmake
@@ -14,6 +14,8 @@ if (PC_OPENGLES2_FOUND)
else ()
find_path(OPENGLES2_INCLUDE_DIRS NAMES GLES2/gl2.h)
endif ()
+find_path(OPENGLES2_INCLUDE_DIRS NAMES GLES2/gl2.h)
+MESSAGE( "Value of PC_OPENGLES2: ${OPENGLES2_INCLUDE_DIRS}" )
find_library(OPENGLES2_LIBRARIES GLESv2
HINTS ${PC_OPENGLES2_LIBRARY_DIRS} ${PC_OPENGLES2_LIBDIR}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment