Some help with active rendering !!!

Hi,

I am a former C++/SDL programmer, switching to java/jogl.

What i would like to have is:

-fullscreen exclusive mode
-a single rendering/polling thread

I get some headaches getting started with jogl. I looked
at the “Killer Games Programming” book. The author explains
the active and passive framework. I really get lost in this simple (?)
example, that explains the active framework. Thats way too complicated for me.
I really don´t want to start a seperate rendering thread. Is it possbible to do single-threaded
active rendering in jogl ?

SDL Programming was so easy, so should be Java programming, but it is much more
complicated. Maybe I should look at LWJGL, but then I would loose all this nice
helper functions, and the great backing of the people at sun. Thanks for that !

I really want to concentrate on my games - please help !!!
thanks,
Frederick

Yes, you can do single-threaded rendering with JOGL. Set up your Frame, make it undecorated, add a GLCanvas, make it visible, and set it as the full-screen window. Then call GLCanvas.getContext() and then GLContext.makeCurrent() / release() every rendering cycle. It isn’t the style I would recommend, though. I would suggest you look at the GLEventListener callback mechanism and try to get your app to fit in that framework, as it will give you more flexibility if you ever want to handle windowed mode, multiple windows, or switching back and forth between full-screen and windowed mode.

There are examples of full-screen mode in the demos.fullscreen package in the jogl-demos project. I’m not sure the workarounds that are in there are needed any more on the various platforms, though.

Thanks Ken !

that´s what I was looking for. I wouldn´t have made this up by my own.
Oh, maybe I am a bit stubborn, but I don´t like the listener-model for now.
Maybe because i don´t have the main loop “under my control”. Maybe the
day I grasp why the listener pattern applied to OGL is a good idea i will use it.
I am a friend of KISS, you know ? And a single threaded rendering loop is
what KISS means for me right now :slight_smile:

I saw that XNA is a little similiar in that respect, there are render, update and
init methods to implement.

thanks a lot,
Frederick