EGLPort (interfaces to use EGL with SDL/RAW framebuffers)


Cool, I just struggled to get my project running with GLES2 (tried the old eglport from sebts link amongst other things). Then googled "gles2" "eglport", got only two results, and find that one leads me to a new solution that is only a few days old! :)


Did you also test it on a PC (for example with mesa 3d driver) or only on the Pandora?
 
No i have not used this directly on the PC, i have only used it for pandora, wiz and caanoo. I just use SDL OpenGL support on the PC (linux/win32). But if mesa supports EGL I dont see why it couldnt work.


If you do use it and find anything out let me know so it can be improved.
 
Yes, mesa supports egl and gles. I'll let you know.
 
Thanks for that link sebt. (although the eglport link to the source needs to be changed)
Hope you don't mind, sebt3, I updated the link on your page.


I'm going to have a play with this when I get some free time. Cheers
 
One other thought i had review what i put up, is the use of STL. While it made some code easier, I think its best to make this C compatible, so I also will try to remove any specific c++ stuff.
 
Just tried to compile it into a C program. There were some errors, that could be solved with #include <string.h> instead of #include <string>.


But this one, I don't know how to solve:



Code:
arm-angstrom-linux-gnueabi-gcc -O2 -DPANDORA -DHAVE_GLES -O3 -pipe -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize -ffast-math -fsingle-precision-constant -fsigned-char -I. -I/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/SDL -I/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include -D_GNU_SOURCE=1 -D_REENTRANT -DUNIX  -DSOUND -DOPENGL -c -o eglport.o eglport.c

In file included from eglport.c:26:

eglport.h:34: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'namespace'

eglport.h:67: error: expected ';', ',' or ')' before '&' token

eglport.c:48: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'VSync'

eglport.c: In function 'EGL_SwapBuffers':

eglport.c:139: error: 'VSync' undeclared (first use in this function)

eglport.c:139: error: (Each undeclared identifier is reported only once

eglport.c:139: error: for each function it appears in.)

eglport.c:139: error: 'true' undeclared (first use in this function)

eglport.c: In function 'EGL_Open':

eglport.c:152: error: 'string' undeclared (first use in this function)

eglport.c:152: error: expected ';' before 'output'

eglport.c:189: error: 'output' undeclared (first use in this function)

eglport.c: In function 'ConfigureEGL':

eglport.c:209: warning: initialization makes integer from pointer without a cast

eglport.c: At top level:

eglport.c:352: error: expected ';', ',' or ')' before '&' token

make: *** [eglport.o] Error 1


Edit: Also, is EGL_Destroy EGL_Close now?


Edit2: Just tried to update eglport in another project, that uses C++. There it works. Isn't it supposed to work with C and C++ code? I have not defined __cplusplus


DJWillis said on IRC it was a problem with the namespace, if that helps.


Edit3: Tried to build with the eglport from sebt3's hosting (sebt3.openpandora.org/buildtools) and that worked.
 
Last edited by a moderator:
mcobit: i used STL that wont work in C code, i.e std::string and std::vector. Looks like you might have missed my post 2 up from yours. I need to remove that c++ code in order to make it C compatible.


The __cplusplus makes C code compat with c++
 
Oh, completely missed it. But as it works with the earlier version, it is ok. Thanks!
 
I'm trying to build a test on sebt3's VM, and I'm getting an error in eglport.h, it's saying



Code:
eglport.h|67|warning: type defaults to &#8216;int&#8217; in declaration of &#8216;string&#8217;|

eglport.h|67|error: expected &#8216;;&#8217;, &#8216;,&#8217; or &#8216;)&#8217; before &#8216;&&#8217; token|

eglport.c|48|error: expected &#8216;=&#8217;, &#8216;,&#8217;, &#8216;;&#8217;, &#8216;asm&#8217; or &#8216;__attribute__&#8217; before &#8216;VSync&#8217;|

eglport.c||In function &#8216;EGL_Close&#8217;:|

eglport.c|102|warning: implicit declaration of function &#8216;CheckEGLErrors&#8217;|

eglport.c||In function &#8216;EGL_SwapBuffers&#8217;:|

eglport.c|139|error: &#8216;VSync&#8217; undeclared (first use in this function)|

eglport.c|139|error: (Each undeclared identifier is reported only once|

eglport.c|139|error: for each function it appears in.)|

eglport.c|139|error: &#8216;true&#8217; undeclared (first use in this function)|

eglport.c||In function &#8216;EGL_Open&#8217;:|

eglport.c|152|error: &#8216;string&#8217; undeclared (first use in this function)|

eglport.c|152|error: expected &#8216;;&#8217; before &#8216;output&#8217;|

eglport.c|189|error: &#8216;output&#8217; undeclared (first use in this function)|

eglport.c|217|error: #error Incorrect Opengl-ES Configuration for s_contextAttribs|

eglport.c||In function &#8216;ConfigureEGL&#8217;:|

eglport.c|245|error: &#8216;s_contextAttribs&#8217; undeclared (first use in this function)|

eglport.c|352|warning: type defaults to &#8216;int&#8217; in declaration of &#8216;string&#8217;|

eglport.c|352|error: expected &#8216;;&#8217;, &#8216;,&#8217; or &#8216;)&#8217; before &#8216;&&#8217; token|

||=== Build finished: 12 errors, 3 warnings ===|


It could be the way I set the project up (CodeBlocks -> SDL app, w/ project build options #defines : HAVE_GLES and USE_EGL_SDL). Any ideas?


Cheers
 
And maybe rename to cpp extension :)


If your project is in C, use the older version from sebt3s hosting (see some posts before)
 
I did make the changes I think will make it C compatible, but Im still writing up the basic app to test it. Until then the code only works as c++.
 
Okay, I renamed the file to cpp, and I'm now getting this:



Code:
eglport.cpp|217|error: #error Incorrect Opengl-ES Configuration for s_contextAttribs|

eglport.cpp||In function &#8216;int8_t ConfigureEGL(void*)&#8217;:|

eglport.cpp|245|error: &#8216;s_contextAttribs&#8217; was not declared in this scope|

||=== Build finished: 2 errors, 0 warnings ===|


Do I need to use const USE_GLES1 or USE_GLES2 - What are the differences?


Cheers
 
The default should be with sdl and gles1.


Is your program written in C or C++ ?
 
Back
Top