PDA

View Full Version : OpenGL defines



rombust
12-10-2013, 08:25 AM
In the stencil example, I had to add:



if (glClampColor)
{
#ifdef GL_CLAMP_READ_COLOR
glClampColor(GL_CLAMP_READ_COLOR, GL_FALSE);
#else
glClampColor(clan::GL_CLAMP_READ_COLOR, GL_FALSE);
#endif
}

This is because Linux #defines GL_CLAMP_READ_COLOR, and windows does not

Note, if the stencil example uses the clan namespace, this would not be required.

Solution for this hack....
1) Change the example to use the clan namespace (via the using namespace directive)
2) Change ClanLib\Sources\API\GL\opengl_defines.h to #undef all opengl defines
3) Change GL_ prefix to CL_
4) Change the enum to #define
5) Ignore the problem

I vote, in order of preference 5, 1, 2
I am not even voting for 2 and 3, I shudder even thinking about it.

daltomi
12-10-2013, 03:11 PM
I do not know if it's important but another file that uses the constant is

Sources/GL/GL3/gl3_graphic_context_provider.cpp:454