PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Not rendering on device..

RapchikProgrammer · 05 May 2010, 21:07 UTC
Hey, im using edgelib for my game but am handling the rendering code myself.. but i have a problem, everything renders perfectly in windows but nothing displays on device.. i have all the functionality and i can see the fps spikes as they should happen, but i cant see anything actually rendered.. even rendering something as simple as this:
Code:
Ecd->dsp->BindTexture(textures[index]->texture);

vertices[0] = x;
vertices[1] = y;

vertices[2] = x+width;
vertices[3] = y;

vertices[4] = x;
vertices[5] = y+height;

vertices[6] = x+width;
vertices[7] = y+height;

glVertexPointer( 2, GL_SHORT, 0, vertices );

glTexCoordPointer( 2, GL_SHORT, 0, texCoords );

glDrawArrays( GL_TRIANGLE_STRIP, 0, 4);


Before this i call this every frame:

Code:
glClear(GL_COLOR_BUFFER_BIT);

display->Perspective2D(RESX, RESY, false);

// Disable unneeded arrays
glDisableClientState( GL_COLOR_ARRAY );
glDisableClientState( GL_NORMAL_ARRAY );

// Enable vertex and texCoord arrays
glEnableClientState( GL_VERTEX_ARRAY );
glEnableClientState( GL_TEXTURE_COORD_ARRAY );

glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
//glRotatef(180,1,0,0);
//glTranslatef(0,-RESY,0);
glMatrixMode(GL_TEXTURE);
glLoadIdentity();


its as simple as it gets.. one more strange thing even under windows is, that when i uncomment the commented lines above it runs perfectly and displays the image upside down, but if i remove the translation and rotate just 1 degree on the x axis the image disappears :/.. any idea whats causing this, and more importantly why nothing is rendering on device.. im using an n95 8gb, and all my 3d scenes are rendering perfectly just this 2d code doesnt render..
Hi,

Your code looks fine, perhaps there is another issue or the x/y coordinates are undefined. You could also try disabling the texture (and the texcoord client state) and see if it works better.

Also, make sure the glColor is set to white with full opacity.