world_of_cow/mmn_17.c

37 lines
910 B
C
Raw Normal View History

2023-07-03 15:40:28 +00:00
#include <GL/freeglut.h>
#include <GL/freeglut_std.h>
#include <GL/gl.h>
#include <stdio.h>
#include <math.h>
void display(void) {
// Clear screen
glClearColor(0.0, 0.0, 0.0, 1.0); // Dark theme :)
glClear(GL_COLOR_BUFFER_BIT);
glFlush();
}
void mouseEvent(int button, int state, int x, int y) {
}
int main(int argc, char** argv) {
/* initialize glut and window */
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB);
glutInitWindowSize(800, 500);
glutInitWindowPosition(450, 450);
/* create window and set callbacks */
glutCreateWindow("glutLeaveMainLoop is undefined if called from a nested loop");
glutDisplayFunc(display);
glutMouseFunc(mouseEvent);
/* set projection and camera */
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(0.0, 800.0, 0.0, 500.0);
glutMainLoop();
return 0;
}