Author Topic: glext.h no longer defines GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT  (Read 2477 times)

0 Members and 1 Guest are viewing this topic.

glext.h no longer defines GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT
NOTE: I didn't try the test build; but it looks like the case was completely removed to solve the problem in it. If anyone is trying to compile 3.6.9 final and has this problem, this post should be helpful.

Trying to compile 3.6.9 final on ubuntu 7.10 I get the error:
Code: [Select]
graphics/gropengltexture.cpp: In function ‘int opengl_check_framebuffer()’:
graphics/gropengltexture.cpp:1819: error: ‘GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT’ was not declared in this scope
make[1]: *** [gropengltexture.o] Error 1
make[1]: Leaving directory `/usr/src/fs2_open-3.6.9/code'
make: *** [all-recursive] Error 1

It turns out that glext.h no longer defines GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT as of version 39 (the previous version was 34).

In gropengltexture.cpp the culprit lines look like so:
Code: [Select]
#ifndef __APPLE__ // for some reason, Apple doesn't include this define in their headers
case GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT:
strcpy(err_txt, "Image attached to more than one FBO!\n");
break;
#endif

It's not that Apple doesn't include that define; it's that glext.h no longer defines it in the latest version... and Apple is using the latest version.
The precompiler statement should instead omit this code if GL_GLEXT_VERSION is defined to 39 or greater.
By changing the above code to this, it will compile properly.
Code: [Select]
#if GL_GLEXT_VERSION < 39 // this define was removed in glext.h versions 39 and greater
case GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT:
strcpy(err_txt, "Image attached to more than one FBO!\n");
break;
#endif
This would fix it for everyone. Alternatively, you could just delete all those lines.

-Steven