draw a quad
This commit is contained in:
parent
4dc0103df3
commit
e74289be3d
@ -19,6 +19,22 @@ void init()
|
|||||||
glTranslatef(0.0, 0.0, -10.0);
|
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)
|
int main(char[][] args)
|
||||||
{
|
{
|
||||||
DerelictSDL.load();
|
DerelictSDL.load();
|
||||||
@ -42,6 +58,7 @@ int main(char[][] args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
init();
|
init();
|
||||||
|
display();
|
||||||
SDL_Event event;
|
SDL_Event event;
|
||||||
while (SDL_WaitEvent(&event))
|
while (SDL_WaitEvent(&event))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user