Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to use glext.h correctly

2,991 views
Skip to first unread message

Marcus Elderic Koenig

unread,
Apr 19, 2002, 12:54:40 PM4/19/02
to
Hi there,

I got the recent extension header <glext.h> from
http://oss.sgi.com/projects/ogl-sample/registry/ and tried to include it
in my opengl-program.

inside glext.h, GL_RESCALE_NORMALS is properly defined.
it's not defined in my gl.h (which seems to operate on OpenGL 1.1 only).

I did read on the net that all new OpenGL 1.2/1.3 stuff is only useable
if you include glext.h.

Using this setup:

#include "windows.h"
#include "glut.h" (which included gl.h/glu.h)
#include "glext.h"

... some code
glEnable(GL_RESCALE_NORMALS);
... some code

I still cannot access GL_RESCALE_NORMALS. It seems that the 1.2-
definitions aren't imported correctly. my compiler (free borland c++
5.5.1 from www.borland.de) errors about no definied GL_RESCALE_NORMALS.

Using this setup:

#include "windows.h"
#include "glext.h"
#include "glut.h" (which included gl.h/glu.h)

... some code
glEnable(GL_RESCALE_NORMALS);
... some code

I cannot compile everything either, since my compiler already errors
about wrong and missing definitions of GL data types, etc in using
glext.h.

does any1 know a way how to correctly include all the headers, so
you can use OpenGL 1.1/1.2/1.3 functions and extensions???

For information:

I am using a nVIDIA GeForce 2 Ti on windowsXP (latest drivers).
In Nehe's Tutorial about listing available OpenGL-extensions with
GL_EXTENSIONS, my card lists all supported 1.2/1.3 extensions correctly.

Would be thankful for help :)
Have a nice day.

-elderic

Jason Allen

unread,
Apr 19, 2002, 1:00:59 PM4/19/02
to
#include <windows.h>
#include <GL/gl.h>
#include <GL/glext.h>
#include <GL/glut.h>

Gl.h defines all the OpenGL data types (like GLubyte or GLenum) so you must
include it before including glext.h.

Jason A.

"Marcus Elderic Koenig" <eld...@t-online.de> wrote in message
news:Xns91F5C06656CB1m...@62.153.159.134...

Marcus Elderic Koenig

unread,
Apr 19, 2002, 1:18:14 PM4/19/02
to
"Jason Allen" <jra...@yahoo.com> wrote in
news:f3Yv8.15303$oj5.6...@typhoon.austin.rr.com:

> #include <windows.h>
> #include <GL/gl.h>
> #include <GL/glext.h>
> #include <GL/glut.h>
>
> Gl.h defines all the OpenGL data types (like GLubyte or GLenum) so you
> must include it before including glext.h.
>
> Jason A.

if i do it like this, I still get the error

Undefined symbol 'GL_RESCALE_NORMALS' in function InitGL()

Jason Allen

unread,
Apr 19, 2002, 1:49:25 PM4/19/02
to
Try using GL_RESCALE_NORMALS_EXT instead.

Jason A.
"Marcus Elderic Koenig" <eld...@t-online.de> wrote in message

news:Xns91F5C465336A8m...@62.153.159.134...

George Ziniewicz

unread,
Apr 19, 2002, 1:51:06 PM4/19/02
to


I find GL_RESCALE_NORMAL in glext.h.

zin

Jason Allen

unread,
Apr 19, 2002, 1:54:25 PM4/19/02
to
Oops, that should be GL_RESCALE_NORMAL_EXT or GL_RESCALE_NORMAL

Jason A.
"Jason Allen" <jra...@yahoo.com> wrote in message
news:FMYv8.15315$oj5.6...@typhoon.austin.rr.com...

Ian D Romanick

unread,
Apr 19, 2002, 6:58:31 PM4/19/02
to
"Jason Allen" <jra...@yahoo.com> writes:

>Oops, that should be GL_RESCALE_NORMAL_EXT or GL_RESCALE_NORMAL

As of OpenGL 1.2 GL_RESCALE_NORMAL_EXT is depricated. If you're using
OpenGL 1.2 (or later) headers, use GL_RESCALE_NORMAL instead. If you really
don't know what type of system you're going to build on, do something like:

#ifndef GL_RESCALE_NORMAL
# ifdef GL_RESCALE_NORMAL_EXT
# define GL_RESCALE_NORMAL GL_RESCALE_NORMAL_EXT
# else
# error Must have GL_RESCALE_NORMAL or GL_RESCALE_NORMAL_EXT
# endif
#endif
--
Tell it to the Marines!

Jason Allen

unread,
Apr 19, 2002, 7:18:51 PM4/19/02
to
GL_RESCALE_NORMAL has the same enum value (0x803A) as GL_RESCALE_NORMAL_EXT
so it shouldn't make a difference.

Jason A.

"Ian D Romanick" <i...@cs.pdx.edu> wrote in message
news:a9q7en$po5$1...@regulus.cs.pdx.edu...

Sébastien GRIMARD

unread,
Apr 20, 2002, 5:33:24 AM4/20/02
to

"Ian D Romanick" <i...@cs.pdx.edu> a écrit dans le message de news:
a9q7en$po5$1...@regulus.cs.pdx.edu...

> "Jason Allen" <jra...@yahoo.com> writes:
>
> >Oops, that should be GL_RESCALE_NORMAL_EXT or GL_RESCALE_NORMAL
>
> As of OpenGL 1.2 GL_RESCALE_NORMAL_EXT is depricated. If you're using
> OpenGL 1.2 (or later) headers, use GL_RESCALE_NORMAL instead. If you
really
> don't know what type of system you're going to build on, do something
like:
>
That's right, but if you are using glext.h you are not programming in opengl
1.2 but in opengl 1.1 with opengl 1.2 fonctionnality as extensions, so you
should use GL_RESCALE_NORMAL_EXT at least as long as microsoft doesn't
provide an opengl 1.2 implementation (if you are programming under windows)


0 new messages