Shine wrote:I've started to rewrite Lua Player with the SCons build management and based on OpenGL for all graphics output.
cool!
Shine wrote:For the PSP it uses pspgl, which has some limitations (see #ifdefs in common/LuGL.cpp).
You could simplify your implementation if you build a OpenGL function pointer table using eglGetProcAddress()/wglGetProcAddress()/glutGetProcAddress().
If the function pointer table contains the NULL pointer for a particular function, then it's not supported on the current implementation... this will be useful for GL extensions and cross-version compatibility, too (you don't need different LUA versions for OpenGL1.1, 1.2, 1.3, 1.4, 1.5, 2.0 etc but leave some function pointers just empty if they are not supported by the current implementation).
Also this makes it possible to share your wrapper code for multiple functions with the same parameter layout (e.g. same handler for all functions with no arguments, same for functions with float arguments etc).
Shine wrote:Crrently o PSP the 3D rendering is very slow and the graphics looks wrong. Maybe someone has an idea how to fix it.
can you please provide some numbers, how many frames per second are actually rendered?
The PSP GU hardware uses a very simple clip algorithm: triangles are clipped when some vertices are outside the clip margin of the screen. We could work around this by doing clipping in software, but this may slow down things and is probably not required in typical game development environments: usually you will have textures, models etc in high-resolution format and scale them down to lower-resolution textures and models for a particular target platform.
For the PSP this means that triangles should get a sane aspect ratio (very long and thin triangles are likely to fall victim of the simple clip algoritm of the PSP GU).
Shine wrote:Would be nice to port it to Mac OS X and Linux X11, too. Should be not too difficult: See common/luaplayer.h for the list of functions you have to implement and examples in the psp, ps3 and win32 implementations. On startup you have to call luaplayerMain, then the functions you provide will be called.
For Linux/X11 EGL wrappers are available on the web, for Linux/XGL EGL is a native API, so the PSP port should work as well. Writing an EGL wrapper for OSX should be simple, GLUT is available for all platforms, so a port to GLUT would handle them all.