SDL 1.3: Creating OpenGL 3.x context

I was looking into creating an OpenGL 3.x context as described here:

http://www.opengl.org/wiki/Tutorial1:Creating_a_Cross_Platform_OpenGL_3.2_Context_in_SDL%28C_/_SDL%29

I have run into some problems on Linux, specifically that I get a
green colored window no matter what color values I put in
glClearColor. I thought it was related to libGL conflicts due to fglrx
so I cleaned my system of any possible conflicts and tried again but
ran into the same problem. I tried the same code on Windows 7 and it
works fine. I tried debugging with one of those OpenGL debuggers
(bugle) and found that the glClearColor is called with arguments (0.0,
1.875, 0.0, 1.0) no matter what I do.

Any help on this would be appreciated.

Thanks.

Sunny Sachanandani

+91-9784313832

I should point out that I modified the source code from the tutorial
to account for changes in the SDL API since the tutorial was written
so I am attaching my code.

Sunny Sachanandani

+91-9784313832On Sat, Feb 19, 2011 at 7:50 PM, Sunny Sachanandani <@Sunny_Sachanandani> wrote:

I was looking into creating an OpenGL 3.x context as described here:

http://www.opengl.org/wiki/Tutorial1:Creating_a_Cross_Platform_OpenGL_3.2_Context_in_SDL%28C_/_SDL%29

I have run into some problems on Linux, specifically that I get a
green colored window no matter what color values I put in
glClearColor. I thought it was related to libGL conflicts due to fglrx
so I cleaned my system of any possible conflicts and tried again but
ran into the same problem. I tried the same code on Windows 7 and it
works fine. I tried debugging with one of those OpenGL debuggers
(bugle) and found that the glClearColor is called with arguments (0.0,
1.875, 0.0, 1.0) no matter what I do.

Any help on this would be appreciated.

Thanks.

Sunny Sachanandani

+91-9784313832

-------------- next part --------------
A non-text attachment was scrubbed…
Name: tutorial1.c
Type: text/x-csrc
Size: 1916 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20110219/bfdb3793/attachment.c

My problem seems to be solved now. I was using the gl3.h header from
the opengl website along with mesa on my system. I will try
proprietary drivers that are compatible with OpenGL 3.x along with the
gl3.h header and see if that works. If not, would it be better to get
function pointers (to glClearColor, glClear, etc.) using SDL or some
library like GLew/GLee?

Sunny Sachanandani

+91-9784313832On Sat, Feb 19, 2011 at 7:59 PM, Sunny Sachanandani <@Sunny_Sachanandani> wrote:

I should point out that I modified the source code from the tutorial
to account for changes in the SDL API since the tutorial was written
so I am attaching my code.

Sunny Sachanandani

+91-9784313832

On Sat, Feb 19, 2011 at 7:50 PM, Sunny Sachanandani <@Sunny_Sachanandani> wrote:

I was looking into creating an OpenGL 3.x context as described here:

http://www.opengl.org/wiki/Tutorial1:Creating_a_Cross_Platform_OpenGL_3.2_Context_in_SDL%28C_/_SDL%29

I have run into some problems on Linux, specifically that I get a
green colored window no matter what color values I put in
glClearColor. I thought it was related to libGL conflicts due to fglrx
so I cleaned my system of any possible conflicts and tried again but
ran into the same problem. I tried the same code on Windows 7 and it
works fine. I tried debugging with one of those OpenGL debuggers
(bugle) and found that the glClearColor is called with arguments (0.0,
1.875, 0.0, 1.0) no matter what I do.

Any help on this would be appreciated.

Thanks.

Sunny Sachanandani

+91-9784313832

The source of all my troubles seems to be the gl3.h header from the
opengl website. Using the mesa gl.h or glew.h or Windows gl.h (circa
1995) seems to be fine.

Sorry for bugging everyone.

Sunny Sachanandani

+91-9784313832On Sat, Feb 19, 2011 at 8:46 PM, Sunny Sachanandani <@Sunny_Sachanandani> wrote:

My problem seems to be solved now. I was using the gl3.h header from
the opengl website along with mesa on my system. I will try
proprietary drivers that are compatible with OpenGL 3.x along with the
gl3.h header and see if that works. If not, would it be better to get
function pointers (to glClearColor, glClear, etc.) using SDL or some
library like GLew/GLee?

Sunny Sachanandani

+91-9784313832

On Sat, Feb 19, 2011 at 7:59 PM, Sunny Sachanandani <@Sunny_Sachanandani> wrote:

I should point out that I modified the source code from the tutorial
to account for changes in the SDL API since the tutorial was written
so I am attaching my code.

Sunny Sachanandani

+91-9784313832

On Sat, Feb 19, 2011 at 7:50 PM, Sunny Sachanandani <@Sunny_Sachanandani> wrote:

I was looking into creating an OpenGL 3.x context as described here:

http://www.opengl.org/wiki/Tutorial1:Creating_a_Cross_Platform_OpenGL_3.2_Context_in_SDL%28C_/_SDL%29

I have run into some problems on Linux, specifically that I get a
green colored window no matter what color values I put in
glClearColor. I thought it was related to libGL conflicts due to fglrx
so I cleaned my system of any possible conflicts and tried again but
ran into the same problem. I tried the same code on Windows 7 and it
works fine. I tried debugging with one of those OpenGL debuggers
(bugle) and found that the glClearColor is called with arguments (0.0,
1.875, 0.0, 1.0) no matter what I do.

Any help on this would be appreciated.

Thanks.

Sunny Sachanandani

+91-9784313832