Ignore:
Timestamp:
Mar 7, 2006, 10:17:35 AM (14 years ago)
Author:
Sam Hocevar
Message:
  • Polished the driver split a bit (still no events, except resize events), properly credited authors and documented a few things.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca/driver_gl.c

    r539 r540  
    1010 */
    1111
    12 /** \file graphics.c
     12/** \file driver_gl.c
    1313 *  \version \$Id$
    14  *  \author Sam Hocevar <sam@zoy.org>
    15  *  \brief Character drawing
     14 *  \author Jean-Yves Lamoureux <jylam@lnxscene.org>
     15 *  \brief OpenGL driver
    1616 *
    17  *  This file contains character and string drawing functions.
     17 *  This file contains the libcaca OpenGL input and output driver
    1818 */
    1919
    2020#include "config.h"
    21 
    22 #if defined(HAVE_INTTYPES_H) || defined(_DOXYGEN_SKIP_ME)
    23 #   include <inttypes.h>
    24 #else
    25 typedef unsigned int uint32_t;
    26 typedef unsigned char uint8_t;
    27 #endif
    2821
    2922#if defined(USE_GL)
     
    8376static void gl_handle_mouse_motion(int, int);
    8477
    85 int gl_init_graphics(caca_t *kk)
     78static int gl_init_graphics(caca_t *kk)
    8679{
    8780    char *empty_texture;
     
    187180}
    188181
    189 int gl_end_graphics(caca_t *kk)
     182static int gl_end_graphics(caca_t *kk)
    190183{
    191184    glutDestroyWindow(kk->gl.window);
     
    193186}
    194187
    195 int gl_set_window_title(caca_t *kk, char const *title)
     188static int gl_set_window_title(caca_t *kk, char const *title)
    196189{
    197190    glutSetWindowTitle(title);
     
    199192}
    200193
    201 unsigned int gl_get_window_width(caca_t *kk)
     194static unsigned int gl_get_window_width(caca_t *kk)
    202195{
    203196    return kk->gl.width;
    204197}
    205198
    206 unsigned int gl_get_window_height(caca_t *kk)
     199static unsigned int gl_get_window_height(caca_t *kk)
    207200{
    208201    return kk->gl.height;
    209202}
    210203
    211 void gl_display(caca_t *kk)
     204static void gl_display(caca_t *kk)
    212205{
    213206    unsigned int x, y, line;
     
    282275}
    283276
    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 
     277static void gl_handle_resize(caca_t *kk, unsigned int *new_width,
     278                                         unsigned int *new_height)
     279{
    291280    kk->gl.width = kk->gl.new_width;
    292281    kk->gl.height = kk->gl.new_height;
    293282
    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;
    296285
    297286    glMatrixMode(GL_PROJECTION);
Note: See TracChangeset for help on using the changeset viewer.