Pure Opengl Project, Target Build Fails


talyn

Still Fresh
Joined
Jan 13, 2012
Messages
3
Hi Guys, first post. Hopefully someone can help me out.

I'm working on a Tetris clone, and am using OpenGL to do some 3D stuff. I've implemented most of the basics and have successfully done a bunch of testing on Windows (host build, codeblocks/mingw/etc.). Problem is that when I try to build the target executable, I get the following errors:

C:\Program Files (x86)\CAANOO\GPH_SDK\DGE\include\SDL\SDL_opengl.h|44|error: GL/gl.h: No such file or directory
C:\Program Files (x86)\CAANOO\GPH_SDK\DGE\include\SDL\SDL_opengl.h|45|error: GL/glu.h: No such file or directory

Followed by a bunch of other errors presumably due to the missing headers.

So, I'm just including SDL_opengl.h, and expecting it to include the right OpenGL headers ( GLES/gl.h ). Am I wrong to assume that the SDL_opengl header should include the right OpenGL headers automatically, or am I doing something wrong? I can't see any GLES/gl.h includes in the file, so I doubt I'm just missing a #define I need.

I used the new GP2X project wizard I installed with codeblocks, so I don't think I messed up the include directories or anything, but I guess that's a possibility.

Any help would be much appreciated.
Thanks,
~ Dan

(Sorry if this has been answered elsewhere already. I tried a few searches, but couldn't find anything related)
 
The caanoo have GLES which is a subset of GL. Trying to #include GL/gl.h will fail.
"SDL_opengl.h" will also fail as SDL doesnt support GLES as is.

You'll need to create your EGL context (there are a few code example out there, mine is probably not the best but works) and include GLES headers. You may need to change your code a bit as GLES dont support all of GL (like glBegin/glEnd dont work) and finally you'll need to link to GLES_CM ;)

Also using the search here is useless, use google with site:gp32x.de as first argument.
 
Last edited by a moderator:
You can see how to use opengles on caanoo: http://www.gp32x.de/board/index.php?/topic/58323-gl-tests/
 
Last edited by a moderator:
Thanks for the replies guys, I've been pretty busy this week and am just taking a look at the GLES examples out there now.

I set up a codeblocks project with your source sebt3, and I've been able to build the project for windows but it won't run. I get a segfault in TTF_SizeUNICODE(). When I try to build for the caanoo, I got a "GL/gl.h: No such file or directory" error (draw.h, line 16), so I tried defining HAVE_GLES, but that only resulted in a later error: "EGL/egl.h: No such file or directory."

I am using the base GPH_SDK for windows. Are you using any extra libraries or anything, or is my project just configured wrong?

I've also started taking a look at gl-test (earth) example you suggested Rikku2000, but it isn't building for windows. I"m getting an error: "too few arguments to function 'eglTerminate'" at gph_device_gl.c:44. Looking at gles/egi.h, I can see that there are two main blocks of methods with different eglTerminate definitions. At this point, I found it a bit weird that the if statement for the block is "#if defined(_WIN32) || defined(_WIN32)" - isn't that a bit redundant??

Regardless, the above error indicates that the gl-test application is designed solely for the caanoo. I'm going to keep looking at the available examples and try to come up with a good example showing how to use gles in either a windows test program or a gp2x/caanoo/etc application. Any ideas are welcome.

Thanks again,
~ Dan
 
talyn said:
I set up a codeblocks project with your source sebt3, and I've been able to build the project for windows but it won't run. I get a segfault in TTF_SizeUNICODE().
I'm guessing that this happens because the font could not be found/loaded correctly, and thus TTF_SizeUNICODE dereferences a NULL-pointer.

talyn said:
When I try to build for the caanoo, I got a "GL/gl.h: No such file or directory" error (draw.h, line 16), so I tried defining HAVE_GLES, but that only resulted in a later error: "EGL/egl.h: No such file or directory."
I think that should be #include <OpenGLES/egl.h>. The header files in the GPH SDK are arranged in a weird way.
Edit: Just looked at the code: You also have to define CAANOO.
 
Last edited by a moderator:
talyn said:
I set up a codeblocks project with your source sebt3, and I've been able to build the project for windows but it won't run. I get a segfault in TTF_SizeUNICODE(). When I try to build for the caanoo, I got a "GL/gl.h: No such file or directory" error (draw.h, line 16), so I tried defining HAVE_GLES, but that only resulted in a later error: "EGL/egl.h: No such file or directory."

I am using the base GPH_SDK for windows. Are you using any extra libraries or anything, or is my project just configured wrong?
I'm not using code::block nor Windows, so if you build my code with these, it would be a first ;)
EGL/egl.h have to be there to build for caanoo/pandora : this is the EGL header and an EGL context is mandatory for an GLES window (be it fullscreen or not). Dig your toolchain to find it.
Also hmn is right, you'll need to define CAANOO and HAVE_GLES to build for caanoo.
(also dont expect 3d glory : that's a minesweeper ;P)
 
Last edited by a moderator:
After doing a bunch of debugging with your minesweeper game, I realized the reason it wasn't working was because I forgot to copy the data (font) files to the caanoo >.<

I had made a framework for SDL apps, and am currently working on determining what's needed to use EGL so I can integrate it with my code. Maybe I'll post what I come up with once it's done.

Thanks for the help guys!
~ Dan
 
Back
Top