diff --git a/sdl_opengl_bare.d b/sdl_opengl_bare.d index 18d8103..566b6db 100644 --- a/sdl_opengl_bare.d +++ b/sdl_opengl_bare.d @@ -24,6 +24,8 @@ void display() { drawing = true; glClear(GL_COLOR_BUFFER_BIT); + glPushMatrix(); + glRotatef(SDL_GetTicks() * 90.0 / 1000, 0, 0, 1); glBegin(GL_QUADS); glColor3f(1, 1, 1); glVertex3f(5.0, 5.0, 0.0); @@ -34,8 +36,9 @@ void display() glColor3f(0, 1, 0); glVertex3f(5.0, -5.0, 0.0); glEnd(); - SDL_GL_SwapBuffers(); + glPopMatrix(); drawing = false; + SDL_GL_SwapBuffers(); } extern (C) Uint32 timer_callback(Uint32 interval, void *param) @@ -73,7 +76,7 @@ int main(char[][] args) init(); SDL_Event event; - SDL_AddTimer(1000 / 50, &timer_callback, null); + SDL_AddTimer(1000 / 60, &timer_callback, null); while (SDL_WaitEvent(&event)) { if (event.type == SDL_QUIT)