src/video/dga/SDL_dgavideo.h
changeset 0 74212992fb08
child 101 825b2fa28e2e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/video/dga/SDL_dgavideo.h	Thu Apr 26 16:45:43 2001 +0000
     1.3 @@ -0,0 +1,106 @@
     1.4 +/*
     1.5 +    SDL - Simple DirectMedia Layer
     1.6 +    Copyright (C) 1997, 1998, 1999, 2000, 2001  Sam Lantinga
     1.7 +
     1.8 +    This library is free software; you can redistribute it and/or
     1.9 +    modify it under the terms of the GNU Library General Public
    1.10 +    License as published by the Free Software Foundation; either
    1.11 +    version 2 of the License, or (at your option) any later version.
    1.12 +
    1.13 +    This library is distributed in the hope that it will be useful,
    1.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.16 +    Library General Public License for more details.
    1.17 +
    1.18 +    You should have received a copy of the GNU Library General Public
    1.19 +    License along with this library; if not, write to the Free
    1.20 +    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    1.21 +
    1.22 +    Sam Lantinga
    1.23 +    slouken@devolution.com
    1.24 +*/
    1.25 +
    1.26 +#ifdef SAVE_RCSID
    1.27 +static char rcsid =
    1.28 + "@(#) $Id$";
    1.29 +#endif
    1.30 +
    1.31 +#ifndef _SDL_dgavideo_h
    1.32 +#define _SDL_dgavideo_h
    1.33 +
    1.34 +#include <X11/Xlib.h>
    1.35 +
    1.36 +#include "SDL_mouse.h"
    1.37 +#include "SDL_mutex.h"
    1.38 +#include "SDL_sysvideo.h"
    1.39 +
    1.40 +/* Hidden "this" pointer for the video functions */
    1.41 +#define _THIS	SDL_VideoDevice *this
    1.42 +
    1.43 +
    1.44 +/* This is the structure we use to keep track of video memory */
    1.45 +typedef struct vidmem_bucket {
    1.46 +	struct vidmem_bucket *prev;
    1.47 +	unsigned int used;
    1.48 +	Uint8 *base;
    1.49 +	unsigned int size;
    1.50 +	struct vidmem_bucket *next;
    1.51 +} vidmem_bucket;
    1.52 +
    1.53 +/* Information about the location of the surface in hardware memory */
    1.54 +struct private_hwdata {
    1.55 +	int x;
    1.56 +	int y;
    1.57 +};
    1.58 +
    1.59 +/* Private display data */
    1.60 +struct SDL_PrivateVideoData {
    1.61 +	Display *DGA_Display;
    1.62 +	Colormap DGA_colormap;
    1.63 +	int visualClass;
    1.64 +
    1.65 +#define NUM_MODELISTS	4		/* 8, 16, 24, and 32 bits-per-pixel */
    1.66 +	int SDL_nummodes[NUM_MODELISTS];
    1.67 +	SDL_Rect **SDL_modelist[NUM_MODELISTS];
    1.68 +
    1.69 +	/* Information for the video surface */
    1.70 +	Uint8 *memory_base;
    1.71 +	int memory_pitch;
    1.72 +	SDL_mutex *hw_lock;
    1.73 +	int sync_needed;
    1.74 +	int was_flipped;
    1.75 +
    1.76 +	/* Information for hardware surfaces */
    1.77 +	vidmem_bucket surfaces;
    1.78 +	int surfaces_memtotal;
    1.79 +	int surfaces_memleft;
    1.80 +
    1.81 +	/* Information for double-buffering */
    1.82 +	int flip_page;
    1.83 +	int flip_yoffset[2];
    1.84 +	Uint8 *flip_address[2];
    1.85 +
    1.86 +	/* Used to handle DGA events */
    1.87 +	int event_base;
    1.88 +};
    1.89 +/* Old variable names */
    1.90 +#define DGA_Display		(this->hidden->DGA_Display)
    1.91 +#define DGA_Screen		DefaultScreen(DGA_Display)
    1.92 +#define DGA_colormap		(this->hidden->DGA_colormap)
    1.93 +#define DGA_visualClass		(this->hidden->visualClass)
    1.94 +#define memory_base		(this->hidden->memory_base)
    1.95 +#define memory_pitch		(this->hidden->memory_pitch)
    1.96 +#define flip_page		(this->hidden->flip_page)
    1.97 +#define flip_yoffset		(this->hidden->flip_yoffset)
    1.98 +#define flip_address		(this->hidden->flip_address)
    1.99 +#define sync_needed		(this->hidden->sync_needed)
   1.100 +#define was_flipped		(this->hidden->was_flipped)
   1.101 +#define SDL_nummodes		(this->hidden->SDL_nummodes)
   1.102 +#define SDL_modelist		(this->hidden->SDL_modelist)
   1.103 +#define surfaces		(this->hidden->surfaces)
   1.104 +#define surfaces_memtotal	(this->hidden->surfaces_memtotal)
   1.105 +#define surfaces_memleft	(this->hidden->surfaces_memleft)
   1.106 +#define hw_lock			(this->hidden->hw_lock)
   1.107 +#define DGA_event_base		(this->hidden->event_base)
   1.108 +
   1.109 +#endif /* _SDL_dgavideo_h */