Sign in to follow this  
D-Slicer

OpenGL Blank screen

Recommended Posts

Hello, hi, ola oi hej hel hul hal whatever! I'm using SDL and OpenGL for a game project. It works *perfect* under my own computer, which has Ubuntu 5.10 (Breezy badger, GNOME)..and the problem is, that it doesn't show anything on the screen except white for other people! =/ It is tested under Debian Etch and Fedora Core, also twice under different Windows comps (Ofcourse compiled on them to get the .exe). It can't be about texture loading, since I can't draw quads or triangles either. What could be the problem?

Share this post


Link to post
Share on other sites
Quote:
Original post by D-Slicer
I get GL_INVALID_OPERATION all the time...where could the problem be?

Lots of gl functions throw INVALID_OPERATION. Narrow it down to the *first* call which triggers it, then look that function up in the docs. That'll tell you what you're doing wrong.

In other words, RTFM.

Share this post


Link to post
Share on other sites
Mkay, after some debugging I see that SDL_CreateThread has some problems =O


int func(void* param)
{
glGetError~
}

SDL_CreateThread(func, (void*)¶m);

any ideas..?

Share this post


Link to post
Share on other sites
Quote:
Original post by D-Slicer
Mkay, after some debugging I see that SDL_CreateThread has some problems =O


int func(void* param)
{
glGetError~
}

SDL_CreateThread(func, (void*)¶m);

any ideas..?
I don't know what SDL_CreateThread does behind the scenes, but a thread must have a current OpenGL context in order to call OpenGL functions. Are you setting a current context for that new thread? In Windows this is done with wglMakeCurrent. SDL probably has its own cross-platform way to do it.

Using one OpenGL context in more than one thread is usually a bad idea. I recommend doing whatever needs to be done to prepare the data in the separate thread (ie: loading files) and then sending that data to OpenGL in the OpenGL thread.

EDIT: I don't see how this would be working perfectly on your system, however I don't know too much about multithreading in Linux.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this