PDA

View Full Version : OpenGL states ( glx conetxt ) and shared objects ( .so )



CopyCat
05-23-2002, 09:05 AM
Hi got a problem..
Probaly knwo the couse but don't knwo the solution.
I'm making a opengl renderer under linux.
And using somthing like plugin effects system ( the effects are stored in .so files and are loaded dynamicly with use of dnfcl.h functions ).
Now the problem is , the functions inside the .so files use gl functions ( applying textures etc ) but there is no effect...
Checked if the functions from the lib are loaded probpaly and if the function inside are realy called.
The main thread ( where the glx context was created ) is in the app which loads the .so files.

I checked if the functions inside the .so have acces to to GLX conetxt ( with glXGetCurrenContext ) and the structs points to the smae context as the struct created in the app ).

05-23-2002, 09:31 PM
I do not see why it should not work. Probably do you miss something in your OpenGL init code like setting some state or not loading a texture.

CopyCat
05-23-2002, 10:03 PM
The texture is loaded properly.
The states are enabled..

There is the main app which creates the GLX context.
And there's a .so file that has function e_func_render( effect* __e )
This function applys the effect ( this does only a texture bind - for test reasons ).
But the texture itsn't binded.
Checked for error - no errors at all...

CopyCat
05-23-2002, 10:41 PM
Sorry...found the problem...very stupid one....

05-23-2002, 10:45 PM
I think you are looking in the wrong direction if you are focusing on that the functions is in a shared .so file. The normal OpenGL functions is also in a shared library.
I do not know... you try to bind the texture in the main thread that created the OpenGL context, right?
The context is not shared between the threads.

05-23-2002, 10:46 PM
I was thinking too long to see you last post. http://www.opengl.org/discussion_boards/ubb/smile.gif

CopyCat
05-24-2002, 02:09 AM
The stuff works now ( hehehe....it's imbarasing...was calling the function from .so beetwen glBegin( ) and glEnd( ) ;P )
Now it works great..