All the source code I have seen thus far includes “GL/gl.h” and not
"SDL_opengl". “SDL_opengl” does not include the base OpenGL types, e.g…
typedef float GLfloat; /* single precision float */
SDL_opengl does something better, ie it includes GL/gl.h itself, with
the added bonus that it will include OpenGL/gl.h instead on a macosx. So
your code will be more portable.
… which are necessary. As these are defined in “gl.h”, this file must
be included. If this is the case, then is “SDL_opengl” ever used ?
Yes, for portability !
Also i was wondering how would you draw a sphere without either of those?
Ive not heard many good things about glut so im wary to use it or glu (which
i havent heard much about) but would still like to be able to draw spheres.> ----- Original Message -----
From: stephane.marchesin@wanadoo.fr (Stephane Marchesin)
Newsgroups: loki.open-source.sdl
To:
Sent: Saturday, November 09, 2002 4:44 AM
Subject: Re: [SDL] “GL/gl.h” and not “SDL_opengl” ?
Luke J Crook wrote:
All the source code I have seen thus far includes “GL/gl.h” and not
"SDL_opengl". “SDL_opengl” does not include the base OpenGL types,
e.g…
typedef float GLfloat; /* single precision float */
SDL_opengl does something better, ie it includes GL/gl.h itself, with
the added bonus that it will include OpenGL/gl.h instead on a macosx. So
your code will be more portable.
… which are necessary. As these are defined in “gl.h”, this file must
be included. If this is the case, then is “SDL_opengl” ever used ?
Yes, for portability !
SDL_opengl.h isn’t protected by magic incantations. You can just open it,
and it’s plain to see that it includes both gl.h and glu.h, but not glut.h
(GLUT is mostly a toolkit anyway, which you don’t need when using SDL).
Also i was wondering how would you draw a sphere without either of those?
Tesselate the sphere into individual polygons yourself, using basic
trigonometric functions (sin and cos).