diff --git a/sdl_opengl_bare.d b/sdl_opengl_bare.d index ef81176..345cbdd 100644 --- a/sdl_opengl_bare.d +++ b/sdl_opengl_bare.d @@ -19,6 +19,22 @@ void init() glTranslatef(0.0, 0.0, -10.0); } +void display() +{ + glClear(GL_COLOR_BUFFER_BIT); + glBegin(GL_QUADS); + glColor3f(1, 1, 1); + glVertex3f(5.0, 5.0, 0.0); + glColor3f(1, 0, 0); + glVertex3f(-5.0, 5.0, 0.0); + glColor3f(0, 0, 1); + glVertex3f(-5.0, -5.0, 0.0); + glColor3f(0, 1, 0); + glVertex3f(5.0, -5.0, 0.0); + glEnd(); + SDL_GL_SwapBuffers(); +} + int main(char[][] args) { DerelictSDL.load(); @@ -42,6 +58,7 @@ int main(char[][] args) } init(); + display(); SDL_Event event; while (SDL_WaitEvent(&event)) {