00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00029 #ifndef _SDL_video_h
00030 #define _SDL_video_h
00031
00032 #include "SDL_stdinc.h"
00033 #include "SDL_pixels.h"
00034 #include "SDL_rect.h"
00035 #include "SDL_surface.h"
00036
00037 #include "begin_code.h"
00038
00039 #ifdef __cplusplus
00040
00041 extern "C" {
00042
00043 #endif
00044
00057 typedef struct
00058 {
00059 Uint32 format;
00060 int w;
00061 int h;
00062 int refresh_rate;
00063 void *driverdata;
00064 } SDL_DisplayMode;
00065
00094 typedef Uint32 SDL_WindowID;
00095
00103 typedef enum
00104 {
00105 SDL_WINDOW_FULLSCREEN = 0x00000001,
00106 SDL_WINDOW_OPENGL = 0x00000002,
00107 SDL_WINDOW_SHOWN = 0x00000004,
00108 SDL_WINDOW_BORDERLESS = 0x00000008,
00109 SDL_WINDOW_RESIZABLE = 0x00000010,
00110 SDL_WINDOW_MINIMIZED = 0x00000020,
00111 SDL_WINDOW_MAXIMIZED = 0x00000040,
00112 SDL_WINDOW_INPUT_GRABBED = 0x00000100,
00113 SDL_WINDOW_INPUT_FOCUS = 0x00000200,
00114 SDL_WINDOW_MOUSE_FOCUS = 0x00000400,
00115 SDL_WINDOW_FOREIGN = 0x00000800
00116 } SDL_WindowFlags;
00117
00122 #define SDL_WINDOWPOS_UNDEFINED 0x7FFFFFF
00123
00127 #define SDL_WINDOWPOS_CENTERED 0x7FFFFFE
00128
00134 typedef enum
00135 {
00136 SDL_WINDOWEVENT_NONE,
00137 SDL_WINDOWEVENT_SHOWN,
00138 SDL_WINDOWEVENT_HIDDEN,
00139 SDL_WINDOWEVENT_EXPOSED,
00140 SDL_WINDOWEVENT_MOVED,
00141 SDL_WINDOWEVENT_RESIZED,
00142 SDL_WINDOWEVENT_MINIMIZED,
00143 SDL_WINDOWEVENT_MAXIMIZED,
00144 SDL_WINDOWEVENT_RESTORED,
00145 SDL_WINDOWEVENT_ENTER,
00146 SDL_WINDOWEVENT_LEAVE,
00147 SDL_WINDOWEVENT_FOCUS_GAINED,
00148 SDL_WINDOWEVENT_FOCUS_LOST,
00149 SDL_WINDOWEVENT_CLOSE
00150 } SDL_WindowEventID;
00151
00157 typedef enum
00158 {
00159 SDL_RENDERER_SINGLEBUFFER = 0x00000001,
00160 SDL_RENDERER_PRESENTCOPY = 0x00000002,
00161 SDL_RENDERER_PRESENTFLIP2 = 0x00000004,
00162 SDL_RENDERER_PRESENTFLIP3 = 0x00000008,
00163 SDL_RENDERER_PRESENTDISCARD = 0x00000010,
00164 SDL_RENDERER_PRESENTVSYNC = 0x00000020,
00165 SDL_RENDERER_ACCELERATED = 0x00000040
00166 } SDL_RendererFlags;
00167
00173 typedef struct SDL_RendererInfo
00174 {
00175 const char *name;
00176 Uint32 flags;
00177 Uint32 mod_modes;
00178 Uint32 blend_modes;
00179 Uint32 scale_modes;
00180 Uint32 num_texture_formats;
00181 Uint32 texture_formats[20];
00182 int max_texture_width;
00183 int max_texture_height;
00184 } SDL_RendererInfo;
00185
00191 typedef enum
00192 {
00193 SDL_TEXTUREACCESS_STATIC,
00194 SDL_TEXTUREACCESS_STREAMING
00195 } SDL_TextureAccess;
00196
00202 typedef enum
00203 {
00204 SDL_TEXTUREMODULATE_NONE = 0x00000000,
00205 SDL_TEXTUREMODULATE_COLOR = 0x00000001,
00206 SDL_TEXTUREMODULATE_ALPHA = 0x00000002
00207 } SDL_TextureModulate;
00208
00214 typedef enum
00215 {
00216 SDL_BLENDMODE_NONE = 0x00000000,
00217 SDL_BLENDMODE_MASK = 0x00000001,
00218 SDL_BLENDMODE_BLEND = 0x00000002,
00219 SDL_BLENDMODE_ADD = 0x00000004,
00220 SDL_BLENDMODE_MOD = 0x00000008
00221 } SDL_BlendMode;
00222
00228 typedef enum
00229 {
00230 SDL_TEXTURESCALEMODE_NONE = 0x00000000,
00231 SDL_TEXTURESCALEMODE_FAST = 0x00000001,
00232 SDL_TEXTURESCALEMODE_SLOW = 0x00000002,
00233 SDL_TEXTURESCALEMODE_BEST = 0x00000004
00234 } SDL_TextureScaleMode;
00235
00241 typedef Uint32 SDL_TextureID;
00242
00248 typedef void *SDL_GLContext;
00249
00255 typedef enum
00256 {
00257 SDL_GL_RED_SIZE,
00258 SDL_GL_GREEN_SIZE,
00259 SDL_GL_BLUE_SIZE,
00260 SDL_GL_ALPHA_SIZE,
00261 SDL_GL_BUFFER_SIZE,
00262 SDL_GL_DOUBLEBUFFER,
00263 SDL_GL_DEPTH_SIZE,
00264 SDL_GL_STENCIL_SIZE,
00265 SDL_GL_ACCUM_RED_SIZE,
00266 SDL_GL_ACCUM_GREEN_SIZE,
00267 SDL_GL_ACCUM_BLUE_SIZE,
00268 SDL_GL_ACCUM_ALPHA_SIZE,
00269 SDL_GL_STEREO,
00270 SDL_GL_MULTISAMPLEBUFFERS,
00271 SDL_GL_MULTISAMPLESAMPLES,
00272 SDL_GL_ACCELERATED_VISUAL,
00273 SDL_GL_RETAINED_BACKING,
00274 SDL_GL_CONTEXT_MAJOR_VERSION,
00275 SDL_GL_CONTEXT_MINOR_VERSION
00276 } SDL_GLattr;
00277
00278
00279
00280
00288 extern DECLSPEC int SDLCALL SDL_GetNumVideoDrivers(void);
00289
00300 extern DECLSPEC const char *SDLCALL SDL_GetVideoDriver(int index);
00301
00318 extern DECLSPEC int SDLCALL SDL_VideoInit(const char *driver_name,
00319 Uint32 flags);
00320
00330 extern DECLSPEC void SDLCALL SDL_VideoQuit(void);
00331
00343 extern DECLSPEC const char *SDLCALL SDL_GetCurrentVideoDriver(void);
00344
00352 extern DECLSPEC int SDLCALL SDL_GetNumVideoDisplays(void);
00353
00364 extern DECLSPEC int SDLCALL SDL_SelectVideoDisplay(int index);
00365
00376 extern DECLSPEC int SDLCALL SDL_GetCurrentVideoDisplay(void);
00377
00385 extern DECLSPEC int SDLCALL SDL_GetNumDisplayModes(void);
00386
00400 extern DECLSPEC int SDLCALL SDL_GetDisplayMode(int index,
00401 SDL_DisplayMode * mode);
00402
00408 extern DECLSPEC int SDLCALL SDL_GetDesktopDisplayMode(SDL_DisplayMode * mode);
00409
00415 extern DECLSPEC int SDLCALL SDL_GetCurrentDisplayMode(SDL_DisplayMode * mode);
00416
00432 extern DECLSPEC SDL_DisplayMode *SDLCALL SDL_GetClosestDisplayMode(const
00433 SDL_DisplayMode
00434 * mode,
00435 SDL_DisplayMode
00436 * closest);
00437
00450 extern DECLSPEC int SDLCALL SDL_SetFullscreenDisplayMode(const SDL_DisplayMode
00451 * mode);
00452
00459 extern DECLSPEC int SDLCALL SDL_GetFullscreenDisplayMode(SDL_DisplayMode *
00460 mode);
00461
00469 extern DECLSPEC int SDLCALL SDL_SetDisplayPalette(const SDL_Color * colors,
00470 int firstcolor,
00471 int ncolors);
00472
00480 extern DECLSPEC int SDLCALL SDL_GetDisplayPalette(SDL_Color * colors,
00481 int firstcolor,
00482 int ncolors);
00483
00493 extern DECLSPEC int SDLCALL SDL_SetGamma(float red, float green, float blue);
00494
00514 extern DECLSPEC int SDLCALL SDL_SetGammaRamp(const Uint16 * red,
00515 const Uint16 * green,
00516 const Uint16 * blue);
00517
00531 extern DECLSPEC int SDLCALL SDL_GetGammaRamp(Uint16 * red, Uint16 * green,
00532 Uint16 * blue);
00533
00534
00551 extern DECLSPEC SDL_WindowID SDLCALL SDL_CreateWindow(const char *title,
00552 int x, int y, int w,
00553 int h, Uint32 flags);
00554
00568 extern DECLSPEC SDL_WindowID SDLCALL SDL_CreateWindowFrom(const void *data);
00569
00575 extern DECLSPEC Uint32 SDLCALL SDL_GetWindowFlags(SDL_WindowID windowID);
00576
00584 extern DECLSPEC void SDLCALL SDL_SetWindowTitle(SDL_WindowID windowID,
00585 const char *title);
00586
00594 extern DECLSPEC const char *SDLCALL SDL_GetWindowTitle(SDL_WindowID windowID);
00595
00603 extern DECLSPEC void SDLCALL SDL_SetWindowIcon(SDL_WindowID windowID,
00604 SDL_Surface * icon);
00605
00613 extern DECLSPEC void SDLCALL SDL_SetWindowData(SDL_WindowID windowID,
00614 void *userdata);
00615
00623 extern DECLSPEC void *SDLCALL SDL_GetWindowData(SDL_WindowID windowID);
00624
00638 extern DECLSPEC void SDLCALL SDL_SetWindowPosition(SDL_WindowID windowID,
00639 int x, int y);
00640
00648 extern DECLSPEC void SDLCALL SDL_GetWindowPosition(SDL_WindowID windowID,
00649 int *x, int *y);
00650
00661 extern DECLSPEC void SDLCALL SDL_SetWindowSize(SDL_WindowID windowID, int w,
00662 int h);
00663
00671 extern DECLSPEC void SDLCALL SDL_GetWindowSize(SDL_WindowID windowID, int *w,
00672 int *h);
00673
00681 extern DECLSPEC void SDLCALL SDL_ShowWindow(SDL_WindowID windowID);
00682
00690 extern DECLSPEC void SDLCALL SDL_HideWindow(SDL_WindowID windowID);
00691
00697 extern DECLSPEC void SDLCALL SDL_RaiseWindow(SDL_WindowID windowID);
00698
00706 extern DECLSPEC void SDLCALL SDL_MaximizeWindow(SDL_WindowID windowID);
00707
00715 extern DECLSPEC void SDLCALL SDL_MinimizeWindow(SDL_WindowID windowID);
00716
00725 extern DECLSPEC void SDLCALL SDL_RestoreWindow(SDL_WindowID windowID);
00726
00736 extern DECLSPEC int SDLCALL SDL_SetWindowFullscreen(SDL_WindowID windowID,
00737 int fullscreen);
00738
00748 extern DECLSPEC void SDLCALL SDL_SetWindowGrab(SDL_WindowID windowID,
00749 int mode);
00750
00760 extern DECLSPEC int SDLCALL SDL_GetWindowGrab(SDL_WindowID windowID);
00761
00769 struct SDL_SysWMinfo;
00770 extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowWMInfo(SDL_WindowID windowID,
00771 struct SDL_SysWMinfo
00772 *info);
00773
00779 extern DECLSPEC void SDLCALL SDL_DestroyWindow(SDL_WindowID windowID);
00780
00793 extern DECLSPEC int SDLCALL SDL_GetNumRenderDrivers(void);
00794
00807 extern DECLSPEC int SDLCALL SDL_GetRenderDriverInfo(int index,
00808 SDL_RendererInfo * info);
00809
00825 extern DECLSPEC int SDLCALL SDL_CreateRenderer(SDL_WindowID windowID,
00826 int index, Uint32 flags);
00827
00836 extern DECLSPEC int SDLCALL SDL_SelectRenderer(SDL_WindowID windowID);
00837
00843 extern DECLSPEC int SDLCALL SDL_GetRendererInfo(SDL_RendererInfo * info);
00844
00860 extern DECLSPEC SDL_TextureID SDLCALL SDL_CreateTexture(Uint32 format,
00861 int access, int w,
00862 int h);
00863
00879 extern DECLSPEC SDL_TextureID SDLCALL SDL_CreateTextureFromSurface(Uint32
00880 format,
00881 SDL_Surface
00882 * surface);
00883
00897 extern DECLSPEC int SDLCALL SDL_QueryTexture(SDL_TextureID textureID,
00898 Uint32 * format, int *access,
00899 int *w, int *h);
00900
00912 extern DECLSPEC int SDLCALL SDL_QueryTexturePixels(SDL_TextureID textureID,
00913 void **pixels, int *pitch);
00914
00927 extern DECLSPEC int SDLCALL SDL_SetTexturePalette(SDL_TextureID textureID,
00928 const SDL_Color * colors,
00929 int firstcolor,
00930 int ncolors);
00931
00944 extern DECLSPEC int SDLCALL SDL_GetTexturePalette(SDL_TextureID textureID,
00945 SDL_Color * colors,
00946 int firstcolor,
00947 int ncolors);
00948
00963 extern DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_TextureID textureID,
00964 Uint8 r, Uint8 g, Uint8 b);
00965
00966
00981 extern DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_TextureID textureID,
00982 Uint8 * r, Uint8 * g,
00983 Uint8 * b);
00984
00997 extern DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_TextureID textureID,
00998 Uint8 alpha);
00999
01012 extern DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_TextureID textureID,
01013 Uint8 * alpha);
01014
01029 extern DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_TextureID textureID,
01030 int blendMode);
01031
01044 extern DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_TextureID textureID,
01045 int *blendMode);
01046
01061 extern DECLSPEC int SDLCALL SDL_SetTextureScaleMode(SDL_TextureID textureID,
01062 int scaleMode);
01063
01076 extern DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_TextureID textureID,
01077 int *scaleMode);
01078
01093 extern DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_TextureID textureID,
01094 const SDL_Rect * rect,
01095 const void *pixels, int pitch);
01096
01113 extern DECLSPEC int SDLCALL SDL_LockTexture(SDL_TextureID textureID,
01114 const SDL_Rect * rect,
01115 int markDirty, void **pixels,
01116 int *pitch);
01117
01126 extern DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_TextureID textureID);
01127
01140 extern DECLSPEC void SDLCALL SDL_DirtyTexture(SDL_TextureID textureID,
01141 int numrects,
01142 const SDL_Rect * rects);
01143
01155 extern DECLSPEC int SDL_SetRenderDrawColor(Uint8 r, Uint8 g, Uint8 b,
01156 Uint8 a);
01157
01169 extern DECLSPEC int SDL_GetRenderDrawColor(Uint8 * r, Uint8 * g, Uint8 * b,
01170 Uint8 * a);
01171
01185 extern DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(int blendMode);
01186
01198 extern DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(int *blendMode);
01199
01210 extern DECLSPEC int SDLCALL SDL_RenderPoint(int x, int y);
01211
01224 extern DECLSPEC int SDLCALL SDL_RenderLine(int x1, int y1, int x2, int y2);
01225
01235 extern DECLSPEC int SDLCALL SDL_RenderFill(const SDL_Rect * rect);
01236
01248 extern DECLSPEC int SDLCALL SDL_RenderCopy(SDL_TextureID textureID,
01249 const SDL_Rect * srcrect,
01250 const SDL_Rect * dstrect);
01251
01265 extern DECLSPEC int SDLCALL SDL_RenderReadPixels(const SDL_Rect * rect,
01266 void *pixels, int pitch);
01267
01281 extern DECLSPEC int SDLCALL SDL_RenderWritePixels(const SDL_Rect * rect,
01282 const void *pixels,
01283 int pitch);
01284
01290 extern DECLSPEC void SDLCALL SDL_RenderPresent(void);
01291
01300 extern DECLSPEC void SDLCALL SDL_DestroyTexture(SDL_TextureID textureID);
01301
01310 extern DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_WindowID windowID);
01311
01320 extern DECLSPEC SDL_bool SDLCALL SDL_IsScreenSaverEnabled(void);
01321
01330 extern DECLSPEC void SDLCALL SDL_EnableScreenSaver(void);
01331
01340 extern DECLSPEC void SDLCALL SDL_DisableScreenSaver(void);
01341
01342
01343
01344
01345
01346
01366 extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path);
01367
01373 extern DECLSPEC void *SDLCALL SDL_GL_GetProcAddress(const char *proc);
01374
01382 extern DECLSPEC void SDLCALL SDL_GL_UnloadLibrary(void);
01383
01389 extern DECLSPEC SDL_bool SDLCALL SDL_GL_ExtensionSupported(const char
01390 *extension);
01391
01397 extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value);
01398
01404 extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int *value);
01405
01413 extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_CreateContext(SDL_WindowID
01414 windowID);
01415
01423 extern DECLSPEC int SDLCALL SDL_GL_MakeCurrent(SDL_WindowID windowID,
01424 SDL_GLContext context);
01425
01437 extern DECLSPEC int SDLCALL SDL_GL_SetSwapInterval(int interval);
01438
01448 extern DECLSPEC int SDLCALL SDL_GL_GetSwapInterval(void);
01449
01455 extern DECLSPEC void SDLCALL SDL_GL_SwapWindow(SDL_WindowID windowID);
01456
01464 extern DECLSPEC void SDLCALL SDL_GL_DeleteContext(SDL_GLContext context);
01465
01466
01467
01468 #ifdef __cplusplus
01469
01470 }
01471
01472 #endif
01473 #include "close_code.h"
01474
01475 #endif
01476
01477