Skip to content

Latest commit

 

History

History
135 lines (112 loc) · 4.67 KB

SDL_ph_video.h

File metadata and controls

135 lines (112 loc) · 4.67 KB
 
Apr 26, 2001
Apr 26, 2001
1
2
/*
SDL - Simple DirectMedia Layer
Mar 6, 2002
Mar 6, 2002
3
Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 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
65
66
/* Private display data */
struct SDL_PrivateVideoData {
PgDisplaySettings_t mode_settings;
Mar 23, 2002
Mar 23, 2002
67
68
PtWidget_t *Window; /* used to handle input events */
PhImage_t *image; /* used to display image */
Mar 11, 2002
Mar 11, 2002
69
#ifdef HAVE_OPENGL
Mar 23, 2002
Mar 23, 2002
70
PdOpenGLContext_t* OGLContext; /* OpenGL context */
Aug 30, 2003
Aug 30, 2003
71
72
Uint32 OGLFlags; /* OpenGL flags */
Uint32 OGLBPP; /* OpenGL bpp */
Mar 11, 2002
Mar 11, 2002
73
#endif /* HAVE_OPENGL */
Jan 20, 2003
Jan 20, 2003
74
75
PgColor_t savedpal[_Pg_MAX_PALETTE];
PgColor_t syspalph[_Pg_MAX_PALETTE];
Mar 11, 2002
Mar 11, 2002
76
Aug 23, 2003
Aug 23, 2003
77
78
struct
{
Jan 20, 2003
Jan 20, 2003
79
80
PdDirectContext_t* direct_context;
PdOffscreenContext_t* offscreen_context;
Aug 4, 2003
Aug 4, 2003
81
PdOffscreenContext_t* offscreen_backcontext;
Jan 20, 2003
Jan 20, 2003
82
PhDrawContext_t* oldDC;
Aug 4, 2003
Aug 4, 2003
83
uint8_t* dc_ptr;
Aug 23, 2003
Aug 23, 2003
84
85
86
unsigned char* CurrentFrameData;
unsigned char* FrameData0;
unsigned char* FrameData1;
Aug 30, 2003
Aug 30, 2003
87
88
Uint32 current;
Uint32 flags;
Mar 11, 2002
Mar 11, 2002
89
} ocimage;
Apr 26, 2001
Apr 26, 2001
90
Mar 23, 2002
Mar 23, 2002
91
PgHWCaps_t graphics_card_caps; /* Graphics card caps at the moment of start */
Aug 23, 2003
Aug 23, 2003
92
PgVideoModeInfo_t desktop_mode; /* Current desktop video mode information */
Mar 23, 2002
Mar 23, 2002
93
94
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
95
Mar 11, 2002
Mar 11, 2002
96
97
int mouse_relative;
WMcursor* BlankCursor;
Apr 26, 2001
Apr 26, 2001
98
Aug 30, 2003
Aug 30, 2003
99
100
101
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
102
103
int currently_fullscreen;
Aug 4, 2003
Aug 4, 2003
104
int currently_hided; /* 1 - window hided (minimazed), 0 - normal */
Apr 26, 2001
Apr 26, 2001
105
Mar 11, 2002
Mar 11, 2002
106
PhEvent_t* event;
Aug 4, 2003
Aug 4, 2003
107
SDL_Overlay* overlay;
Apr 26, 2001
Apr 26, 2001
108
109
};
Mar 11, 2002
Mar 11, 2002
110
111
112
113
114
115
116
#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
117
118
#define desktopbpp (this->hidden->desktopbpp)
#define desktoppal (this->hidden->desktoppal)
Jan 20, 2003
Jan 20, 2003
119
120
#define savedpal (this->hidden->savedpal)
#define syspalph (this->hidden->syspalph)
Aug 4, 2003
Aug 4, 2003
121
122
123
124
#define currently_fullscreen (this->hidden->currently_fullscreen)
#define currently_hided (this->hidden->currently_hided)
#define event (this->hidden->event)
#define current_overlay (this->hidden->overlay)
Aug 23, 2003
Aug 23, 2003
125
#define desktop_mode (this->hidden->desktop_mode)
Mar 11, 2002
Mar 11, 2002
126
127
#define mouse_relative (this->hidden->mouse_relative)
#define SDL_BlankCursor (this->hidden->BlankCursor)
Apr 26, 2001
Apr 26, 2001
128
Aug 30, 2003
Aug 30, 2003
129
130
131
132
133
134
#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
135
#endif /* __SDL_PH_VIDEO_H__ */