[GB.QT4.OPENGL]

* BUG: Don't use GL_LIGHTING if it is not defined. It seems to be the case
  with OpenGL ES.


git-svn-id: svn://localhost/gambas/trunk@5852 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2013-09-26 11:27:39 +00:00
parent 28cd200d7b
commit a255967090

View File

@ -27,6 +27,7 @@
//#include "gl.h"
//#include <iostream>
@ -107,11 +108,15 @@ BEGIN_METHOD(CGLAREA_text, GB_STRING text; GB_INTEGER x; GB_INTEGER y)
QString text;
int x, y;
#ifdef GL_LIGHTING
GLboolean _LIGHTING = glIsEnabled(GL_LIGHTING);
#endif
GLboolean _TEXTURE_2D = glIsEnabled(GL_TEXTURE_2D);
#ifdef GL_LIGHTING
if (_LIGHTING)
glDisable(GL_LIGHTING);
#endif
if (_TEXTURE_2D)
glDisable(GL_TEXTURE_2D);
@ -121,8 +126,10 @@ BEGIN_METHOD(CGLAREA_text, GB_STRING text; GB_INTEGER x; GB_INTEGER y)
WIDGET->renderText(x, y, text, WIDGET->font());
#ifdef GL_LIGHTING
if (_LIGHTING)
glEnable(GL_LIGHTING);
#endif
if (_TEXTURE_2D)
glEnable(GL_TEXTURE_2D);