Here is what happens:
Here is what it looks like in Blender:
This is probably a really simple error to fix (I probably just need to drop in another glEnable, although Ive tried almost everything) so I feel bad for posting about it.
Here is the relevant code in my INIT function:
void init()
{
// Set projection transform
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-10.0f, 10.0f, -10.0f, 10.0f, -10.0f, 10.0f);
// Set view transform
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
gluLookAt(1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
//lighting
glEnable(GL_DEPTH_TEST);
glEnable(GL_COLOR_MATERIAL);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0); //player lights
glEnable(GL_LIGHT1); //sun light
glEnable(GL_NORMALIZE);
}
And here is my main:
int main( int agrc, char* args[] )
{
SDL_Init(SDL_INIT_EVERYTHING);
SDL_Surface* screen=SDL_SetVideoMode(600,400,32, SDL_SWSURFACE|SDL_OPENGL );
bool running = true;
Uint32 start;
SDL_Event event;
init();
while(running)
{
start=SDL_GetTicks();
while(SDL_PollEvent(&event))
{
switch(event.type)
{
case SDL_QUIT:
running = false;
break;
}
}
display();
SDL_GL_SwapBuffers();
angle = angle + .1;
if(angle > 360)
angle = 0;
if(1000/30>(SDL_GetTicks()-start))
SDL_Delay(1000/30>(SDL_GetTicks()-start));
}
SDL_FreeSurface(screen);
SDL_Quit();
return 0;
}