GLBasic forum

Main forum => GLBasic - en => Topic started by: bigsofty on 2009-Dec-09

Title: OpenGLES on iPhone... possible?
Post by: bigsofty on 2009-Dec-09
Is it possible to access OpenGLES (in a similar fashion to the way GL.BAS does) from using INLINE on the iPhone?

If so, can anyone provide and example that I can expand upon please?
Title: Re: OpenGLES on iPhone... possible?
Post by: trucidare on 2009-Dec-09
i think you can access all OGLES functions like GL.gbas - try it but think about limitation of GL ES.
Title: Re: OpenGLES on iPhone... possible?
Post by: bigsofty on 2009-Dec-09
I would stick in some INLINE OpenGLES but the headers for OpenGL and OpenGLES are different, OpenGLES is not just a reduced version (well it is kinda :P) but it has its own unique commands.

I think I need to access the same OpenGLES.h header file as GLBasic to remain compliant with GLBasics official rendering context?

If so, is there any chance of Gernot pointing me in the direction of OpenGLES.h that GLBasic uses?
Title: Re: OpenGLES on iPhone... possible?
Post by: Kitty Hello on 2009-Dec-09
hum. Internally I have a set of macros that "wrap" the non existing function to the EGL equivalent. Just use the GL header and remove parts that do not work. Then add the 2 functions you might need individually. ES is just a bunch of say 10 functions or so anyway.
Title: Re: OpenGLES on iPhone... possible?
Post by: bigsofty on 2009-Dec-09
OK, sounds quite simple, so I add the EGL stuff that I want to the OpenGL headers and ignore the non OpenGLES stuff.

Something like...

Code (glbasic) Select

INLINE
#ifdef CENTERLINE_CLPP
#define signed
#endif
#define OGL ::
typedef unsigned char   EGLBoolean;
ENDINLINE

INLINE
} extern "C" { EGLBoolean __stdcall eglWaitGL( void );; }; namespace __GLBASIC__ {
ENDINLINE
FUNCTION eglWaitGL:
INLINE
OGL eglWaitGL();
ENDINLINE
ENDFUNCTION
Title: Re: OpenGLES on iPhone... possible?
Post by: Kitty Hello on 2009-Dec-10
use IMPORT wherever possible.
Title: Re: OpenGLES on iPhone... possible?
Post by: bigsofty on 2009-Dec-10
Thanks Gernot and thanks  Trucidare(you were absolutely correct!  :good:)