]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fix some compile errors and warnings with USE_GLES2
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 1 Aug 2012 05:30:31 +0000 (05:30 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 1 Aug 2012 05:30:31 +0000 (05:30 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11838 d7cf8633-e32d-0410-b094-e92efae38249

gl_backend.c
glquake.h

index bb20a109a8b92ccc97a25d159cf4930f10bb6b93..e523107055864d0dfdaf58028e69abce72950bda 100644 (file)
@@ -1264,7 +1264,12 @@ int R_Mesh_CreateFramebufferObject(rtexture_t *depthtexture, rtexture_t *colorte
                        qglGenFramebuffers(1, (GLuint*)&temp);CHECKGLERROR
                        R_Mesh_SetRenderTargets(temp, NULL, NULL, NULL, NULL, NULL);
                        // GL_ARB_framebuffer_object (GL3-class hardware) - depth stencil attachment
+#ifdef USE_GLES2
+                       // FIXME: separate stencil attachment on GLES
+                       if (depthtexture  && depthtexture->texnum ) qglFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT  , depthtexture->gltexturetypeenum , depthtexture->texnum , 0);CHECKGLERROR
+#else
                        if (depthtexture  && depthtexture->texnum ) qglFramebufferTexture2D(GL_FRAMEBUFFER, depthtexture->glisdepthstencil ? GL_DEPTH_STENCIL_ATTACHMENT : GL_DEPTH_ATTACHMENT  , depthtexture->gltexturetypeenum , depthtexture->texnum , 0);CHECKGLERROR
+#endif
                        if (depthtexture  && depthtexture->renderbuffernum ) qglFramebufferRenderbuffer(GL_FRAMEBUFFER, depthtexture->glisdepthstencil ? GL_DEPTH_STENCIL_ATTACHMENT : GL_DEPTH_ATTACHMENT  , GL_RENDERBUFFER, depthtexture->renderbuffernum );CHECKGLERROR
                        if (colortexture  && colortexture->texnum ) qglFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 , colortexture->gltexturetypeenum , colortexture->texnum , 0);CHECKGLERROR
                        if (colortexture2 && colortexture2->texnum) qglFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1 , colortexture2->gltexturetypeenum, colortexture2->texnum, 0);CHECKGLERROR
@@ -1275,6 +1280,7 @@ int R_Mesh_CreateFramebufferObject(rtexture_t *depthtexture, rtexture_t *colorte
                        if (colortexture3 && colortexture3->renderbuffernum) qglFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT2 , GL_RENDERBUFFER, colortexture3->renderbuffernum);CHECKGLERROR
                        if (colortexture4 && colortexture4->renderbuffernum) qglFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT3 , GL_RENDERBUFFER, colortexture4->renderbuffernum);CHECKGLERROR
 
+#ifndef USE_GLES2
                        if (colortexture4 && qglDrawBuffersARB)
                        {
                                qglDrawBuffersARB(4, drawbuffers);CHECKGLERROR
@@ -1300,6 +1306,7 @@ int R_Mesh_CreateFramebufferObject(rtexture_t *depthtexture, rtexture_t *colorte
                                qglDrawBuffer(GL_NONE);CHECKGLERROR
                                qglReadBuffer(GL_NONE);CHECKGLERROR
                        }
+#endif
                        status = qglCheckFramebufferStatus(GL_FRAMEBUFFER);CHECKGLERROR
                        if (status != GL_FRAMEBUFFER_COMPLETE)
                        {
@@ -1327,6 +1334,7 @@ int R_Mesh_CreateFramebufferObject(rtexture_t *depthtexture, rtexture_t *colorte
                        if (colortexture3 && colortexture3->renderbuffernum) qglFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT2 , GL_RENDERBUFFER, colortexture3->renderbuffernum);CHECKGLERROR
                        if (colortexture4 && colortexture4->renderbuffernum) qglFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT3 , GL_RENDERBUFFER, colortexture4->renderbuffernum);CHECKGLERROR
 
+#ifndef USE_GLES2
                        if (colortexture4 && qglDrawBuffersARB)
                        {
                                qglDrawBuffersARB(4, drawbuffers);CHECKGLERROR
@@ -1352,6 +1360,7 @@ int R_Mesh_CreateFramebufferObject(rtexture_t *depthtexture, rtexture_t *colorte
                                qglDrawBuffer(GL_NONE);CHECKGLERROR
                                qglReadBuffer(GL_NONE);CHECKGLERROR
                        }
+#endif
                        status = qglCheckFramebufferStatus(GL_FRAMEBUFFER);CHECKGLERROR
                        if (status != GL_FRAMEBUFFER_COMPLETE)
                        {
index 9686dc590525d6e953ec4b6f94d2f3526d6548ee..30b2512d8834583b2f023b15de976e31257b9c88 100644 (file)
--- a/glquake.h
+++ b/glquake.h
@@ -1056,7 +1056,11 @@ extern void (GLAPIENTRY *qglPointSize)(GLfloat size);
 #define DEBUGGL
 
 #ifdef DEBUGGL
+#ifdef USE_GLES2
+#define CHECKGLERROR {if (gl_paranoid.integer){if (gl_printcheckerror.integer) Con_Printf("CHECKGLERROR at %s:%d\n", __FILE__, __LINE__);errornumber = glGetError();if (errornumber) GL_PrintError(errornumber, __FILE__, __LINE__);}}
+#else
 #define CHECKGLERROR {if (gl_paranoid.integer){if (gl_printcheckerror.integer) Con_Printf("CHECKGLERROR at %s:%d\n", __FILE__, __LINE__);errornumber = qglGetError ? qglGetError() : 0;if (errornumber) GL_PrintError(errornumber, __FILE__, __LINE__);}}
+#endif
 extern int errornumber;
 void GL_PrintError(int errornumber, const char *filename, int linenumber);
 #else