2 SDL - Simple DirectMedia Layer
3 Copyright (C) 1997-2009 Sam Lantinga
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public
16 License along with this library; if not, write to the Free
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include "SDL_config.h"
24 #ifndef __SDL_PH_VIDEO_H__
25 #define __SDL_PH_VIDEO_H__
27 #include "SDL_mouse.h"
28 #include "../SDL_sysvideo.h"
30 #include <sys/neutrino.h>
34 #include <photon/Pg.h>
35 #include <photon/PdDirect.h>
38 #if (_NTO_VERSION < 630)
39 #include <photon/PdGL.h>
44 #endif /* SDL_VIDEO_OPENGL */
46 /* Hidden "this" pointer for the video functions */
47 #define _THIS SDL_VideoDevice* this
49 #define PH_OGL_MAX_ATTRIBS 32
51 #define SDLPH_PAL_NONE 0x00000000L
52 #define SDLPH_PAL_EMULATE 0x00000001L
53 #define SDLPH_PAL_SYSTEM 0x00000002L
62 /* Mask values for SDL_ReallocFormat() */
72 /* Private display data */
73 struct SDL_PrivateVideoData
75 PgDisplaySettings_t mode_settings;
76 PtWidget_t *Window; /* used to handle input events */
77 PhImage_t *image; /* used to display image */
79 #if (_NTO_VERSION < 630)
80 PdOpenGLContext_t* OGLContext; /* OpenGL context */
81 void* OGLBuffers; /* OpenGL buffers (unused) */
83 qnxglc_t* OGLContext; /* OpenGL context for the 6.3 */
84 qnxgl_bufs_t* OGLBuffers; /* OpenGL buffers for the 6.3 */
87 Uint32 OGLFlags; /* OpenGL flags */
88 Uint32 OGLBPP; /* OpenGL bpp */
89 #endif /* SDL_VIDEO_OPENGL */
90 PgColor_t savedpal[_Pg_MAX_PALETTE];
91 PgColor_t syspalph[_Pg_MAX_PALETTE];
95 PdDirectContext_t* direct_context;
96 PdOffscreenContext_t* offscreen_context;
97 PdOffscreenContext_t* offscreen_backcontext;
98 PhDrawContext_t* oldDC;
100 unsigned char* CurrentFrameData;
101 unsigned char* FrameData0;
102 unsigned char* FrameData1;
107 PgHWCaps_t graphics_card_caps; /* Graphics card caps at the moment of start */
108 PgVideoModeInfo_t desktop_mode; /* Current desktop video mode information */
109 int old_video_mode; /* Stored mode before fullscreen switch */
110 int old_refresh_rate; /* Stored refresh rate befor fullscreen switch */
113 WMcursor* BlankCursor;
114 uint32_t videomode_emulatemode;
116 Uint32 visualbpp; /* current visual bpp */
117 Uint32 desktopbpp; /* bpp of desktop at the moment of start */
118 Uint32 desktoppal; /* palette mode emulation or system */
120 int currently_fullscreen;
121 int currently_hided; /* 1 - window hided (minimazed), 0 - normal */
122 int currently_maximized; /* 1 - window hided (minimazed), 0 - normal */
125 SDL_Overlay* overlay;
128 #define mode_settings (this->hidden->mode_settings)
129 #define window (this->hidden->Window)
130 #define SDL_Image (this->hidden->image)
131 #define OCImage (this->hidden->ocimage)
132 #define old_video_mode (this->hidden->old_video_mode)
133 #define old_refresh_rate (this->hidden->old_refresh_rate)
134 #define graphics_card_caps (this->hidden->graphics_card_caps)
135 #define desktopbpp (this->hidden->desktopbpp)
136 #define visualbpp (this->hidden->visualbpp)
137 #define desktoppal (this->hidden->desktoppal)
138 #define savedpal (this->hidden->savedpal)
139 #define syspalph (this->hidden->syspalph)
140 #define currently_fullscreen (this->hidden->currently_fullscreen)
141 #define currently_hided (this->hidden->currently_hided)
142 #define currently_maximized (this->hidden->currently_maximized)
143 #define phevent (this->hidden->event)
144 #define current_overlay (this->hidden->overlay)
145 #define desktop_mode (this->hidden->desktop_mode)
146 #define mouse_relative (this->hidden->mouse_relative)
147 #define SDL_BlankCursor (this->hidden->BlankCursor)
148 #define videomode_emulatemode (this->hidden->videomode_emulatemode)
151 #define oglctx (this->hidden->OGLContext)
152 #define oglbuffers (this->hidden->OGLBuffers)
153 #define oglflags (this->hidden->OGLFlags)
154 #define oglbpp (this->hidden->OGLBPP)
155 #endif /* SDL_VIDEO_OPENGL */
157 #endif /* __SDL_PH_VIDEO_H__ */