diff --git a/src/debug/quad.cpp b/src/debug/quad.cpp index fa218f26..0cf6507e 100644 --- a/src/debug/quad.cpp +++ b/src/debug/quad.cpp @@ -162,7 +162,9 @@ void DebugQuad::TickDraw(float deltams) data->shader[i] = NULL; /* Checkerboard texture */ +#if !defined HAVE_GLES_2X glEnable(GL_TEXTURE_2D); +#endif glBindTexture(GL_TEXTURE_2D, data->texture[0]); for (int j = 0; j < TEX_SIZE; j++) for (int i = 0; i < TEX_SIZE; i++) @@ -303,7 +305,9 @@ void DebugQuad::TickDraw(float deltams) * animated distorted checkerboard. */ #if defined HAVE_GLBEGIN || defined USE_GLEW +#if !defined HAVE_GLES_2X glEnable(GL_TEXTURE_2D); +#endif glBindTexture(GL_TEXTURE_2D, data->texture[0]); glColor3f(1.0f, 1.0f, 1.0f); glBegin(GL_TRIANGLES); @@ -327,7 +331,9 @@ void DebugQuad::TickDraw(float deltams) glTexCoord2f(texcoords[10], texcoords[11]); glVertex3f(data->aa.x, data->bb.y, 0.0f); glEnd(); +#if !defined HAVE_GLES_2X glDisable(GL_TEXTURE_2D); +#endif #endif Advance(); @@ -1077,7 +1083,9 @@ void DebugQuad::ResetState() glColor4f(1.0f, 1.0f, 1.0f, 1.0f); #endif +#if !defined HAVE_GLES_2X glEnable(GL_TEXTURE_2D); +#endif glBindTexture(GL_TEXTURE_2D, 0); #if defined HAVE_GLBEGIN || defined USE_GLEW || defined __CELLOS_LV2__ glClientActiveTexture(GL_TEXTURE0); @@ -1085,7 +1093,9 @@ void DebugQuad::ResetState() #if !defined __CELLOS_LV2__ && !defined __ANDROID__ && !defined __APPLE__ && !defined __native_client__ glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, GL_FALSE); #endif +#if !defined HAVE_GLES_2X glDisable(GL_TEXTURE_2D); +#endif glDisable(GL_BLEND); #if !defined __CELLOS_LV2__ && !defined __ANDROID__ && !defined __APPLE__ && !defined __native_client__ diff --git a/src/scene.cpp b/src/scene.cpp index 790acd37..890fd994 100644 --- a/src/scene.cpp +++ b/src/scene.cpp @@ -137,7 +137,9 @@ void Scene::Render() // XXX: rename to Blit() { #if !defined __CELLOS_LV2__ stdshader = Shader::Create( +#if !defined HAVE_GLES_2X "#version 130\n" +#endif "\n" #if defined HAVE_GLES_2X "attribute vec3 in_Position;\n" @@ -162,7 +164,11 @@ void Scene::Render() // XXX: rename to Blit() #endif "}\n", +#if !defined HAVE_GLES_2X "#version 130\n" +#else + "precision mediump float;\n" +#endif "\n" "uniform sampler2D in_Texture;\n" #if defined HAVE_GLES_2X @@ -317,7 +323,9 @@ void Scene::Render() // XXX: rename to Blit() //cgGLSetParameter1i((CGparameter)(intptr_t)uni_tex, 0); #endif +#if !defined HAVE_GLES_2X glEnable(GL_TEXTURE_2D); +#endif glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LEQUAL); #if defined HAVE_GL_2X && !defined __APPLE__ @@ -405,7 +413,9 @@ void Scene::Render() // XXX: rename to Blit() data->tiles = 0; data->ntiles = 0; +#if !defined HAVE_GLES_2X glDisable(GL_TEXTURE_2D); +#endif glDisable(GL_DEPTH_TEST); #if defined HAVE_GL_2X && !defined __APPLE__ glDisable(GL_ALPHA_TEST);