Ignore:
Timestamp:
Mar 7, 2006, 12:01:59 AM (14 years ago)
Author:
Sam Hocevar
Message:
  • Split caca/graphics.c into driver-specific files. Resize is currently broken, and event handling is not yet in the driver-specific files, but I will of course fix that later.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca/caca_internals.h

    r536 r539  
    2121#define __CACA_INTERNALS_H__
    2222
     23#if defined(USE_GL)
     24#   include <GL/glut.h>
     25#endif
     26#if defined(USE_NCURSES)
     27#   if defined(HAVE_NCURSES_H)
     28#       include <ncurses.h>
     29#   else
     30#       include <curses.h>
     31#   endif
     32#endif
     33#if defined(USE_WIN32)
     34#   include <windows.h>
     35#endif
    2336#if defined(USE_X11)
    24 #include <X11/Xlib.h>
     37#   include <X11/Xlib.h>
    2538#endif
    2639
     
    4962};
    5063
     64/* Available drivers */
     65#if defined(USE_CONIO)
     66void conio_init_driver(caca_t *);
     67#endif
     68#if defined(USE_GL)
     69void gl_init_driver(caca_t *);
     70#endif
     71#if defined(USE_NCURSES)
     72void ncurses_init_driver(caca_t *);
     73#endif
     74#if defined(USE_SLANG)
     75void slang_init_driver(caca_t *);
     76#endif
     77#if defined(USE_WIN32)
     78void win32_init_driver(caca_t *);
     79#endif
     80#if defined(USE_X11)
     81void x11_init_driver(caca_t *);
     82#endif
     83
    5184/* Timer structure */
    5285struct caca_timer
     
    6093    cucul_t *qq;
    6194
    62     enum caca_driver driver;
     95    struct driver
     96    {
     97        enum caca_driver driver;
     98
     99        int (* init_graphics) (caca_t *);
     100        int (* end_graphics) (caca_t *);
     101        int (* set_window_title) (caca_t *, char const *);
     102        unsigned int (* get_window_width) (caca_t *);
     103        unsigned int (* get_window_height) (caca_t *);
     104        void (* display) (caca_t *);
     105        void (* handle_resize) (caca_t *);
     106    } driver;
     107
    63108    unsigned int width, height;
    64109
     
    103148    {
    104149        int attr[16*16];
     150        mmask_t oldmask;
    105151    } ncurses;
    106152#endif
     
    157203extern int _caca_resize_event;
    158204
    159 #if defined(USE_WIN32)
    160 #include <windows.h>
    161 extern HANDLE win32_hin, win32_hout;
    162 #endif
    163 
    164 #if defined(USE_GL)
    165 #include <GL/glut.h>
    166 extern unsigned int gl_width, gl_height;
    167 #endif
    168 
    169 
    170205#endif /* __CACA_INTERNALS_H__ */
Note: See TracChangeset for help on using the changeset viewer.