Blank screen on android

Same code with <GLES/gl.h> swapped to <GL/gl.h> works fine in linux.
But when I run it on my Samsung galaxy ace II I just get a blank screen.

Code Bellow
Init Function -----------
if ( (SDL_Init( SDL_INIT_VIDEO | SDL_INIT_AUDIO ) == -1 ) )
{
printf(“Could not initialize SDL: %s.\n”, SDL_GetError());
exit(-1);
}

SDL_GL_SetAttribute(SDL_GL_RED_SIZE,8);

—snip----

if ( *(windowed) == 1 )
{
screen->image = SDL_CreateWindow("Silverspeed", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 0, 0, SDL_WINDOW_SHOWN|SDL_WINDOW_OPENGL);
}else{
	screen->image = SDL_CreateWindow("Silverspeed", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 0, 0, SDL_WINDOW_SHOWN|SDL_WINDOW_OPENGL|SDL_WINDOW_FULLSCREEN);
}

SDL_GLContext glcontext = SDL_GL_CreateContext(screen->image);

glViewport(0,0,screen->area.w,(int)screen->area.h);

glMatrixMode(GL_PROJECTION);
glLoadIdentity();

//gluOrtho2D(0,screen->area.w,screen->area.h,0);
glOrthox(0, screen->area.w, screen->area.h, 0,  -1, 1);

glMatrixMode(GL_MODELVIEW);
glLoadIdentity();

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();

main function ------

SDL_Surface *i = IMG_Load("cover.png");

menuCount=1;
SDL_GL_LoadTexture(i,menuTextures,&menuCount, texcoord,menuW,menuH,menuW2, menuH2);

glColor4ub(255,255,255,255);
glEnable(GL_TEXTURE_2D);	
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);//GL_DECAL);
//glPushAttrib(GL_ENABLE_BIT);
glDisable(GL_DEPTH_TEST);
glDisable(GL_CULL_FACE);
glDisable( GL_LIGHTING );
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
glPixelStorei(GL_UNPACK_ALIGNMENT,1);

// Main Loop
while ( ! quit )
{

	// Event Handling
	while ( SDL_PollEvent( &event ) )
	{
		switch(event.type)
		{
			case SDL_FINGERDOWN:
				quit=1;
			break;

			case SDL_QUIT:
				quit=1;
			break;

		}
	}

	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
	glLoadIdentity();

	draw(&screen,0,menuTextures,0,0,menuW[0],menuH[0],menuW2[0],menuH2[0]);
	SDL_GL_SwapWindow(screen.image);

draw ----
float height=(float)h/(float)tempH;
float width=(float)w/(float)tempW;

glBindTexture( GL_TEXTURE_2D, *(texture+entity) );

const GLfloat t[8] = { 0.0, 0.0, width,   0.0, width,   height,   0.0, height };
const GLshort v[8] = { x,   y,   x+w,     y,   x+w,     y+h,      x,   y+h };

glVertexPointer( 2, GL_SHORT, 0, v );
glEnableClientState( GL_VERTEX_ARRAY );

glTexCoordPointer( 2, GL_FLOAT, 0, t );
glEnableClientState( GL_TEXTURE_COORD_ARRAY );

glDrawArrays( GL_TRIANGLE_FAN, 0, 4 );

texture----

tempW[0]=pow2((w+d));
tempH[0]=pow2(
(h+d));

	*(w2)=0;
	*(h2)=0;
	*(w2)=tempW[0];
	*(h2)=tempH[0];


for(d=0;d<*(texcount);d++)
{
	if ( tempSurf->format->BytesPerPixel == 3 )
	{

	surface[d] = SDL_CreateRGBSurface(
			SDL_SWSURFACE,
			tempW[d], tempH[d],
			24,
	#if SDL_BYTEORDER == SDL_LIL_ENDIAN /* OpenGL RGBA masks */
				0x000000FF, 
				0x0000FF00, 
				0x00FF0000, 
				0xFF000000
	#else
				0xFF000000,
				0x00FF0000, 
				0x0000FF00, 
				0x000000FF
	#endif
		       );
	}else{
		surface[d] = SDL_CreateRGBSurface(
				SDL_SWSURFACE,
				tempW[d], tempH[d],
				32,
	#if SDL_BYTEORDER == SDL_LIL_ENDIAN /* OpenGL RGBA masks */
				0x000000FF, 
				0x0000FF00, 
				0x00FF0000, 
				0xFF000000
	#else
				0xFF000000,
				0x00FF0000, 
				0x0000FF00, 
				0x000000FF
	#endif
			       );
	}
	SDL_SetSurfaceBlendMode(tempSurf, SDL_BLENDMODE_NONE); 
	SDL_GetSurfaceAlphaMod(tempSurf,&saved_alpha);
	SDL_SetSurfaceAlphaMod(tempSurf,255);
	SDL_BlitSurface(tempSurf, NULL, surface[0], NULL);
	SDL_SetSurfaceAlphaMod(tempSurf,saved_alpha);
}

// Genorate and bind textures in list
glGenTextures(*(texcount), texture);
for(d=0;d<*(texcount);d++)
{
	glBindTexture(GL_TEXTURE_2D, *(texture+d));
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
	if ( surface[d]->format->BytesPerPixel == 3 )
	{
		glTexImage2D(GL_TEXTURE_2D,0,GL_RGB,tempW[d],tempH[d],0,GL_RGB,GL_UNSIGNED_BYTE,surface[d]->pixels);
	}else{
		glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA,tempW[d],tempH[d],0,GL_RGBA,GL_UNSIGNED_BYTE,surface[d]->pixels);
	}
	
}

checked for gl errors after each important function, none… been trying different things for hours, with no change… black screen on my phone…

It would be nice if you could upload the code to pastebin.com in order to
read it easily and formatted. I believe it would even take less time to
troubleshoot the problem.

2013/3/12 image28 > checked for gl errors after each important function, none… been trying

different things for hours, with no change… black screen on my phone…


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

http://pastebin.com/ktszRCpF

http://pastebin.com/0UgcMFcH