Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Implemented many compatibility functions
  • Loading branch information
slouken committed May 29, 2006
1 parent 555fee5 commit d3eec312308b58a2c3b950e2bf3eb4a273fe4044
Showing with 401 additions and 86 deletions.
  1. +1 −1 .indent.pro
  2. +50 −75 include/SDL_compat.h
  3. +314 −0 src/SDL_compat.c
  4. +31 −10 src/video/SDL_video.c
  5. +5 −0 src/video/dummy/SDL_nullvideo.c
@@ -1 +1 @@
-i4 -nut -nsc -br -ce
-i4 -nut -nsc -br -ce -cdw -npcs
@@ -30,97 +30,72 @@
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C"
{
/* *INDENT-OFF* */
extern "C" {
/* *INDENT-ON* */
#endif

extern DECLSPEC char *SDLCALL SDL_AudioDriverName (char *namebuf,
int maxlen);
extern DECLSPEC char *SDLCALL SDL_VideoDriverName (char *namebuf,
int maxlen);
extern DECLSPEC int SDLCALL SDL_VideoModeOK (int width, int height,
int bpp, Uint32 flags);
extern DECLSPEC SDL_Rect **SDLCALL SDL_ListModes (SDL_PixelFormat *
format, Uint32 flags);
extern DECLSPEC SDL_Surface *SDLCALL SDL_SetVideoMode (int width,
int height,
int bpp,
Uint32 flags);
#define SDL_SWSURFACE 0x00000000
#define SDL_HWSURFACE 0x00000001
#define SDL_ASYNCBLIT 0x00000004
#define SDL_ANYFORMAT 0x10000000
#define SDL_HWPALETTE 0x20000000
#define SDL_DOUBLEBUF 0x40000000
#define SDL_FULLSCREEN 0x80000000
#define SDL_OPENGL 0x00000002
#define SDL_INTERNALOPENGL 0x00000008
#define SDL_RESIZABLE 0x00000010
#define SDL_NOFRAME 0x00000020
#define SDL_HWACCEL 0x00000100
#define SDL_SRCCOLORKEY 0x00001000
#define SDL_RLEACCELOK 0x00002000
#define SDL_RLEACCEL 0x00004000
#define SDL_SRCALPHA 0x00010000

#define SDL_APPMOUSEFOCUS 0x01
#define SDL_APPINPUTFOCUS 0x02
#define SDL_APPACTIVE 0x04

/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#define SDL_LOGPAL 0x01
#define SDL_PHYSPAL 0x02

#endif /* _SDL_compat_h */
typedef enum
{
SDL_GRAB_QUERY = -1,
SDL_GRAB_OFF = 0,
SDL_GRAB_ON = 1
} SDL_GrabMode;

extern DECLSPEC const SDL_version *SDLCALL SDL_Linked_Version (void);
extern DECLSPEC char *SDLCALL SDL_AudioDriverName (char *namebuf, int maxlen);
extern DECLSPEC char *SDLCALL SDL_VideoDriverName (char *namebuf, int maxlen);
extern DECLSPEC int SDLCALL SDL_VideoModeOK (int width, int height, int bpp,
Uint32 flags);
extern DECLSPEC SDL_Rect **SDLCALL SDL_ListModes (SDL_PixelFormat * format,
Uint32 flags);
extern DECLSPEC SDL_Surface *SDLCALL SDL_SetVideoMode (int width, int height,
int bpp, Uint32 flags);
extern DECLSPEC SDL_Surface *SDLCALL SDL_GetVideoSurface (void);

/* These are the currently supported flags for the SDL_surface */
/* Available for SDL_CreateRGBSurface() or SDL_SetVideoMode() */
#define SDL_SWSURFACE 0x00000000 /* Surface is in system memory */
#define SDL_HWSURFACE 0x00000001 /* Surface is in video memory */
#define SDL_ASYNCBLIT 0x00000004 /* Use asynchronous blits if possible */
/* Available for SDL_SetVideoMode() */
#define SDL_ANYFORMAT 0x10000000 /* Allow any video depth/pixel-format */
#define SDL_HWPALETTE 0x20000000 /* Surface has exclusive palette */
#define SDL_DOUBLEBUF 0x40000000 /* Set up double-buffered video mode */
#define SDL_FULLSCREEN 0x80000000 /* Surface is a full screen display */
#define SDL_OPENGL 0x00000002 /* Create an OpenGL rendering context */
#define SDL_INTERNALOPENGL 0x00000008 /* SDL uses OpenGL internally for this window */
#define SDL_RESIZABLE 0x00000010 /* This video mode may be resized */
#define SDL_NOFRAME 0x00000020 /* No window caption or edge frame */
/* Used internally (read-only) */
#define SDL_HWACCEL 0x00000100 /* Blit uses hardware acceleration */
#define SDL_SRCCOLORKEY 0x00001000 /* Blit uses a source color key */
#define SDL_RLEACCELOK 0x00002000 /* Private flag */
#define SDL_RLEACCEL 0x00004000 /* Surface is RLE encoded */
#define SDL_SRCALPHA 0x00010000 /* Blit uses source alpha blending */

extern DECLSPEC void SDLCALL SDL_WM_SetCaption (const char *title,
const char *icon);
extern DECLSPEC void SDLCALL SDL_WM_GetCaption (char **title, char **icon);
extern DECLSPEC void SDLCALL SDL_WM_SetIcon (SDL_Surface * icon,
Uint8 * mask);
extern DECLSPEC int SDLCALL SDL_WM_IconifyWindow (void);
extern DECLSPEC int SDLCALL SDL_WM_ToggleFullScreen (SDL_Surface * surface);
typedef enum
{
SDL_GRAB_QUERY = -1,
SDL_GRAB_OFF = 0,
SDL_GRAB_ON = 1
} SDL_GrabMode;
extern DECLSPEC SDL_GrabMode SDLCALL SDL_WM_GrabInput (SDL_GrabMode mode);

/* The available application states */
#define SDL_APPMOUSEFOCUS 0x01 /* The app has mouse coverage */
#define SDL_APPINPUTFOCUS 0x02 /* The app has input focus */
#define SDL_APPACTIVE 0x04 /* The application is active */

extern DECLSPEC Uint8 SDLCALL SDL_GetAppState (void);
extern DECLSPEC const SDL_version *SDLCALL SDL_Linked_Version (void);
/* flags for SDL_SetPalette() */
#define SDL_LOGPAL 0x01
#define SDL_PHYSPAL 0x02

/*
* Sets a portion of the colormap for a given 8-bit surface.
* 'flags' is one or both of:
* SDL_LOGPAL -- set logical palette, which controls how blits are mapped
* to/from the surface,
* SDL_PHYSPAL -- set physical palette, which controls how pixels look on
* the screen
* Only screens have physical palettes. Separate change of physical/logical
* palettes is only possible if the screen has SDL_HWPALETTE set.
*
* The return value is 1 if all colours could be set as requested, and 0
* otherwise.
*
* SDL_SetColors() is equivalent to calling this function with
* flags = (SDL_LOGPAL|SDL_PHYSPAL).
*/
extern DECLSPEC int SDLCALL SDL_SetPalette (SDL_Surface * surface, int flags,
SDL_Color * colors,
int firstcolor, int ncolors);
extern DECLSPEC int SDLCALL SDL_GetWMInfo (SDL_SysWMinfo * info);

/* Ends C function definitions when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
}
/* *INDENT-ON* */
#endif
#include "close_code.h"

#endif /* _SDL_compat_h */

0 comments on commit d3eec31

Please sign in to comment.