Original Post
This code renders at a solid 2fps lol. Any thoughts? Drawing code Loading Screen drawing code Any ideas?
{
glPushMatrix();
// Bind the texture to which subsequent calls refer to
glBindTexture( GL_TEXTURE_2D, ogl );
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST);
glBegin( GL_QUADS );
//Top-left vertex (corner)
glTexCoord2f( 0, 0 );
glVertex2d( x, y );
//Bottom-left vertex (corner)
glTexCoord2f( 1, 0 );
glVertex2d( x+w, y );
//Bottom-right vertex (corner)
glTexCoord2f( 1, 1 );
glVertex2d( x+w, y+h );
//Top-right vertex (corner)
glTexCoord2f( 0, 1 );
glVertex2d( x, y+h );
glEnd();
glPopMatrix();
}
// Have OpenGL generate a texture object handle for us
glGenTextures( 1, &ogl );
// Bind the texture object
glBindTexture( GL_TEXTURE_2D, ogl );
// Set the texture's stretching properties
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
// Edit the texture object's image data using the information SDL_Surface gives us
glTexImage2D( GL_TEXTURE_2D, 0, 3, sdl->w, sdl->h, 0,
GL_RGBA, GL_UNSIGNED_BYTE, sdl->pixels );
SDL_GL_SwapBuffers();
FrameDrawn();
UpdateFps();
if (SDL_GetError())
{
WriteLine(Error,SDL_GetError());
}