Skip to content

Latest commit

 

History

History
138 lines (115 loc) · 4.8 KB

SDL_ph_video.h

File metadata and controls

138 lines (115 loc) · 4.8 KB
 
Apr 26, 2001
Apr 26, 2001
1
2
/*
SDL - Simple DirectMedia Layer
Jan 4, 2004
Jan 4, 2004
3
Copyright (C) 1997-2004 Sam Lantinga
Apr 26, 2001
Apr 26, 2001
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Sam Lantinga
Dec 14, 2001
Dec 14, 2001
20
slouken@libsdl.org
Apr 26, 2001
Apr 26, 2001
21
22
*/
Aug 4, 2003
Aug 4, 2003
23
24
#ifndef __SDL_PH_VIDEO_H__
#define __SDL_PH_VIDEO_H__
Apr 26, 2001
Apr 26, 2001
25
26
27
28
#include "SDL_mouse.h"
#include "SDL_sysvideo.h"
Aug 4, 2003
Aug 4, 2003
29
30
#include <Ph.h>
#include <Pt.h>
Apr 26, 2001
Apr 26, 2001
31
32
#include <photon/Pg.h>
#include <photon/PdDirect.h>
Aug 4, 2003
Aug 4, 2003
33
Mar 11, 2002
Mar 11, 2002
34
#ifdef HAVE_OPENGL
Aug 4, 2003
Aug 4, 2003
35
#include <photon/PdGL.h>
Mar 11, 2002
Mar 11, 2002
36
#endif /* HAVE_OPENGL */
Apr 26, 2001
Apr 26, 2001
37
38
/* Hidden "this" pointer for the video functions */
Aug 4, 2003
Aug 4, 2003
39
#define _THIS SDL_VideoDevice* this
Apr 26, 2001
Apr 26, 2001
40
Jan 18, 2002
Jan 18, 2002
41
42
#define PH_OGL_MAX_ATTRIBS 32
Mar 23, 2002
Mar 23, 2002
43
44
45
46
#define SDLPH_PAL_NONE 0x00000000L
#define SDLPH_PAL_EMULATE 0x00000001L
#define SDLPH_PAL_SYSTEM 0x00000002L
Aug 4, 2003
Aug 4, 2003
47
48
typedef struct
{
Aug 30, 2003
Aug 30, 2003
49
50
51
unsigned char* Y;
unsigned char* V;
unsigned char* U;
Jan 20, 2003
Jan 20, 2003
52
} FRAMEDATA;
Apr 26, 2001
Apr 26, 2001
53
Aug 4, 2003
Aug 4, 2003
54
55
56
57
58
59
60
61
62
63
/* Mask values for SDL_ReallocFormat() */
struct ColourMasks
{
Uint32 red;
Uint32 green;
Uint32 blue;
Uint32 alpha;
Uint32 bpp;
};
Apr 26, 2001
Apr 26, 2001
64
/* Private display data */
Dec 10, 2003
Dec 10, 2003
65
66
struct SDL_PrivateVideoData
{
Apr 26, 2001
Apr 26, 2001
67
PgDisplaySettings_t mode_settings;
Mar 23, 2002
Mar 23, 2002
68
69
PtWidget_t *Window; /* used to handle input events */
PhImage_t *image; /* used to display image */
Mar 11, 2002
Mar 11, 2002
70
#ifdef HAVE_OPENGL
Mar 23, 2002
Mar 23, 2002
71
PdOpenGLContext_t* OGLContext; /* OpenGL context */
Aug 30, 2003
Aug 30, 2003
72
73
Uint32 OGLFlags; /* OpenGL flags */
Uint32 OGLBPP; /* OpenGL bpp */
Mar 11, 2002
Mar 11, 2002
74
#endif /* HAVE_OPENGL */
Jan 20, 2003
Jan 20, 2003
75
76
PgColor_t savedpal[_Pg_MAX_PALETTE];
PgColor_t syspalph[_Pg_MAX_PALETTE];
Mar 11, 2002
Mar 11, 2002
77
Aug 23, 2003
Aug 23, 2003
78
79
struct
{
Jan 20, 2003
Jan 20, 2003
80
81
PdDirectContext_t* direct_context;
PdOffscreenContext_t* offscreen_context;
Aug 4, 2003
Aug 4, 2003
82
PdOffscreenContext_t* offscreen_backcontext;
Jan 20, 2003
Jan 20, 2003
83
PhDrawContext_t* oldDC;
Aug 4, 2003
Aug 4, 2003
84
uint8_t* dc_ptr;
Aug 23, 2003
Aug 23, 2003
85
86
87
unsigned char* CurrentFrameData;
unsigned char* FrameData0;
unsigned char* FrameData1;
Aug 30, 2003
Aug 30, 2003
88
89
Uint32 current;
Uint32 flags;
Mar 11, 2002
Mar 11, 2002
90
} ocimage;
Apr 26, 2001
Apr 26, 2001
91
Mar 23, 2002
Mar 23, 2002
92
PgHWCaps_t graphics_card_caps; /* Graphics card caps at the moment of start */
Aug 23, 2003
Aug 23, 2003
93
PgVideoModeInfo_t desktop_mode; /* Current desktop video mode information */
Mar 23, 2002
Mar 23, 2002
94
95
int old_video_mode; /* Stored mode before fullscreen switch */
int old_refresh_rate; /* Stored refresh rate befor fullscreen switch */
Apr 26, 2001
Apr 26, 2001
96
Mar 11, 2002
Mar 11, 2002
97
98
int mouse_relative;
WMcursor* BlankCursor;
Apr 26, 2001
Apr 26, 2001
99
Dec 10, 2003
Dec 10, 2003
100
101
102
Uint32 depth; /* current visual depth (not bpp) */
Uint32 desktopbpp; /* bpp of desktop at the moment of start */
Uint32 desktoppal; /* palette mode emulation or system */
Apr 26, 2001
Apr 26, 2001
103
104
int currently_fullscreen;
Dec 10, 2003
Dec 10, 2003
105
106
int currently_hided; /* 1 - window hided (minimazed), 0 - normal */
int currently_maximized; /* 1 - window hided (minimazed), 0 - normal */
Apr 26, 2001
Apr 26, 2001
107
Mar 11, 2002
Mar 11, 2002
108
PhEvent_t* event;
Aug 4, 2003
Aug 4, 2003
109
SDL_Overlay* overlay;
Apr 26, 2001
Apr 26, 2001
110
111
};
Mar 11, 2002
Mar 11, 2002
112
113
114
115
116
117
118
#define mode_settings (this->hidden->mode_settings)
#define window (this->hidden->Window)
#define SDL_Image (this->hidden->image)
#define OCImage (this->hidden->ocimage)
#define old_video_mode (this->hidden->old_video_mode)
#define old_refresh_rate (this->hidden->old_refresh_rate)
#define graphics_card_caps (this->hidden->graphics_card_caps)
Mar 23, 2002
Mar 23, 2002
119
120
#define desktopbpp (this->hidden->desktopbpp)
#define desktoppal (this->hidden->desktoppal)
Jan 20, 2003
Jan 20, 2003
121
122
#define savedpal (this->hidden->savedpal)
#define syspalph (this->hidden->syspalph)
Aug 4, 2003
Aug 4, 2003
123
124
#define currently_fullscreen (this->hidden->currently_fullscreen)
#define currently_hided (this->hidden->currently_hided)
Dec 10, 2003
Dec 10, 2003
125
#define currently_maximized (this->hidden->currently_maximized)
Aug 4, 2003
Aug 4, 2003
126
127
#define event (this->hidden->event)
#define current_overlay (this->hidden->overlay)
Aug 23, 2003
Aug 23, 2003
128
#define desktop_mode (this->hidden->desktop_mode)
Mar 11, 2002
Mar 11, 2002
129
130
#define mouse_relative (this->hidden->mouse_relative)
#define SDL_BlankCursor (this->hidden->BlankCursor)
Apr 26, 2001
Apr 26, 2001
131
Aug 30, 2003
Aug 30, 2003
132
133
134
135
136
137
#ifdef HAVE_OPENGL
#define oglctx (this->hidden->OGLContext)
#define oglflags (this->hidden->OGLFlags)
#define oglbpp (this->hidden->OGLBPP)
#endif /* HAVE_OPENGL */
Aug 4, 2003
Aug 4, 2003
138
#endif /* __SDL_PH_VIDEO_H__ */