chris_c
Member
- Joined
- Jun 25, 2010
- Messages
- 393
- Age
- 56
Certainly for a new user the complexity of egl and on top of that xlib is like looking up at a shear cliff thinking how'm I getting up that before high tide!
While libSDL is tempting, I've encountered HARD lockups from just simple seg faults, far from ideal!
(we can only hope that the next firmware gets a pandora optimised version of sdl - that can be abused without locking the machine!)
This might also be useful for more experienced coders as you can just extract a fresh copy - drop your GLES test code / idea into the render loop and away you go!
Here's whats in the framework so far....
(paste of readme.txt)
This is an initial version - there are a number of things need improving!
I would welcome code contributions.
This frame work intends to hide from the end user the complexity of
both EGL and Xlib.
This way the end user can just drop in their test GLES code into
the main render loop and away...
libSDL had been rejected completely as (with v1.2) I've found it possible
to completely lock up the machine when a vanila seg fault happens... ggrrr
The framework provides a number of routines to make life easier.
int initDisplay();
This sets up GLES creating a fullscreen window and hiding the cursor
etc etc, you should imediatly quit if it does not return 0
GLuint loadImage(const char *filename);
This loads a PNG file and returns a GLES texture name
int* getKeysPointer();
int* getMousePointer();
These get pointers to arrays for mouse and key states mouse[0]/[1] is
the last x,y coordinates mouse[2] is true if the screen is being touched.
The keyboard array is and array of key states corresponding to key states
for example the raw code for the q button is 24, if key[24] is true then
the q key is currently down...
void set3dMode();
void set2dMode();
The framework must be in 2d "mode" to use glPrintf...
void glPrintf(float x, float y,const char *fmt, ...);
This works just like a normal printf except it prints to x,y coordinates
on the screen you can have any number of parameters providing the end
resulting string is less than 255 characters - control characters are
NOT supported.
void setSwapInterval(int iv);
void swapBuffers();
As Egl is hidden from the end user these equivilent routines use the pointers
kept internally so the end user doesn't need to care about them...
void processEvents();
Call this once a frame just to update the mouse and key states from
the xlib event queue
void closeGLES();
Use this to free close down GLES gracefully...
While libSDL is tempting, I've encountered HARD lockups from just simple seg faults, far from ideal!
(we can only hope that the next firmware gets a pandora optimised version of sdl - that can be abused without locking the machine!)
This might also be useful for more experienced coders as you can just extract a fresh copy - drop your GLES test code / idea into the render loop and away you go!
Here's whats in the framework so far....
(paste of readme.txt)
This is an initial version - there are a number of things need improving!
I would welcome code contributions.
This frame work intends to hide from the end user the complexity of
both EGL and Xlib.
This way the end user can just drop in their test GLES code into
the main render loop and away...
libSDL had been rejected completely as (with v1.2) I've found it possible
to completely lock up the machine when a vanila seg fault happens... ggrrr
The framework provides a number of routines to make life easier.
int initDisplay();
This sets up GLES creating a fullscreen window and hiding the cursor
etc etc, you should imediatly quit if it does not return 0
GLuint loadImage(const char *filename);
This loads a PNG file and returns a GLES texture name
int* getKeysPointer();
int* getMousePointer();
These get pointers to arrays for mouse and key states mouse[0]/[1] is
the last x,y coordinates mouse[2] is true if the screen is being touched.
The keyboard array is and array of key states corresponding to key states
for example the raw code for the q button is 24, if key[24] is true then
the q key is currently down...
void set3dMode();
void set2dMode();
The framework must be in 2d "mode" to use glPrintf...
void glPrintf(float x, float y,const char *fmt, ...);
This works just like a normal printf except it prints to x,y coordinates
on the screen you can have any number of parameters providing the end
resulting string is less than 255 characters - control characters are
NOT supported.
void setSwapInterval(int iv);
void swapBuffers();
As Egl is hidden from the end user these equivilent routines use the pointers
kept internally so the end user doesn't need to care about them...
void processEvents();
Call this once a frame just to update the mouse and key states from
the xlib event queue
void closeGLES();
Use this to free close down GLES gracefully...