1 /************************************************************************
3 * voxelands - 3d voxel world sandbox game
4 * Copyright (C) Lisa 'darkrose' Milne 2016 <lisa@ltmnet.com>
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 * See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>
18 ************************************************************************/
42 if (!render_data
.ticks
)
43 render_data
.ticks
= time_ticks();
44 render_data
.tpf
= 1000/wm_data
.frame_cap
;
50 /* TODO: uncomment this
53 /* TODO: uncomment this
54 if (wm_data.cursor.mat)
55 render2d_quad_mat(wm_data.cursor.mat,mouse[CUR_X]+wm_data.cursor.x,mouse[CUR_Y]+wm_data.cursor.y,wm_data.cursor.w,wm_data.cursor.h);*/
57 /* should get this from sky when in-game */
58 glClearColor(0, 0, 0, 1.0);
59 /* smooth blending so the hud layer doesn't hide the game layer */
61 glEnable(GL_LINE_SMOOTH
);
62 glBlendFunc(GL_SRC_ALPHA
, GL_ONE_MINUS_SRC_ALPHA
);
63 glClear(GL_COLOR_BUFFER_BIT
| GL_DEPTH_BUFFER_BIT
);
65 glDisable(GL_DEPTH_TEST
);
71 /* calculate a scale factor for smooth animations */
72 render_data
.tticks
= interval_delay(render_data
.ticks
,wm_data
.frame_cap
);
73 wm_data
.fps
= calc_fps(render_data
.ticks
,render_data
.tticks
);
74 render_data
.dtime
= time_dtime(render_data
.ticks
);
75 render_data
.ticks
= render_data
.tticks
;