17 Jan 2011 22:41
Using Agar inside Freeglut
Hello,
I'm trying to integrate Agar widgets into Freeglut main loop.
I thought it should be possible to draw only Agar's widget, without
initialising its own render driver.
But if i try and skip the Agar's driver registration, i cannot use widgets.
So, when running my sample code, i got two windows, instead of Agar's
widget drawn in Freeglut window.
Below, you'll find my try.
I tried to make it as short as possible.
To compile:
gcc test_freeglut.c $(agar-config --cflags --libs) -Wall -lglut
Thank you for having a look.
/* based on hello.c
&& http://wiki.libagar.org/wiki/Custom_event_loop
*/
#include <GL/gl.h>
#include <GL/freeglut.h>
#include <agar/core.h>
#include <agar/gui.h>
#define ERROR(str) fprintf(stderr,"Error %s at %d\n",str,__LINE__);
int is_esc_pressed = 0;
(Continue reading)
RSS Feed