1.1 --- a/src/video.h Sun Feb 05 04:05:27 2006 +0000
1.2 +++ b/src/video.h Mon Mar 13 12:39:07 2006 +0000
1.5 - * $Id: video.h,v 1.4 2006-02-05 04:05:27 nkeynes Exp $
1.6 + * $Id: video.h,v 1.5 2006-03-13 12:39:03 nkeynes Exp $
1.8 * The PC side of the video support (responsible for actually displaying /
1.14 -#define COLFMT_RGB15 0x00000000
1.15 -#define COLFMT_RGB16 0x00000004
1.16 -#define COLFMT_RGB24 0x00000008
1.17 -#define COLFMT_RGB32 0x0000000C
1.19 + * Supported colour formats. Note that ARGB4444 is only ever used for texture
1.20 + * rendering (it's not valid for display purposes).
1.22 +#define COLFMT_RGB565 1
1.23 +#define COLFMT_RGB888 4
1.24 +#define COLFMT_ARGB1555 0
1.25 +#define COLFMT_ARGB8888 5
1.26 +#define COLFMT_ARGB4444 2
1.27 +#define COLFMT_YUV422 3 /* 8-bit YUV (texture source only) */
1.28 +#define COLFMT_INDEX4 6 /* 4 bit indexed colour (texture source only) */
1.29 +#define COLFMT_INDEX8 7 /* 8-bit indexed colour (texture source only) */
1.31 typedef struct video_buffer {
1.38 + * Core video driver - expected to directly support an OpenGL context
1.40 typedef struct video_driver {
1.42 - gboolean (*set_output_format)( uint32_t hres, uint32_t vres,
1.45 + * Initialize the driver. This is called only once at startup time, and
1.46 + * is guaranteed to be called before any other methods.
1.47 + * @return TRUE if the driver was successfully initialized, otherwise
1.50 + gboolean (*init_driver)(void);
1.53 + * Cleanly shutdown the driver. Normally only called at system shutdown
1.56 + void (*shutdown_driver)(void);
1.59 + * Set the current display format to the specified values. This is
1.60 + * called immediately prior to any display frame call where the
1.61 + * parameters have changed from the previous frame
1.63 + gboolean (*set_display_format)( uint32_t hres, uint32_t vres,
1.67 + * Set the current rendering format to the specified values. This is
1.68 + * called immediately prior to starting rendering of a frame where the
1.69 + * parameters have changed from the previous frame. Note that the driver
1.70 + * is not required to precisely support the requested colour format.
1.72 + * This method is also responsible for setting up an appropriate GL
1.73 + * context for the main engine to render into.
1.75 + * @param hres The horizontal resolution (ie 640)
1.76 + * @param vres The vertical resolution (ie 480)
1.77 + * @param colour_fmt The colour format of the buffer (ie COLFMT_ARGB4444)
1.78 + * @param texture Flag indicating that the frame being rendered is a
1.79 + * texture, rather than a display frame.
1.81 + gboolean (*set_render_format)( uint32_t hres, uint32_t vres,
1.82 + int colour_fmt, gboolean texture );
1.84 + * Display a single frame using the supplied pixmap data. Is assumed to
1.85 + * invalidate the current GL front buffer (but not the back buffer).
1.87 gboolean (*display_frame)( video_buffer_t buffer );
1.90 + * Display a single blanked frame using a fixed colour for the
1.91 + * entire frame (specified in RGB888 format). Is assumed to invalidate
1.92 + * the current GL front buffer (but not the back buffer).
1.94 gboolean (*display_blank_frame)( uint32_t rgb );
1.97 + * Promote the current render back buffer to the front buffer
1.99 + void (*display_back_buffer)( void );
1.103 void video_open( void );
1.104 void video_update_frame( void );
1.105 void video_update_size( int, int, int );