On Sun, May 31, 2009 at 05:11:52PM -0700, Samuel Crow wrote: > ----- Original Message ---- > > From: Carlos Yaque <[email protected]> > > To: Samuel Crow <[email protected]> > > Sent: Sunday, May 31, 2009 5:49:45 PM > > Subject: Re: [Agar] Running agar with SDL + OpenGL app > > > > I've been looking this example but it's not using SDL, so I'm not sure > > what to do. In my code I initialize SDL, and then the agar library. > > The problem is that I dont know if I have to initialize anything else, > > and what to do to render the gui elements, whether I have to set the > > gl matrixes properly, if the rendering functions have to be inside my > > "render" function... > > > > In fact it's a little bit frustrating going through the documentation, > > it has almost no info on what to do and which order :S
Typically, you would render your GL scene using the AG_GLView widget (http://libagar.org/man3/AG_GLView). Since you're mentioning GL matrices I assume you have a good reason not to use Agar's event loop or AG_GLView. Have a look at: http://wiki.libagar.org/wiki/Background_rendering You can ignore the "GK_*" functions in the sample code. The point is to call AG_WindowDraw() from your event loop to render the GUI elements. In the example, the background is drawn after AG_BeginRendering(), which clears the background and sets up Agar's own clipping planes, and that is probably not what you want. Actually, I would suggest you try the latest Agar SVN, which makes the process much easier with the AG_VIDEO_OVERLAY flag to AG_InitVideo() / AG_InitVideoSDL(). If AG_VIDEO_OVERLAY is in effect, AG_BeginRendering() and AG_EndRendering() will not clear the background, and your GL state will be fully preserved. _______________________________________________ Agar mailing list [email protected] http://libagar.org/lists.html
