Search
lxdream.org :: lxdream :: r145:8f1af16b0665
lxdream 0.9.1
released Jun 29
Download Now
changeset145:8f1af16b0665
parent144:7f0714e89aaa
child146:f91fa34ab219
authornkeynes
dateSat May 20 02:38:08 2006 +0000 (14 years ago)
Remove old video.h (replaced by display.h)
src/video.h
1.1 --- a/src/video.h Mon May 15 08:28:52 2006 +0000
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,126 +0,0 @@
1.4 -/**
1.5 - * $Id: video.h,v 1.6 2006-03-14 12:45:50 nkeynes Exp $
1.6 - *
1.7 - * The PC side of the video support (responsible for actually displaying /
1.8 - * rendering frames)
1.9 - *
1.10 - * Copyright (c) 2005 Nathan Keynes.
1.11 - *
1.12 - * This program is free software; you can redistribute it and/or modify
1.13 - * it under the terms of the GNU General Public License as published by
1.14 - * the Free Software Foundation; either version 2 of the License, or
1.15 - * (at your option) any later version.
1.16 - *
1.17 - * This program is distributed in the hope that it will be useful,
1.18 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.19 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.20 - * GNU General Public License for more details.
1.21 - */
1.22 -
1.23 -#ifndef dream_video_H
1.24 -#define dream_video_H
1.25 -
1.26 -#include <stdint.h>
1.27 -#include <glib.h>
1.28 -
1.29 -#ifdef __cplusplus
1.30 -extern "C" {
1.31 -#endif
1.32 -
1.33 -/**
1.34 - * Supported colour formats. Note that ARGB4444 is only ever used for texture
1.35 - * rendering (it's not valid for display purposes).
1.36 - */
1.37 -#define COLFMT_RGB565 1
1.38 -#define COLFMT_RGB888 4
1.39 -#define COLFMT_ARGB1555 0
1.40 -#define COLFMT_ARGB8888 5
1.41 -#define COLFMT_ARGB4444 2
1.42 -#define COLFMT_YUV422 3 /* 8-bit YUV (texture source only) */
1.43 -#define COLFMT_INDEX4 6 /* 4 bit indexed colour (texture source only) */
1.44 -#define COLFMT_INDEX8 7 /* 8-bit indexed colour (texture source only) */
1.45 -
1.46 -typedef struct video_buffer {
1.47 - uint32_t hres;
1.48 - uint32_t vres;
1.49 - uint32_t rowstride;
1.50 - int colour_format;
1.51 - char *data;
1.52 -} *video_buffer_t;
1.53 -
1.54 -/**
1.55 - * Core video driver - expected to directly support an OpenGL context
1.56 - */
1.57 -typedef struct video_driver {
1.58 - char *name;
1.59 - /**
1.60 - * Initialize the driver. This is called only once at startup time, and
1.61 - * is guaranteed to be called before any other methods.
1.62 - * @return TRUE if the driver was successfully initialized, otherwise
1.63 - * FALSE.
1.64 - */
1.65 - gboolean (*init_driver)(void);
1.66 -
1.67 - /**
1.68 - * Cleanly shutdown the driver. Normally only called at system shutdown
1.69 - * time.
1.70 - */
1.71 - void (*shutdown_driver)(void);
1.72 -
1.73 - /**
1.74 - * Set the current display format to the specified values. This is
1.75 - * called immediately prior to any display frame call where the
1.76 - * parameters have changed from the previous frame
1.77 - */
1.78 - gboolean (*set_display_format)( uint32_t hres, uint32_t vres,
1.79 - int colour_fmt );
1.80 -
1.81 - /**
1.82 - * Set the current rendering format to the specified values. This is
1.83 - * called immediately prior to starting rendering of a frame where the
1.84 - * parameters have changed from the previous frame. Note that the driver
1.85 - * is not required to precisely support the requested colour format.
1.86 - *
1.87 - * This method is also responsible for setting up an appropriate GL
1.88 - * context for the main engine to render into.
1.89 - *
1.90 - * @param hres The horizontal resolution (ie 640)
1.91 - * @param vres The vertical resolution (ie 480)
1.92 - * @param colour_fmt The colour format of the buffer (ie COLFMT_ARGB4444)
1.93 - * @param texture Flag indicating that the frame being rendered is a
1.94 - * texture, rather than a display frame.
1.95 - */
1.96 - gboolean (*set_render_format)( uint32_t hres, uint32_t vres,
1.97 - int colour_fmt, gboolean texture );
1.98 - /**
1.99 - * Display a single frame using the supplied pixmap data. Is assumed to
1.100 - * invalidate the current GL front buffer (but not the back buffer).
1.101 - */
1.102 - gboolean (*display_frame)( video_buffer_t buffer );
1.103 -
1.104 - /**
1.105 - * Display a single blanked frame using a fixed colour for the
1.106 - * entire frame (specified in RGB888 format). Is assumed to invalidate
1.107 - * the current GL front buffer (but not the back buffer).
1.108 - */
1.109 - gboolean (*display_blank_frame)( uint32_t rgb );
1.110 -
1.111 - /**
1.112 - * Promote the current render back buffer to the front buffer
1.113 - */
1.114 - void (*display_back_buffer)( void );
1.115 -} *video_driver_t;
1.116 -
1.117 -void video_open( void );
1.118 -void video_update_frame( void );
1.119 -void video_update_size( int, int, int );
1.120 -
1.121 -extern uint32_t pvr2_frame_counter;
1.122 -
1.123 -extern struct video_driver video_gtk_driver;
1.124 -extern struct video_driver video_null_driver;
1.125 -
1.126 -#ifdef __cplusplus
1.127 -}
1.128 -#endif
1.129 -#endif
.