For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings

 

Need to speed up your development?
Have a look at our:

Samples & Tools

 

Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

glPolygonOffsetEXT()

Robert Boehne's picture
Forums: 

I am getting an error when compiling the libOpenGL.so file under Linux using MetroLink's OpenGL. The problem is that glPolygonOffsetEXT() is the call that the code seems to be looking for, but it should (in this case) be looking for glPolygonOffset(), as the version of OpenGL I'm using is 1.1.

In OpenGL_subrvis.c :

/* Polygon Offset */ #ifdef GL_EXT_polygon_offset

if (QueryExtension("GL_EXT_polygon_offset"))

{

/* Version OpenGL 1.0 */

if (!supportsOneDotOne())

{

glPolygonOffsetEXT(0.5F, 0.0005F);

glEnable(GL_POLYGON_OFFSET_EXT);

}

/* Version OpenGL 1.1 ou plus */

else

{ #ifdef __sgi

glPolygonOffsetEXT(0.5, 0.0005);

glEnable(GL_POLYGON_OFFSET_EXT); #else

glPolygonOffset(1.0, 0.);

glEnable(GL_POLYGON_OFFSET_FILL); #endif

}

} #endif /* GL_EXT_polygon_offset */

Now, if we then look at the file OpenGL_Extentions.c:

#ifdef GL_VERSION_1_1 #define GL_EXT_vertex_array 1 #define GL_EXT_polygon_offset 1 #define GL_EXT_blend_logic_op 1 #define GL_EXT_texture 1 #define GL_EXT_copy_texture 1 #define GL_EXT_subtexture 1 #define GL_EXT_texture_object 1 #endif /* GL_VERSION_1_1 */

/* * Contournement temporaire glPolygoneOffsetEXT * La syntaxe change entre OpenGL 1.0 et OpenGL 1.1 */

#if defined (__sun) || defined (__osf__) || defined (__hp) #define glPolygonOffsetEXT(a, b) glPolygonOffset(a, b) #endif #if defined (__sun) #define GL_POLYGON_OFFSET_EXT GL_POLYGON_OFFSET_FILL #endif

#ifdef WNT #define glPolygonOffsetEXT(a, b) glPolygonOffset(a, b) #define GL_POLYGON_OFFSET_EXT GL_POLYGON_OFFSET_FILL #endif /* WNT */

This preprocessor definition defines glPolygonOffsetEXT() as glPolygonOffset() depending on the operating system. The problem is that it isn't the operating system that defines this. Rather, it is the version of OpenGL, which is likely to change on each operating system. What I would like to propose is that the preprocessor definitions not depend so much on OS definitions. In this case there should be a dependency on GL_VERSION_1_1 (which should infer glPolygonOffset) and any use of extentions should query the existence of that extention first. I would be willing to contribute...