Changeset 540 for libcaca/trunk/caca/driver_gl.c
- Timestamp:
- Mar 7, 2006, 10:17:35 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/caca/driver_gl.c
r539 r540 10 10 */ 11 11 12 /** \file graphics.c12 /** \file driver_gl.c 13 13 * \version \$Id$ 14 * \author Sam Hocevar <sam@zoy.org>15 * \brief Character drawing14 * \author Jean-Yves Lamoureux <jylam@lnxscene.org> 15 * \brief OpenGL driver 16 16 * 17 * This file contains character and string drawing functions.17 * This file contains the libcaca OpenGL input and output driver 18 18 */ 19 19 20 20 #include "config.h" 21 22 #if defined(HAVE_INTTYPES_H) || defined(_DOXYGEN_SKIP_ME)23 # include <inttypes.h>24 #else25 typedef unsigned int uint32_t;26 typedef unsigned char uint8_t;27 #endif28 21 29 22 #if defined(USE_GL) … … 83 76 static void gl_handle_mouse_motion(int, int); 84 77 85 int gl_init_graphics(caca_t *kk)78 static int gl_init_graphics(caca_t *kk) 86 79 { 87 80 char *empty_texture; … … 187 180 } 188 181 189 int gl_end_graphics(caca_t *kk)182 static int gl_end_graphics(caca_t *kk) 190 183 { 191 184 glutDestroyWindow(kk->gl.window); … … 193 186 } 194 187 195 int gl_set_window_title(caca_t *kk, char const *title)188 static int gl_set_window_title(caca_t *kk, char const *title) 196 189 { 197 190 glutSetWindowTitle(title); … … 199 192 } 200 193 201 unsigned int gl_get_window_width(caca_t *kk)194 static unsigned int gl_get_window_width(caca_t *kk) 202 195 { 203 196 return kk->gl.width; 204 197 } 205 198 206 unsigned int gl_get_window_height(caca_t *kk)199 static unsigned int gl_get_window_height(caca_t *kk) 207 200 { 208 201 return kk->gl.height; 209 202 } 210 203 211 void gl_display(caca_t *kk)204 static void gl_display(caca_t *kk) 212 205 { 213 206 unsigned int x, y, line; … … 282 275 } 283 276 284 void gl_handle_resize(caca_t *kk) 285 { 286 unsigned int new_width, new_height; 287 288 new_width = kk->qq->width; 289 new_height = kk->qq->height; 290 277 static void gl_handle_resize(caca_t *kk, unsigned int *new_width, 278 unsigned int *new_height) 279 { 291 280 kk->gl.width = kk->gl.new_width; 292 281 kk->gl.height = kk->gl.new_height; 293 282 294 new_width = kk->gl.width / kk->gl.font_width;295 new_height = (kk->gl.height / kk->gl.font_height) + 1;283 *new_width = kk->gl.width / kk->gl.font_width; 284 *new_height = (kk->gl.height / kk->gl.font_height) + 1; 296 285 297 286 glMatrixMode(GL_PROJECTION);
Note: See TracChangeset
for help on using the changeset viewer.