better
This commit is contained in:
parent
9dd2e6acd6
commit
6b4602a984
5 changed files with 42 additions and 13 deletions
12
client/gl.c
12
client/gl.c
|
|
@ -9,8 +9,8 @@ double gl_cam_z;
|
|||
int gl_scene = AF_SCENE_MAIN;
|
||||
|
||||
gl_scene_t gl_scenes[] = {
|
||||
{gl_main_changed, gl_main_init, gl_main_draw}, /**/
|
||||
{gl_connecting_changed, gl_connecting_init, gl_connecting_draw} /**/
|
||||
{gl_main_changed, gl_main_init, gl_main_draw}, /**/
|
||||
{NULL, NULL, NULL} /**/
|
||||
};
|
||||
|
||||
void gl_resize(int width, int height) {
|
||||
|
|
@ -31,7 +31,7 @@ void gl_init(void) {
|
|||
void gl_render(void) {
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
gl_scenes[gl_scene].init();
|
||||
if(gl_scenes[gl_scene].init != NULL) gl_scenes[gl_scene].init();
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
|
|
@ -41,5 +41,9 @@ void gl_render(void) {
|
|||
glLoadIdentity();
|
||||
gluLookAt(gl_cam_x, gl_cam_y, gl_cam_z, gl_cam_x + cos(gl_cam_lr / 180.0 * M_PI), gl_cam_y + sin(gl_cam_ud / 180.0 * M_PI), gl_cam_z + sin(gl_cam_lr / 180.0 * M_PI), 0, 1, 0);
|
||||
|
||||
gl_scenes[gl_scene].draw();
|
||||
if(gl_scenes[gl_scene].draw != NULL) gl_scenes[gl_scene].draw();
|
||||
}
|
||||
|
||||
void gl_scene_change(void) {
|
||||
if(gl_scenes[gl_scene].changed != NULL) gl_scenes[gl_scene].changed();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue