Jump to content
  • Advertisement
Sign in to follow this  
golgoth

OpenGL SDL and Glee!!!

This topic is 5043 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all! I m trying to make this extension work glActiveTextureARB(GL_TEXTURE0_ARB); uder windows xp and sdl release 1.2.7... with VS .NET... I ve installed Glee 3.0.5... I can compile without any warnings... Here s how I do it: #pragma comment(lib, "glee.lib") #include <glee.h> #include "gl.h" #pragma comment(lib, "opengl32.lib") int main(int in_argc, char **in_argv) { if (SDL_Init(SDL_INIT_VIDEO)) { return -1; } SDL_WM_SetCaption(WINDOW_TITLE, NULL); SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8); SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8); SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8); SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 8); SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 8); SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, WINDOW_BPP); SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); GLeeInit(); SNIP... The problem is each time I call: glActiveTextureARB(GL_TEXTURE0_ARB); it crash!!! Anyone familiar with this? THX

Share this post


Link to post
Share on other sites
Advertisement
From a quick glance I have two thoughts.

1) Either you're calling GLeeInit before obtaining a valid context (i.e. calling SDL_SetVideoMode)

2) Or you're setting the OpenGL settings after you're opening a window, which will impact nothing. I'm not sure if this could somehow screw things up.

I'm leaning towards number 1.

Share this post


Link to post
Share on other sites
we have this in the Glee readme!

Add a call to GLeeInit() after your OpenGL initialisation code.
If the return code is true then the initialisation is successful.
From this point onwards, you should have access to all OpenGL
extensions and core functionality.


...

Share this post


Link to post
Share on other sites
Quote:
Original post by golgoth
we have this in the Glee readme!

Add a call to GLeeInit() after your OpenGL initialisation code.
If the return code is true then the initialisation is successful.
From this point onwards, you should have access to all OpenGL
extensions and core functionality.


I think you're misunderstanding what "OpenGL initialisation code" means. You cannot obtain any extension until you have a valid OpenGL rendering context. It looks to me like you're trying to obtain your supported OpenGL extensions (by calling GLeeInit) before you open your window.

Try moving your GLeeInit call to a point after you set the video mode and see if that works.

Edit: Removed unnesessary comma.

Share this post


Link to post
Share on other sites
I ve put it after the SDL_SetvideoMode and the aplication wont start...but it doesnt crash... just exit... and the Glee return failed..

Share this post


Link to post
Share on other sites
Quote:
Original post by golgoth
I ve put it after the SDL_SetvideoMode and the aplication wont start...but it doesnt crash... just exit... and the Glee return failed..


That's awfully odd. May I see your SDL_SetVideoMode and surrounding code?

Share this post


Link to post
Share on other sites
Found something interesting:

int main(int in_argc, char **in_argv)
{

if (SDL_Init(SDL_INIT_VIDEO))
{
Trace("SDL initialization failed: %s\n\n", SDL_GetError());
return -1;
}
else
Trace("SDL initialization successful!\n\n");

// Create Window ///////////////////////////////////////////////////////////////////////////////

SDL_WM_SetCaption(WINDOW_TITLE, NULL);

SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, WINDOW_BPP);
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);

#ifdef _GLEE
if (GLeeInit())
{
Trace("GL Extension initialization failed: %s\n\n", SDL_GetError());
return -1;
}
else
{
Trace("GLee Extension initialization successful!\n\n");

if (GLEE_VERSION_1_3)
Trace("OpenGL 1.3 is supported!\n\n");
}
#endif


SNIP....

I do get GLee Extension initialization successful!
but I dont get the OpenGL 1.3 is supported!...

Is this my video card the problem?

I have gGforce 3?!?!


....

Share this post


Link to post
Share on other sites
Your GeForce 3 does support the 1.3 core extensions, IIRC. What exactly does your app do when you run it? It doesn't crash, but just exits, you said?

[Edited by - MikeMJH on October 1, 2004 12:57:01 AM]

Share this post


Link to post
Share on other sites
when I use GLeeInit() before SDL_SetVideoMode SDL_OPENGL | SDL_RESIZABLE it goes fine until I use:

glClientActiveTextureARB(GL_TEXTURE0_ARB);
or
glActiveTextureARB(GL_TEXTURE0_ARB);

then it crash;

if I use GLeeInit() after SDL_SetVideoMode it exit and GLeeInit() return failed.

...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!