Hi,
I recently got a n950 from the 2012 Coding Competition by nominating a game I developed for the n900 which was programmed in C++, sdl1.2 and opengl es2.0. I am trying to port the game to n9/n950.
I downloaded easy-chroot and a SDK image to develop on the n950 itself. The game compiled fine, but when I try to launch the game it crashes I get an error saying that glCreateShader returned 0 and in my debug file I see that all vertex buffer object also returned 0.
My guess is that something is wrong with the initialization of SDL and opengl es2.0, maybe with creating a context and a window. I tried to make a simple test to check how to initialize sdl and opengl es2.0 and set a working window up, but due to lack of documentations I couldn't find a good example how to set a window up.
Could anyone post a working code snippet/small example (like the test HERE) of the initialization of sdl1.2 and ogles2.0 for the harmattan platform(n950)?
( The SDL_GLES_CreateContext() and SDL_GLES_MakeCurrent(...) are missing because the are not supported in the harmattan port of libsdl1.2 and maybe this is the problem)
Thanks!
EDIT: Figured it out!
Here is the port of the maemo (n900) gles2 test to n950 harmattan if anyone is interested:
Remove the ".txt" from the attached file and compile with this command:
/* gles2 - a simple SDL_gles OpenGL|ES 2.0 sample for meego harmattan ( n9/n950 )
*
* This file is in the public domain, furnished "as is", without technical
* support, and with no warranty, express or implied, as to its usefulness for
* any purpose.
*/
/**
** I commented the lines that are not needed as SDL/SDL_opengles.h is no
** longer included in the harmattan port of SDL1.2, and added a little info.
** */
// The toggle_fullscreen() function is not needed, harmattan SDL1.2 making all windows fullscreen.
/*
static void toggle_fullscreen()
{
int res;
fullscreen = !fullscreen;
screen = SDL_SetVideoMode(0, 0, 16, SDL_SWSURFACE | (fullscreen ? SDL_FULLSCREEN : 0)); // The falgs argument must have the "SDL_OPENGLES" flag in it or a context for opengl will NOT be created.
assert(screen);
// res = SDL_GLES_SetVideoMode();
// if (res != 0) puts(SDL_GetError());
// assert(res == 0);
render();
}
*/
int main()
{
int res;
res = SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER);
assert(res == 0);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
// res = SDL_GLES_Init(SDL_GLES_VERSION_2_0);
assert(res == 0);
I recently got a n950 from the 2012 Coding Competition by nominating a game I developed for the n900 which was programmed in C++, sdl1.2 and opengl es2.0. I am trying to port the game to n9/n950.
I downloaded easy-chroot and a SDK image to develop on the n950 itself. The game compiled fine, but when I try to launch the game it crashes I get an error saying that glCreateShader returned 0 and in my debug file I see that all vertex buffer object also returned 0.
My guess is that something is wrong with the initialization of SDL and opengl es2.0, maybe with creating a context and a window. I tried to make a simple test to check how to initialize sdl and opengl es2.0 and set a working window up, but due to lack of documentations I couldn't find a good example how to set a window up.
Could anyone post a working code snippet/small example (like the test HERE) of the initialization of sdl1.2 and ogles2.0 for the harmattan platform(n950)?
The init code I currently have is this:
Thanks!
EDIT: Figured it out!
Here is the port of the maemo (n900) gles2 test to n950 harmattan if anyone is interested:
Remove the ".txt" from the attached file and compile with this command:
Check My Game, Alpha Strike V1.1.0-2 Now in Extras-devel.
Alpha Strike (v1.0.0-2) gameplay video: HERE!
Last edited by aStrike; 2012-11-18 at 23:43.