From e74289be3db19c3f66b6f3aecaa433beff8a2d25 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Sat, 2 Feb 2013 21:37:31 -0500 Subject: [PATCH] draw a quad --- sdl_opengl_bare.d | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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)) {