File: d3dsdl.h

package info (click to toggle)
btanks 0.9.8083-9
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid, trixie
  • size: 43,616 kB
  • sloc: cpp: 46,425; ansic: 12,005; xml: 4,262; python: 313; sh: 13; makefile: 13
file content (97 lines) | stat: -rw-r--r-- 3,046 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#ifndef	_D3DSDL_H_
#define	_D3DSDL_H_

/* 
	D3D SDL - direct 3d wrapper for SDL 
*/

#include <SDL.h>
#include <begin_code.h>


//fake d3dSDL backend
#define SDL_GLSDL	0x00100000

#ifdef __cplusplus
extern "C" {
#endif
	SDL_Surface *d3dSDL_DisplayFormat(SDL_Surface *surface);
	SDL_Surface *d3dSDL_DisplayFormatAlpha(SDL_Surface *surface);

	SDL_Surface *d3dSDL_ConvertSurface
				(SDL_Surface *src, SDL_PixelFormat *fmt, Uint32 flags);
	SDL_Surface *d3dSDL_CreateRGBSurface
				(Uint32 flags, int width, int height, int depth, 
				Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
	SDL_Surface *d3dSDL_CreateRGBSurfaceFrom(void *pixels,
				int width, int height, int depth, int pitch,
				Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);

	SDL_Surface *d3dSDL_LoadBMP(const char *file);
	int d3dSDL_SaveBMP(SDL_Surface *surface, const char *file);
	int d3dSDL_Flip(SDL_Surface *screen);

	void d3dSDL_FreeSurface(SDL_Surface *surface);

	int d3dSDL_LockSurface(SDL_Surface *surface);
	void d3dSDL_UnlockSurface(SDL_Surface *surface);

	SDL_bool d3dSDL_SetClipRect(SDL_Surface *surface, SDL_Rect *rect);

	int d3dSDL_BlitSurface(SDL_Surface *src, SDL_Rect *srcrect,
				 SDL_Surface *dst, SDL_Rect *dstrect);

	int d3dSDL_FillRect(SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color);

   	void d3dSDL_UpdateRects(SDL_Surface *screen, int numrects, SDL_Rect *rects);
	void d3dSDL_UpdateRect(SDL_Surface *screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h);

	int d3dSDL_SetColorKey(SDL_Surface *surface, Uint32 flag, Uint32 key);
	int d3dSDL_SetAlpha(SDL_Surface *surface, Uint32 flag, Uint8 alpha);
 
	
	SDL_Surface *d3dSDL_SetVideoMode(int width, int height, int bpp, Uint32 flags);
	SDL_Surface *d3dSDL_GetVideoSurface(void);

	void d3dSDL_QuitSubSystem(Uint32 flags);
	void d3dSDL_Quit();
	/*SDL hooks*/	
#ifdef __cplusplus
}
#endif

#include <close_code.h>

#ifndef D3DSDL_NO_REDEFINES

#define	SDL_SetVideoMode		d3dSDL_SetVideoMode
#define	SDL_GetVideoSurface		d3dSDL_GetVideoSurface
#define	SDL_Quit			d3dSDL_Quit
#define	SDL_QuitSubSystem		d3dSDL_QuitSubSystem
#define	SDL_UpdateRects			d3dSDL_UpdateRects
#define	SDL_UpdateRect			d3dSDL_UpdateRect
#define	SDL_Flip			d3dSDL_Flip
#define	SDL_FreeSurface			d3dSDL_FreeSurface
#define	SDL_LockSurface			d3dSDL_LockSurface
#define	SDL_UnlockSurface		d3dSDL_UnlockSurface
#define	SDL_SetColorKey			d3dSDL_SetColorKey
#define	SDL_SetAlpha			d3dSDL_SetAlpha
#define	SDL_SetClipRect			d3dSDL_SetClipRect
#undef	SDL_BlitSurface
#define	SDL_BlitSurface			d3dSDL_BlitSurface
#define	SDL_FillRect			d3dSDL_FillRect
#define	SDL_DisplayFormat		d3dSDL_DisplayFormat
#define	SDL_DisplayFormatAlpha		d3dSDL_DisplayFormatAlpha
#define	SDL_ConvertSurface		d3dSDL_ConvertSurface
#define	SDL_CreateRGBSurface		d3dSDL_CreateRGBSurface
#define	SDL_CreateRGBSurfaceFrom	d3dSDL_CreateRGBSurfaceFrom
#undef	SDL_AllocSurface
#define SDL_AllocSurface		d3dSDL_CreateRGBSurface
#undef	SDL_LoadBMP
#define	SDL_LoadBMP			d3dSDL_LoadBMP
#undef	SDL_SaveBMP
#define	SDL_SaveBMP			d3dSDL_SaveBMP

#endif

#endif