Blank screen

Started by
5 comments, last by Kalidor 17 years, 11 months ago
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?
www.zezenia.com
Advertisement
Put glGetError in a few key places and check if you are getting any errors.
I get GL_INVALID_OPERATION all the time...where could the problem be?
www.zezenia.com
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.
Mkay, after some debugging I see that SDL_CreateThread has some problems =O


int func(void* param)
{
glGetError~
}

SDL_CreateThread(func, (void*)&param);

any ideas..?
www.zezenia.com
your ogl context may be not available in the thread.
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*)&param);

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.

This topic is closed to new replies.

Advertisement