forked from jckarter/hello-gl-ch3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhello-gl-dummy.c
56 lines (45 loc) · 822 Bytes
/
hello-gl-dummy.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include <stdlib.h>
#define GLEW_STATIC
#include <GL/glew.h>
#include <stdio.h>
#include "sdl.h"
static int make_resources(void)
{
return 1;
}
/*
* GLUT callbacks:
*/
static void update_fade_factor(void)
{
}
static void render(void)
{
glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
SDL_GL_SwapBuffers();
}
extern int done;
/*
* Entry point
*/
int main(int argc, char** argv)
{
initSDL();
glewInit();
if (!glewIsSupported("GL_VERSION_2_0")) {
fprintf(stderr, "OpenGL 2.0 not available\n");
return 1;
}
if (!make_resources()) {
fprintf(stderr, "Failed to load resources\n");
return 1;
}
while (!done) {
handleInput();
update_fade_factor();
render();
}
SDL_Quit();
return 0;
}