mirror of
https://github.com/joel16/SDL2.git
synced 2024-12-13 14:07:38 +00:00
SDL constants are all uppercase.
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402012
This commit is contained in:
parent
7bc5cd5763
commit
bfe4f31c0e
@ -39,60 +39,60 @@ extern "C" {
|
||||
|
||||
enum
|
||||
{ /* Pixel type */
|
||||
SDL_PixelType_Unknown,
|
||||
SDL_PixelType_Index1,
|
||||
SDL_PixelType_Index4,
|
||||
SDL_PixelType_Index8,
|
||||
SDL_PixelType_Packed8,
|
||||
SDL_PixelType_Packed16,
|
||||
SDL_PixelType_Packed32,
|
||||
SDL_PixelType_ArrayU8,
|
||||
SDL_PixelType_ArrayU16,
|
||||
SDL_PixelType_ArrayU32,
|
||||
SDL_PixelType_ArrayF16,
|
||||
SDL_PixelType_ArrayF32,
|
||||
SDL_PIXELTYPE_UNKNOWN,
|
||||
SDL_PIXELTYPE_INDEX1,
|
||||
SDL_PIXELTYPE_INDEX4,
|
||||
SDL_PIXELTYPE_INDEX8,
|
||||
SDL_PIXELTYPE_PACKED8,
|
||||
SDL_PIXELTYPE_PACKED16,
|
||||
SDL_PIXELTYPE_PACKED32,
|
||||
SDL_PIXELTYPE_ARRAYU8,
|
||||
SDL_PIXELTYPE_ARRAYU16,
|
||||
SDL_PIXELTYPE_ARRAYU32,
|
||||
SDL_PIXELTYPE_ARRAYF16,
|
||||
SDL_PIXELTYPE_ARRAYF32,
|
||||
};
|
||||
|
||||
enum
|
||||
{ /* bitmap pixel order, high bit -> low bit */
|
||||
SDL_BitmapOrder_None,
|
||||
SDL_BitmapOrder_4321,
|
||||
SDL_BitmapOrder_1234,
|
||||
SDL_BITMAPORDER_NONE,
|
||||
SDL_BITMAPORDER_4321,
|
||||
SDL_BITMAPORDER_1234,
|
||||
};
|
||||
enum
|
||||
{ /* packed component order, high bit -> low bit */
|
||||
SDL_PackedOrder_None,
|
||||
SDL_PackedOrder_XRGB,
|
||||
SDL_PackedOrder_RGBX,
|
||||
SDL_PackedOrder_ARGB,
|
||||
SDL_PackedOrder_RGBA,
|
||||
SDL_PackedOrder_XBGR,
|
||||
SDL_PackedOrder_BGRX,
|
||||
SDL_PackedOrder_ABGR,
|
||||
SDL_PackedOrder_BGRA,
|
||||
SDL_PACKEDORDER_NONE,
|
||||
SDL_PACKEDORDER_XRGB,
|
||||
SDL_PACKEDORDER_RGBX,
|
||||
SDL_PACKEDORDER_ARGB,
|
||||
SDL_PACKEDORDER_RGBA,
|
||||
SDL_PACKEDORDER_XBGR,
|
||||
SDL_PACKEDORDER_BGRX,
|
||||
SDL_PACKEDORDER_ABGR,
|
||||
SDL_PACKEDORDER_BGRA,
|
||||
};
|
||||
enum
|
||||
{ /* array component order, low byte -> high byte */
|
||||
SDL_ArrayOrder_None,
|
||||
SDL_ArrayOrder_RGB,
|
||||
SDL_ArrayOrder_RGBA,
|
||||
SDL_ArrayOrder_ARGB,
|
||||
SDL_ArrayOrder_BGR,
|
||||
SDL_ArrayOrder_BGRA,
|
||||
SDL_ArrayOrder_ABGR,
|
||||
SDL_ARRAYORDER_NONE,
|
||||
SDL_ARRAYORDER_RGB,
|
||||
SDL_ARRAYORDER_RGBA,
|
||||
SDL_ARRAYORDER_ARGB,
|
||||
SDL_ARRAYORDER_BGR,
|
||||
SDL_ARRAYORDER_BGRA,
|
||||
SDL_ARRAYORDER_ABGR,
|
||||
};
|
||||
|
||||
enum
|
||||
{ /* Packed component layout */
|
||||
SDL_PackedLayout_None,
|
||||
SDL_PackedLayout_332,
|
||||
SDL_PackedLayout_4444,
|
||||
SDL_PackedLayout_1555,
|
||||
SDL_PackedLayout_5551,
|
||||
SDL_PackedLayout_565,
|
||||
SDL_PackedLayout_8888,
|
||||
SDL_PackedLayout_2101010,
|
||||
SDL_PackedLayout_1010102,
|
||||
SDL_PACKEDLAYOUT_NONE,
|
||||
SDL_PACKEDLAYOUT_332,
|
||||
SDL_PACKEDLAYOUT_4444,
|
||||
SDL_PACKEDLAYOUT_1555,
|
||||
SDL_PACKEDLAYOUT_5551,
|
||||
SDL_PACKEDLAYOUT_565,
|
||||
SDL_PACKEDLAYOUT_8888,
|
||||
SDL_PACKEDLAYOUT_2101010,
|
||||
SDL_PACKEDLAYOUT_1010102,
|
||||
};
|
||||
|
||||
#define SDL_DEFINE_PIXELFOURCC(A, B, C, D) \
|
||||
@ -109,85 +109,85 @@ enum
|
||||
#define SDL_BYTESPERPIXEL(X) (((X) >> 0) & 0xFF)
|
||||
|
||||
#define SDL_ISPIXELFORMAT_INDEXED(format) \
|
||||
((SDL_PIXELTYPE(format) == SDL_PixelType_Index1) || \
|
||||
(SDL_PIXELTYPE(format) == SDL_PixelType_Index4) || \
|
||||
(SDL_PIXELTYPE(format) == SDL_PixelType_Index8))
|
||||
((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX1) || \
|
||||
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX4) || \
|
||||
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX8))
|
||||
|
||||
#define SDL_ISPIXELFORMAT_FOURCC(format) \
|
||||
((format) && !((format) & 0x80000000))
|
||||
|
||||
enum
|
||||
{
|
||||
SDL_PixelFormat_Unknown,
|
||||
SDL_PixelFormat_Index1LSB =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PixelType_Index1, SDL_BitmapOrder_1234, 0,
|
||||
SDL_PIXELFORMAT_UNKNOWN,
|
||||
SDL_PIXELFORMAT_INDEX1LSB =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_1234, 0,
|
||||
1, 0),
|
||||
SDL_PixelFormat_Index1MSB =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PixelType_Index1, SDL_BitmapOrder_4321, 0,
|
||||
SDL_PIXELFORMAT_INDEX1MSB =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_4321, 0,
|
||||
1, 0),
|
||||
SDL_PixelFormat_Index4LSB =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PixelType_Index4, SDL_BitmapOrder_1234, 0,
|
||||
SDL_PIXELFORMAT_INDEX4LSB =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_1234, 0,
|
||||
2, 0),
|
||||
SDL_PixelFormat_Index4MSB =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PixelType_Index4, SDL_BitmapOrder_4321, 0,
|
||||
SDL_PIXELFORMAT_INDEX4MSB =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_4321, 0,
|
||||
2, 0),
|
||||
SDL_PixelFormat_Index8 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PixelType_Index8, 0, 0, 8, 1),
|
||||
SDL_PixelFormat_RGB332 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PixelType_Packed8, SDL_PackedOrder_XRGB,
|
||||
SDL_PackedLayout_332, 8, 1),
|
||||
SDL_PixelFormat_RGB444 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PixelType_Packed16, SDL_PackedOrder_XRGB,
|
||||
SDL_PackedLayout_4444, 12, 2),
|
||||
SDL_PixelFormat_RGB555 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PixelType_Packed16, SDL_PackedOrder_XRGB,
|
||||
SDL_PackedLayout_1555, 15, 2),
|
||||
SDL_PixelFormat_ARGB4444 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PixelType_Packed16, SDL_PackedOrder_ARGB,
|
||||
SDL_PackedLayout_4444, 16, 2),
|
||||
SDL_PixelFormat_ARGB1555 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PixelType_Packed16, SDL_PackedOrder_ARGB,
|
||||
SDL_PackedLayout_1555, 16, 2),
|
||||
SDL_PixelFormat_RGB565 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PixelType_Packed16, SDL_PackedOrder_XRGB,
|
||||
SDL_PackedLayout_565, 16, 2),
|
||||
SDL_PixelFormat_RGB24 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PixelType_ArrayU8, SDL_ArrayOrder_RGB, 0,
|
||||
SDL_PIXELFORMAT_INDEX8 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX8, 0, 0, 8, 1),
|
||||
SDL_PIXELFORMAT_RGB332 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED8, SDL_PACKEDORDER_XRGB,
|
||||
SDL_PACKEDLAYOUT_332, 8, 1),
|
||||
SDL_PIXELFORMAT_RGB444 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB,
|
||||
SDL_PACKEDLAYOUT_4444, 12, 2),
|
||||
SDL_PIXELFORMAT_RGB555 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB,
|
||||
SDL_PACKEDLAYOUT_1555, 15, 2),
|
||||
SDL_PIXELFORMAT_ARGB4444 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB,
|
||||
SDL_PACKEDLAYOUT_4444, 16, 2),
|
||||
SDL_PIXELFORMAT_ARGB1555 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB,
|
||||
SDL_PACKEDLAYOUT_1555, 16, 2),
|
||||
SDL_PIXELFORMAT_RGB565 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB,
|
||||
SDL_PACKEDLAYOUT_565, 16, 2),
|
||||
SDL_PIXELFORMAT_RGB24 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_RGB, 0,
|
||||
24, 3),
|
||||
SDL_PixelFormat_BGR24 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PixelType_ArrayU8, SDL_ArrayOrder_BGR, 0,
|
||||
SDL_PIXELFORMAT_BGR24 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_BGR, 0,
|
||||
24, 3),
|
||||
SDL_PixelFormat_RGB888 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PixelType_Packed32, SDL_PackedOrder_XRGB,
|
||||
SDL_PackedLayout_8888, 24, 4),
|
||||
SDL_PixelFormat_BGR888 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PixelType_Packed32, SDL_PackedOrder_XBGR,
|
||||
SDL_PackedLayout_8888, 24, 4),
|
||||
SDL_PixelFormat_ARGB8888 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PixelType_Packed32, SDL_PackedOrder_ARGB,
|
||||
SDL_PackedLayout_8888, 32, 4),
|
||||
SDL_PixelFormat_RGBA8888 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PixelType_Packed32, SDL_PackedOrder_RGBA,
|
||||
SDL_PackedLayout_8888, 32, 4),
|
||||
SDL_PixelFormat_ABGR8888 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PixelType_Packed32, SDL_PackedOrder_ABGR,
|
||||
SDL_PackedLayout_8888, 32, 4),
|
||||
SDL_PixelFormat_BGRA8888 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PixelType_Packed32, SDL_PackedOrder_BGRA,
|
||||
SDL_PackedLayout_8888, 32, 4),
|
||||
SDL_PixelFormat_ARGB2101010 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PixelType_Packed32, SDL_PackedOrder_ARGB,
|
||||
SDL_PackedLayout_2101010, 32, 4),
|
||||
SDL_PIXELFORMAT_RGB888 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XRGB,
|
||||
SDL_PACKEDLAYOUT_8888, 24, 4),
|
||||
SDL_PIXELFORMAT_BGR888 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XBGR,
|
||||
SDL_PACKEDLAYOUT_8888, 24, 4),
|
||||
SDL_PIXELFORMAT_ARGB8888 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB,
|
||||
SDL_PACKEDLAYOUT_8888, 32, 4),
|
||||
SDL_PIXELFORMAT_RGBA8888 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBA,
|
||||
SDL_PACKEDLAYOUT_8888, 32, 4),
|
||||
SDL_PIXELFORMAT_ABGR8888 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ABGR,
|
||||
SDL_PACKEDLAYOUT_8888, 32, 4),
|
||||
SDL_PIXELFORMAT_BGRA8888 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRA,
|
||||
SDL_PACKEDLAYOUT_8888, 32, 4),
|
||||
SDL_PIXELFORMAT_ARGB2101010 =
|
||||
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB,
|
||||
SDL_PACKEDLAYOUT_2101010, 32, 4),
|
||||
|
||||
SDL_PixelFormat_YV12 = /* Planar mode: Y + V + U (3 planes) */
|
||||
SDL_PIXELFORMAT_YV12 = /* Planar mode: Y + V + U (3 planes) */
|
||||
SDL_DEFINE_PIXELFOURCC('Y', 'V', '1', '2'),
|
||||
SDL_PixelFormat_IYUV = /* Planar mode: Y + U + V (3 planes) */
|
||||
SDL_PIXELFORMAT_IYUV = /* Planar mode: Y + U + V (3 planes) */
|
||||
SDL_DEFINE_PIXELFOURCC('I', 'Y', 'U', 'V'),
|
||||
SDL_PixelFormat_YUY2 = /* Packed mode: Y0+U0+Y1+V0 (1 plane) */
|
||||
SDL_PIXELFORMAT_YUY2 = /* Packed mode: Y0+U0+Y1+V0 (1 plane) */
|
||||
SDL_DEFINE_PIXELFOURCC('Y', 'U', 'Y', '2'),
|
||||
SDL_PixelFormat_UYVY = /* Packed mode: U0+Y0+V0+Y1 (1 plane) */
|
||||
SDL_PIXELFORMAT_UYVY = /* Packed mode: U0+Y0+V0+Y1 (1 plane) */
|
||||
SDL_DEFINE_PIXELFOURCC('U', 'Y', 'V', 'Y'),
|
||||
SDL_PixelFormat_YVYU = /* Packed mode: Y0+V0+Y1+U0 (1 plane) */
|
||||
SDL_PIXELFORMAT_YVYU = /* Packed mode: Y0+V0+Y1+U0 (1 plane) */
|
||||
SDL_DEFINE_PIXELFOURCC('Y', 'V', 'Y', 'U'),
|
||||
};
|
||||
|
||||
|
@ -170,13 +170,13 @@ typedef enum
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
SDL_Renderer_SingleBuffer = 0x00000001, /**< Render directly to the window, if possible */
|
||||
SDL_Renderer_PresentCopy = 0x00000002, /**< Present uses a copy from back buffer to the front buffer */
|
||||
SDL_Renderer_PresentFlip2 = 0x00000004, /**< Present uses a flip, swapping back buffer and front buffer */
|
||||
SDL_Renderer_PresentFlip3 = 0x00000008, /**< Present uses a flip, rotating between two back buffers and a front buffer */
|
||||
SDL_Renderer_PresentDiscard = 0x00000010, /**< Present leaves the contents of the backbuffer undefined */
|
||||
SDL_Renderer_PresentVSync = 0x00000020, /**< Present is synchronized with the refresh rate */
|
||||
SDL_Renderer_Accelerated = 0x00000040, /**< The renderer uses hardware acceleration */
|
||||
SDL_RENDERER_SINGLEBUFFER = 0x00000001, /**< Render directly to the window, if possible */
|
||||
SDL_RENDERER_PRESENTCOPY = 0x00000002, /**< Present uses a copy from back buffer to the front buffer */
|
||||
SDL_RENDERER_PRESENTFLIP2 = 0x00000004, /**< Present uses a flip, swapping back buffer and front buffer */
|
||||
SDL_RENDERER_PRESENTFLIP3 = 0x00000008, /**< Present uses a flip, rotating between two back buffers and a front buffer */
|
||||
SDL_RENDERER_PRESENTDISCARD = 0x00000010, /**< Present leaves the contents of the backbuffer undefined */
|
||||
SDL_RENDERER_PRESENTVSYNC = 0x00000020, /**< Present is synchronized with the refresh rate */
|
||||
SDL_RENDERER_ACCELERATED = 0x00000040, /**< The renderer uses hardware acceleration */
|
||||
} SDL_RendererFlags;
|
||||
|
||||
/**
|
||||
@ -203,8 +203,8 @@ typedef struct SDL_RendererInfo
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
SDL_TextureAccess_Local, /**< Lockable system memory */
|
||||
SDL_TextureAccess_Remote, /**< Unlockable video memory */
|
||||
SDL_TEXTUREACCESS_LOCAL, /**< Lockable system memory */
|
||||
SDL_TEXTUREACCESS_REMOTE, /**< Unlockable video memory */
|
||||
} SDL_TextureAccess;
|
||||
|
||||
/**
|
||||
@ -214,11 +214,11 @@ typedef enum
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
SDL_TextureBlendMode_None = 0x00000000, /**< No blending */
|
||||
SDL_TextureBlendMode_Mask = 0x00000001, /**< dst = A ? src : dst (alpha is mask) */
|
||||
SDL_TextureBlendMode_Blend = 0x00000002, /**< dst = (src * A) + (dst * (1-A)) */
|
||||
SDL_TextureBlendMode_Add = 0x00000004, /**< dst = (src * A) + dst */
|
||||
SDL_TextureBlendMode_Mod = 0x00000008, /**< dst = src * dst */
|
||||
SDL_TEXTUREBLENDMODE_NONE = 0x00000000, /**< No blending */
|
||||
SDL_TEXTUREBLENDMODE_MASK = 0x00000001, /**< dst = A ? src : dst (alpha is mask) */
|
||||
SDL_TEXTUREBLENDMODE_BLEND = 0x00000002, /**< dst = (src * A) + (dst * (1-A)) */
|
||||
SDL_TEXTUREBLENDMODE_ADD = 0x00000004, /**< dst = (src * A) + dst */
|
||||
SDL_TEXTUREBLENDMODE_MOD = 0x00000008, /**< dst = src * dst */
|
||||
} SDL_TextureBlendMode;
|
||||
|
||||
/**
|
||||
@ -228,10 +228,10 @@ typedef enum
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
SDL_TextureScaleMode_None = 0x00000000, /**< No scaling, rectangles must match dimensions */
|
||||
SDL_TextureScaleMode_Fast = 0x00000001, /**< Point sampling or equivalent algorithm */
|
||||
SDL_TextureScaleMode_Slow = 0x00000002, /**< Linear filtering or equivalent algorithm */
|
||||
SDL_TextureScaleMode_Best = 0x00000004, /**< Bicubic filtering or equivalent algorithm */
|
||||
SDL_TEXTURESCALEMODE_NONE = 0x00000000, /**< No scaling, rectangles must match dimensions */
|
||||
SDL_TEXTURESCALEMODE_FAST = 0x00000001, /**< Point sampling or equivalent algorithm */
|
||||
SDL_TEXTURESCALEMODE_SLOW = 0x00000002, /**< Linear filtering or equivalent algorithm */
|
||||
SDL_TEXTURESCALEMODE_BEST = 0x00000004, /**< Bicubic filtering or equivalent algorithm */
|
||||
} SDL_TextureScaleMode;
|
||||
|
||||
/**
|
||||
|
@ -401,23 +401,23 @@ SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags)
|
||||
if (desktop_format) {
|
||||
desired_format = desktop_format;
|
||||
} else {
|
||||
desired_format = SDL_PixelFormat_RGB888;
|
||||
desired_format = SDL_PIXELFORMAT_RGB888;
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
desired_format = SDL_PixelFormat_Index8;
|
||||
desired_format = SDL_PIXELFORMAT_INDEX8;
|
||||
break;
|
||||
case 15:
|
||||
desired_format = SDL_PixelFormat_RGB555;
|
||||
desired_format = SDL_PIXELFORMAT_RGB555;
|
||||
break;
|
||||
case 16:
|
||||
desired_format = SDL_PixelFormat_RGB565;
|
||||
desired_format = SDL_PIXELFORMAT_RGB565;
|
||||
break;
|
||||
case 24:
|
||||
desired_format = SDL_PixelFormat_RGB24;
|
||||
desired_format = SDL_PIXELFORMAT_RGB24;
|
||||
break;
|
||||
case 32:
|
||||
desired_format = SDL_PixelFormat_RGB888;
|
||||
desired_format = SDL_PIXELFORMAT_RGB888;
|
||||
break;
|
||||
default:
|
||||
SDL_SetError("Unsupported bpp in SDL_SetVideoMode()");
|
||||
@ -458,18 +458,18 @@ SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags)
|
||||
/* Create a renderer for the window */
|
||||
if (SDL_CreateRenderer
|
||||
(SDL_VideoWindow, -1,
|
||||
SDL_Renderer_SingleBuffer | SDL_Renderer_PresentDiscard) < 0) {
|
||||
SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTDISCARD) < 0) {
|
||||
return NULL;
|
||||
}
|
||||
SDL_GetRendererInfo(-1, &SDL_VideoRendererInfo);
|
||||
|
||||
/* Create a texture for the screen surface */
|
||||
SDL_VideoTexture =
|
||||
SDL_CreateTexture(desired_format, SDL_TextureAccess_Local, width,
|
||||
SDL_CreateTexture(desired_format, SDL_TEXTUREACCESS_LOCAL, width,
|
||||
height);
|
||||
if (!SDL_VideoTexture) {
|
||||
SDL_VideoTexture =
|
||||
SDL_CreateTexture(SDL_PixelFormat_RGB888, SDL_TextureAccess_Local,
|
||||
SDL_CreateTexture(SDL_PIXELFORMAT_RGB888, SDL_TEXTUREACCESS_LOCAL,
|
||||
width, height);
|
||||
}
|
||||
if (!SDL_VideoTexture) {
|
||||
@ -659,11 +659,11 @@ SDL_UpdateRects(SDL_Surface * screen, int numrects, SDL_Rect * rects)
|
||||
screen = SDL_VideoSurface;
|
||||
}
|
||||
if (screen == SDL_VideoSurface) {
|
||||
if (SDL_VideoRendererInfo.flags & SDL_Renderer_PresentCopy) {
|
||||
if (SDL_VideoRendererInfo.flags & SDL_RENDERER_PRESENTCOPY) {
|
||||
for (i = 0; i < numrects; ++i) {
|
||||
SDL_RenderCopy(SDL_VideoTexture, &rects[i], &rects[i],
|
||||
SDL_TextureBlendMode_None,
|
||||
SDL_TextureScaleMode_None);
|
||||
SDL_TEXTUREBLENDMODE_NONE,
|
||||
SDL_TEXTURESCALEMODE_NONE);
|
||||
}
|
||||
} else {
|
||||
SDL_Rect rect;
|
||||
@ -672,8 +672,8 @@ SDL_UpdateRects(SDL_Surface * screen, int numrects, SDL_Rect * rects)
|
||||
rect.w = screen->w;
|
||||
rect.h = screen->h;
|
||||
SDL_RenderCopy(SDL_VideoTexture, &rect, &rect,
|
||||
SDL_TextureBlendMode_None,
|
||||
SDL_TextureScaleMode_None);
|
||||
SDL_TEXTUREBLENDMODE_NONE,
|
||||
SDL_TEXTURESCALEMODE_NONE);
|
||||
}
|
||||
SDL_RenderPresent();
|
||||
}
|
||||
@ -1304,19 +1304,19 @@ SDL_CreateYUVOverlay(int w, int h, Uint32 format, SDL_Surface * display)
|
||||
|
||||
switch (format) {
|
||||
case SDL_YV12_OVERLAY:
|
||||
texture_format = SDL_PixelFormat_YV12;
|
||||
texture_format = SDL_PIXELFORMAT_YV12;
|
||||
break;
|
||||
case SDL_IYUV_OVERLAY:
|
||||
texture_format = SDL_PixelFormat_IYUV;
|
||||
texture_format = SDL_PIXELFORMAT_IYUV;
|
||||
break;
|
||||
case SDL_YUY2_OVERLAY:
|
||||
texture_format = SDL_PixelFormat_YUY2;
|
||||
texture_format = SDL_PIXELFORMAT_YUY2;
|
||||
break;
|
||||
case SDL_UYVY_OVERLAY:
|
||||
texture_format = SDL_PixelFormat_UYVY;
|
||||
texture_format = SDL_PIXELFORMAT_UYVY;
|
||||
break;
|
||||
case SDL_YVYU_OVERLAY:
|
||||
texture_format = SDL_PixelFormat_YVYU;
|
||||
texture_format = SDL_PIXELFORMAT_YVYU;
|
||||
break;
|
||||
default:
|
||||
SDL_SetError("Unknown YUV format");
|
||||
@ -1364,7 +1364,7 @@ SDL_CreateYUVOverlay(int w, int h, Uint32 format, SDL_Surface * display)
|
||||
}
|
||||
|
||||
overlay->hwdata->textureID =
|
||||
SDL_CreateTexture(texture_format, SDL_TextureAccess_Local, w, h);
|
||||
SDL_CreateTexture(texture_format, SDL_TEXTUREACCESS_LOCAL, w, h);
|
||||
if (!overlay->hwdata->textureID) {
|
||||
SDL_FreeYUVOverlay(overlay);
|
||||
return NULL;
|
||||
@ -1410,8 +1410,8 @@ int
|
||||
SDL_DisplayYUVOverlay(SDL_Overlay * overlay, SDL_Rect * dstrect)
|
||||
{
|
||||
if (SDL_RenderCopy(overlay->hwdata->textureID, NULL, dstrect,
|
||||
SDL_TextureBlendMode_None,
|
||||
SDL_TextureScaleMode_Fast) < 0) {
|
||||
SDL_TEXTUREBLENDMODE_NONE,
|
||||
SDL_TEXTURESCALEMODE_FAST) < 0) {
|
||||
return -1;
|
||||
}
|
||||
SDL_RenderPresent();
|
||||
|
@ -46,45 +46,45 @@ SDL_PixelFormatEnumToMasks(Uint32 format, int *bpp, Uint32 * Rmask,
|
||||
}
|
||||
*Rmask = *Gmask = *Bmask = *Amask = 0;
|
||||
|
||||
if (SDL_PIXELTYPE(format) != SDL_PixelType_Packed8 &&
|
||||
SDL_PIXELTYPE(format) != SDL_PixelType_Packed16 &&
|
||||
SDL_PIXELTYPE(format) != SDL_PixelType_Packed32) {
|
||||
if (SDL_PIXELTYPE(format) != SDL_PIXELTYPE_PACKED8 &&
|
||||
SDL_PIXELTYPE(format) != SDL_PIXELTYPE_PACKED16 &&
|
||||
SDL_PIXELTYPE(format) != SDL_PIXELTYPE_PACKED32) {
|
||||
/* Not a format that uses masks */
|
||||
return SDL_TRUE;
|
||||
}
|
||||
|
||||
switch (SDL_PIXELLAYOUT(format)) {
|
||||
case SDL_PackedLayout_332:
|
||||
case SDL_PACKEDLAYOUT_332:
|
||||
masks[0] = 0x00000000;
|
||||
masks[1] = 0x000000E0;
|
||||
masks[2] = 0x0000001C;
|
||||
masks[3] = 0x00000003;
|
||||
break;
|
||||
case SDL_PackedLayout_4444:
|
||||
case SDL_PACKEDLAYOUT_4444:
|
||||
masks[0] = 0x0000F000;
|
||||
masks[1] = 0x00000F00;
|
||||
masks[2] = 0x000000F0;
|
||||
masks[3] = 0x0000000F;
|
||||
break;
|
||||
case SDL_PackedLayout_1555:
|
||||
case SDL_PACKEDLAYOUT_1555:
|
||||
masks[0] = 0x00008000;
|
||||
masks[1] = 0x00007C00;
|
||||
masks[2] = 0x000003E0;
|
||||
masks[3] = 0x0000001F;
|
||||
break;
|
||||
case SDL_PackedLayout_565:
|
||||
case SDL_PACKEDLAYOUT_565:
|
||||
masks[0] = 0x00000000;
|
||||
masks[1] = 0x0000F800;
|
||||
masks[2] = 0x000007E0;
|
||||
masks[3] = 0x0000001F;
|
||||
break;
|
||||
case SDL_PackedLayout_8888:
|
||||
case SDL_PACKEDLAYOUT_8888:
|
||||
masks[0] = 0xFF000000;
|
||||
masks[1] = 0x00FF0000;
|
||||
masks[2] = 0x0000FF00;
|
||||
masks[3] = 0x000000FF;
|
||||
break;
|
||||
case SDL_PackedLayout_2101010:
|
||||
case SDL_PACKEDLAYOUT_2101010:
|
||||
masks[0] = 0xC0000000;
|
||||
masks[1] = 0x3FF00000;
|
||||
masks[2] = 0x000FFC00;
|
||||
@ -96,45 +96,45 @@ SDL_PixelFormatEnumToMasks(Uint32 format, int *bpp, Uint32 * Rmask,
|
||||
}
|
||||
|
||||
switch (SDL_PIXELORDER(format)) {
|
||||
case SDL_PackedOrder_XRGB:
|
||||
case SDL_PACKEDORDER_XRGB:
|
||||
*Rmask = masks[1];
|
||||
*Gmask = masks[2];
|
||||
*Bmask = masks[3];
|
||||
break;
|
||||
case SDL_PackedOrder_RGBX:
|
||||
case SDL_PACKEDORDER_RGBX:
|
||||
*Rmask = masks[0];
|
||||
*Gmask = masks[1];
|
||||
*Bmask = masks[2];
|
||||
break;
|
||||
case SDL_PackedOrder_ARGB:
|
||||
case SDL_PACKEDORDER_ARGB:
|
||||
*Amask = masks[0];
|
||||
*Rmask = masks[1];
|
||||
*Gmask = masks[2];
|
||||
*Bmask = masks[3];
|
||||
break;
|
||||
case SDL_PackedOrder_RGBA:
|
||||
case SDL_PACKEDORDER_RGBA:
|
||||
*Rmask = masks[0];
|
||||
*Gmask = masks[1];
|
||||
*Bmask = masks[2];
|
||||
*Amask = masks[3];
|
||||
break;
|
||||
case SDL_PackedOrder_XBGR:
|
||||
case SDL_PACKEDORDER_XBGR:
|
||||
*Bmask = masks[1];
|
||||
*Gmask = masks[2];
|
||||
*Rmask = masks[3];
|
||||
break;
|
||||
case SDL_PackedOrder_BGRX:
|
||||
case SDL_PACKEDORDER_BGRX:
|
||||
*Bmask = masks[0];
|
||||
*Gmask = masks[1];
|
||||
*Rmask = masks[2];
|
||||
break;
|
||||
case SDL_PackedOrder_BGRA:
|
||||
case SDL_PACKEDORDER_BGRA:
|
||||
*Bmask = masks[0];
|
||||
*Gmask = masks[1];
|
||||
*Rmask = masks[2];
|
||||
*Amask = masks[3];
|
||||
break;
|
||||
case SDL_PackedOrder_ABGR:
|
||||
case SDL_PACKEDORDER_ABGR:
|
||||
*Amask = masks[0];
|
||||
*Bmask = masks[1];
|
||||
*Gmask = masks[2];
|
||||
@ -155,64 +155,64 @@ SDL_MasksToPixelFormatEnum(int bpp, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask,
|
||||
case 8:
|
||||
switch (Rmask) {
|
||||
case 0:
|
||||
return SDL_PixelFormat_Index8;
|
||||
return SDL_PIXELFORMAT_INDEX8;
|
||||
case 0xE0:
|
||||
return SDL_PixelFormat_RGB332;
|
||||
return SDL_PIXELFORMAT_RGB332;
|
||||
}
|
||||
break;
|
||||
case 12:
|
||||
switch (Rmask) {
|
||||
case 0x0F00:
|
||||
return SDL_PixelFormat_RGB444;
|
||||
return SDL_PIXELFORMAT_RGB444;
|
||||
}
|
||||
break;
|
||||
case 15:
|
||||
switch (Rmask) {
|
||||
case 0x7C00:
|
||||
return SDL_PixelFormat_RGB555;
|
||||
return SDL_PIXELFORMAT_RGB555;
|
||||
}
|
||||
break;
|
||||
case 16:
|
||||
switch (Rmask) {
|
||||
case 0x0F00:
|
||||
return SDL_PixelFormat_ARGB4444;
|
||||
return SDL_PIXELFORMAT_ARGB4444;
|
||||
case 0x7C00:
|
||||
return SDL_PixelFormat_ARGB1555;
|
||||
return SDL_PIXELFORMAT_ARGB1555;
|
||||
case 0xF800:
|
||||
return SDL_PixelFormat_RGB565;
|
||||
return SDL_PIXELFORMAT_RGB565;
|
||||
}
|
||||
break;
|
||||
case 32:
|
||||
switch (Rmask) {
|
||||
case 0xFF000000:
|
||||
if (Amask == 0x000000FF) {
|
||||
return SDL_PixelFormat_RGBA8888;
|
||||
return SDL_PIXELFORMAT_RGBA8888;
|
||||
}
|
||||
break;
|
||||
case 0x00FF0000:
|
||||
if (Amask == 0xFF000000) {
|
||||
return SDL_PixelFormat_ARGB8888;
|
||||
return SDL_PIXELFORMAT_ARGB8888;
|
||||
} else {
|
||||
return SDL_PixelFormat_RGB888;
|
||||
return SDL_PIXELFORMAT_RGB888;
|
||||
}
|
||||
break;
|
||||
case 0x0000FF00:
|
||||
if (Amask == 0x000000FF) {
|
||||
return SDL_PixelFormat_BGRA8888;
|
||||
return SDL_PIXELFORMAT_BGRA8888;
|
||||
}
|
||||
break;
|
||||
case 0x000000FF:
|
||||
if (Amask == 0xFF000000) {
|
||||
return SDL_PixelFormat_ABGR8888;
|
||||
return SDL_PIXELFORMAT_ABGR8888;
|
||||
} else {
|
||||
return SDL_PixelFormat_BGR888;
|
||||
return SDL_PIXELFORMAT_BGR888;
|
||||
}
|
||||
break;
|
||||
case 0x3FF00000:
|
||||
return SDL_PixelFormat_ARGB2101010;
|
||||
return SDL_PIXELFORMAT_ARGB2101010;
|
||||
}
|
||||
}
|
||||
return SDL_PixelFormat_Unknown;
|
||||
return SDL_PIXELFORMAT_UNKNOWN;
|
||||
}
|
||||
|
||||
|
||||
|
@ -65,31 +65,31 @@ SDL_RenderDriver GL_RenderDriver = {
|
||||
GL_CreateRenderer,
|
||||
{
|
||||
"opengl",
|
||||
(SDL_Renderer_PresentDiscard | SDL_Renderer_PresentVSync |
|
||||
SDL_Renderer_Accelerated),
|
||||
(SDL_TextureBlendMode_None | SDL_TextureBlendMode_Mask |
|
||||
SDL_TextureBlendMode_Blend | SDL_TextureBlendMode_Add |
|
||||
SDL_TextureBlendMode_Mod),
|
||||
(SDL_TextureScaleMode_None | SDL_TextureScaleMode_Fast |
|
||||
SDL_TextureScaleMode_Slow),
|
||||
(SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_PRESENTVSYNC |
|
||||
SDL_RENDERER_ACCELERATED),
|
||||
(SDL_TEXTUREBLENDMODE_NONE | SDL_TEXTUREBLENDMODE_MASK |
|
||||
SDL_TEXTUREBLENDMODE_BLEND | SDL_TEXTUREBLENDMODE_ADD |
|
||||
SDL_TEXTUREBLENDMODE_MOD),
|
||||
(SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_FAST |
|
||||
SDL_TEXTURESCALEMODE_SLOW),
|
||||
16,
|
||||
{
|
||||
SDL_PixelFormat_Index1LSB,
|
||||
SDL_PixelFormat_Index1MSB,
|
||||
SDL_PixelFormat_Index8,
|
||||
SDL_PixelFormat_RGB332,
|
||||
SDL_PixelFormat_RGB444,
|
||||
SDL_PixelFormat_RGB555,
|
||||
SDL_PixelFormat_ARGB4444,
|
||||
SDL_PixelFormat_ARGB1555,
|
||||
SDL_PixelFormat_RGB565,
|
||||
SDL_PixelFormat_RGB24,
|
||||
SDL_PixelFormat_BGR24,
|
||||
SDL_PixelFormat_RGB888,
|
||||
SDL_PixelFormat_BGR888,
|
||||
SDL_PixelFormat_ARGB8888,
|
||||
SDL_PixelFormat_ABGR8888,
|
||||
SDL_PixelFormat_ARGB2101010},
|
||||
SDL_PIXELFORMAT_INDEX1LSB,
|
||||
SDL_PIXELFORMAT_INDEX1MSB,
|
||||
SDL_PIXELFORMAT_INDEX8,
|
||||
SDL_PIXELFORMAT_RGB332,
|
||||
SDL_PIXELFORMAT_RGB444,
|
||||
SDL_PIXELFORMAT_RGB555,
|
||||
SDL_PIXELFORMAT_ARGB4444,
|
||||
SDL_PIXELFORMAT_ARGB1555,
|
||||
SDL_PIXELFORMAT_RGB565,
|
||||
SDL_PIXELFORMAT_RGB24,
|
||||
SDL_PIXELFORMAT_BGR24,
|
||||
SDL_PIXELFORMAT_RGB888,
|
||||
SDL_PIXELFORMAT_BGR888,
|
||||
SDL_PIXELFORMAT_ARGB8888,
|
||||
SDL_PIXELFORMAT_ABGR8888,
|
||||
SDL_PIXELFORMAT_ARGB2101010},
|
||||
0,
|
||||
0}
|
||||
};
|
||||
@ -236,7 +236,7 @@ GL_CreateRenderer(SDL_Window * window, Uint32 flags)
|
||||
renderer->driverdata = data;
|
||||
|
||||
renderer->info.flags =
|
||||
(SDL_Renderer_PresentDiscard | SDL_Renderer_Accelerated);
|
||||
(SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_ACCELERATED);
|
||||
|
||||
if (GL_LoadFunctions(data) < 0) {
|
||||
GL_DestroyRenderer(renderer);
|
||||
@ -253,13 +253,13 @@ GL_CreateRenderer(SDL_Window * window, Uint32 flags)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (flags & SDL_Renderer_PresentVSync) {
|
||||
if (flags & SDL_RENDERER_PRESENTVSYNC) {
|
||||
SDL_GL_SetSwapInterval(1);
|
||||
} else {
|
||||
SDL_GL_SetSwapInterval(0);
|
||||
}
|
||||
if (SDL_GL_GetSwapInterval() > 0) {
|
||||
renderer->info.flags |= SDL_Renderer_PresentVSync;
|
||||
renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC;
|
||||
}
|
||||
|
||||
data->glGetIntegerv(GL_MAX_TEXTURE_SIZE, &value);
|
||||
@ -325,78 +325,78 @@ GL_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
|
||||
GLenum result;
|
||||
|
||||
switch (texture->format) {
|
||||
case SDL_PixelFormat_Index1LSB:
|
||||
case SDL_PixelFormat_Index1MSB:
|
||||
case SDL_PIXELFORMAT_INDEX1LSB:
|
||||
case SDL_PIXELFORMAT_INDEX1MSB:
|
||||
internalFormat = GL_RGB;
|
||||
format = GL_COLOR_INDEX;
|
||||
type = GL_BITMAP;
|
||||
break;
|
||||
case SDL_PixelFormat_Index8:
|
||||
case SDL_PIXELFORMAT_INDEX8:
|
||||
internalFormat = GL_RGB;
|
||||
format = GL_COLOR_INDEX;
|
||||
type = GL_UNSIGNED_BYTE;
|
||||
break;
|
||||
case SDL_PixelFormat_RGB332:
|
||||
case SDL_PIXELFORMAT_RGB332:
|
||||
internalFormat = GL_R3_G3_B2;
|
||||
format = GL_RGB;
|
||||
type = GL_UNSIGNED_BYTE_3_3_2;
|
||||
break;
|
||||
case SDL_PixelFormat_RGB444:
|
||||
case SDL_PIXELFORMAT_RGB444:
|
||||
internalFormat = GL_RGB4;
|
||||
format = GL_RGB;
|
||||
type = GL_UNSIGNED_SHORT_4_4_4_4;
|
||||
break;
|
||||
case SDL_PixelFormat_RGB555:
|
||||
case SDL_PIXELFORMAT_RGB555:
|
||||
internalFormat = GL_RGB5;
|
||||
format = GL_RGB;
|
||||
type = GL_UNSIGNED_SHORT_5_5_5_1;
|
||||
break;
|
||||
case SDL_PixelFormat_ARGB4444:
|
||||
case SDL_PIXELFORMAT_ARGB4444:
|
||||
internalFormat = GL_RGBA4;
|
||||
format = GL_BGRA;
|
||||
type = GL_UNSIGNED_SHORT_4_4_4_4_REV;
|
||||
break;
|
||||
case SDL_PixelFormat_ARGB1555:
|
||||
case SDL_PIXELFORMAT_ARGB1555:
|
||||
internalFormat = GL_RGB5_A1;
|
||||
format = GL_BGRA;
|
||||
type = GL_UNSIGNED_SHORT_1_5_5_5_REV;
|
||||
break;
|
||||
case SDL_PixelFormat_RGB565:
|
||||
case SDL_PIXELFORMAT_RGB565:
|
||||
internalFormat = GL_RGB8;
|
||||
format = GL_RGB;
|
||||
type = GL_UNSIGNED_SHORT_5_6_5;
|
||||
break;
|
||||
case SDL_PixelFormat_RGB24:
|
||||
case SDL_PIXELFORMAT_RGB24:
|
||||
internalFormat = GL_RGB8;
|
||||
format = GL_RGB;
|
||||
type = GL_UNSIGNED_BYTE;
|
||||
break;
|
||||
case SDL_PixelFormat_RGB888:
|
||||
case SDL_PIXELFORMAT_RGB888:
|
||||
internalFormat = GL_RGB8;
|
||||
format = GL_BGRA;
|
||||
type = GL_UNSIGNED_BYTE;
|
||||
break;
|
||||
case SDL_PixelFormat_BGR24:
|
||||
case SDL_PIXELFORMAT_BGR24:
|
||||
internalFormat = GL_RGB8;
|
||||
format = GL_BGR;
|
||||
type = GL_UNSIGNED_BYTE;
|
||||
break;
|
||||
case SDL_PixelFormat_BGR888:
|
||||
case SDL_PIXELFORMAT_BGR888:
|
||||
internalFormat = GL_RGB8;
|
||||
format = GL_RGBA;
|
||||
type = GL_UNSIGNED_BYTE;
|
||||
break;
|
||||
case SDL_PixelFormat_ARGB8888:
|
||||
case SDL_PIXELFORMAT_ARGB8888:
|
||||
internalFormat = GL_RGBA8;
|
||||
format = GL_BGRA;
|
||||
type = GL_UNSIGNED_BYTE;
|
||||
break;
|
||||
case SDL_PixelFormat_ABGR8888:
|
||||
case SDL_PIXELFORMAT_ABGR8888:
|
||||
internalFormat = GL_RGBA8;
|
||||
format = GL_RGBA;
|
||||
type = GL_UNSIGNED_BYTE;
|
||||
break;
|
||||
case SDL_PixelFormat_ARGB2101010:
|
||||
case SDL_PIXELFORMAT_ARGB2101010:
|
||||
internalFormat = GL_RGB10_A2;
|
||||
format = GL_BGRA;
|
||||
type = GL_UNSIGNED_INT_2_10_10_10_REV;
|
||||
@ -465,9 +465,9 @@ static void
|
||||
SetupTextureUpdate(GL_RenderData * renderdata, SDL_Texture * texture,
|
||||
int pitch)
|
||||
{
|
||||
if (texture->format == SDL_PixelFormat_Index1LSB) {
|
||||
if (texture->format == SDL_PIXELFORMAT_INDEX1LSB) {
|
||||
renderdata->glPixelStorei(GL_UNPACK_LSB_FIRST, 1);
|
||||
} else if (texture->format == SDL_PixelFormat_Index1MSB) {
|
||||
} else if (texture->format == SDL_PIXELFORMAT_INDEX1MSB) {
|
||||
renderdata->glPixelStorei(GL_UNPACK_LSB_FIRST, 0);
|
||||
}
|
||||
renderdata->glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
@ -608,22 +608,22 @@ GL_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
|
||||
|
||||
if (blendMode != data->blendMode) {
|
||||
switch (blendMode) {
|
||||
case SDL_TextureBlendMode_None:
|
||||
case SDL_TEXTUREBLENDMODE_NONE:
|
||||
data->glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
|
||||
data->glDisable(GL_BLEND);
|
||||
break;
|
||||
case SDL_TextureBlendMode_Mask:
|
||||
case SDL_TextureBlendMode_Blend:
|
||||
case SDL_TEXTUREBLENDMODE_MASK:
|
||||
case SDL_TEXTUREBLENDMODE_BLEND:
|
||||
data->glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
data->glEnable(GL_BLEND);
|
||||
data->glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
break;
|
||||
case SDL_TextureBlendMode_Add:
|
||||
case SDL_TEXTUREBLENDMODE_ADD:
|
||||
data->glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
data->glEnable(GL_BLEND);
|
||||
data->glBlendFunc(GL_SRC_ALPHA, GL_ONE);
|
||||
break;
|
||||
case SDL_TextureBlendMode_Mod:
|
||||
case SDL_TEXTUREBLENDMODE_MOD:
|
||||
data->glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
data->glEnable(GL_BLEND);
|
||||
data->glBlendFunc(GL_ZERO, GL_SRC_COLOR);
|
||||
@ -634,15 +634,15 @@ GL_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
|
||||
|
||||
if (scaleMode != data->scaleMode) {
|
||||
switch (scaleMode) {
|
||||
case SDL_TextureScaleMode_None:
|
||||
case SDL_TextureScaleMode_Fast:
|
||||
case SDL_TEXTURESCALEMODE_NONE:
|
||||
case SDL_TEXTURESCALEMODE_FAST:
|
||||
data->glTexParameteri(texturedata->type, GL_TEXTURE_MIN_FILTER,
|
||||
GL_NEAREST);
|
||||
data->glTexParameteri(texturedata->type, GL_TEXTURE_MAG_FILTER,
|
||||
GL_NEAREST);
|
||||
break;
|
||||
case SDL_TextureScaleMode_Slow:
|
||||
case SDL_TextureScaleMode_Best:
|
||||
case SDL_TEXTURESCALEMODE_SLOW:
|
||||
case SDL_TEXTURESCALEMODE_BEST:
|
||||
data->glTexParameteri(texturedata->type, GL_TEXTURE_MIN_FILTER,
|
||||
GL_LINEAR);
|
||||
data->glTexParameteri(texturedata->type, GL_TEXTURE_MAG_FILTER,
|
||||
|
@ -67,25 +67,25 @@ SDL_RenderDriver SW_RenderDriver = {
|
||||
SW_CreateRenderer,
|
||||
{
|
||||
"software",
|
||||
(SDL_Renderer_SingleBuffer | SDL_Renderer_PresentCopy |
|
||||
SDL_Renderer_PresentFlip2 | SDL_Renderer_PresentFlip3 |
|
||||
SDL_Renderer_PresentDiscard | SDL_Renderer_PresentVSync),
|
||||
(SDL_TextureBlendMode_None | SDL_TextureBlendMode_Mask |
|
||||
SDL_TextureBlendMode_Blend),
|
||||
(SDL_TextureScaleMode_None | SDL_TextureScaleMode_Fast),
|
||||
(SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTCOPY |
|
||||
SDL_RENDERER_PRESENTFLIP2 | SDL_RENDERER_PRESENTFLIP3 |
|
||||
SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_PRESENTVSYNC),
|
||||
(SDL_TEXTUREBLENDMODE_NONE | SDL_TEXTUREBLENDMODE_MASK |
|
||||
SDL_TEXTUREBLENDMODE_BLEND),
|
||||
(SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_FAST),
|
||||
11,
|
||||
{
|
||||
SDL_PixelFormat_Index8,
|
||||
SDL_PixelFormat_RGB555,
|
||||
SDL_PixelFormat_RGB565,
|
||||
SDL_PixelFormat_RGB888,
|
||||
SDL_PixelFormat_BGR888,
|
||||
SDL_PixelFormat_ARGB8888,
|
||||
SDL_PixelFormat_RGBA8888,
|
||||
SDL_PixelFormat_ABGR8888,
|
||||
SDL_PixelFormat_BGRA8888,
|
||||
SDL_PixelFormat_YUY2,
|
||||
SDL_PixelFormat_UYVY},
|
||||
SDL_PIXELFORMAT_INDEX8,
|
||||
SDL_PIXELFORMAT_RGB555,
|
||||
SDL_PIXELFORMAT_RGB565,
|
||||
SDL_PIXELFORMAT_RGB888,
|
||||
SDL_PIXELFORMAT_BGR888,
|
||||
SDL_PIXELFORMAT_ARGB8888,
|
||||
SDL_PIXELFORMAT_RGBA8888,
|
||||
SDL_PIXELFORMAT_ABGR8888,
|
||||
SDL_PIXELFORMAT_BGRA8888,
|
||||
SDL_PIXELFORMAT_YUY2,
|
||||
SDL_PIXELFORMAT_UYVY},
|
||||
0,
|
||||
0}
|
||||
};
|
||||
@ -112,7 +112,7 @@ CreateTexture(SDL_Renderer * renderer, Uint32 format, int w, int h)
|
||||
}
|
||||
|
||||
texture->format = format;
|
||||
texture->access = SDL_TextureAccess_Local;
|
||||
texture->access = SDL_TEXTUREACCESS_LOCAL;
|
||||
texture->w = w;
|
||||
texture->h = h;
|
||||
texture->renderer = renderer;
|
||||
@ -199,23 +199,23 @@ SW_CreateRenderer(SDL_Window * window, Uint32 flags)
|
||||
|
||||
renderer->info.flags = 0;
|
||||
|
||||
if (flags & SDL_Renderer_PresentFlip2) {
|
||||
renderer->info.flags |= SDL_Renderer_PresentFlip2;
|
||||
if (flags & SDL_RENDERER_PRESENTFLIP2) {
|
||||
renderer->info.flags |= SDL_RENDERER_PRESENTFLIP2;
|
||||
n = 2;
|
||||
} else if (flags & SDL_Renderer_PresentFlip3) {
|
||||
renderer->info.flags |= SDL_Renderer_PresentFlip3;
|
||||
} else if (flags & SDL_RENDERER_PRESENTFLIP3) {
|
||||
renderer->info.flags |= SDL_RENDERER_PRESENTFLIP3;
|
||||
n = 3;
|
||||
} else {
|
||||
renderer->info.flags |= SDL_Renderer_PresentCopy;
|
||||
renderer->info.flags |= SDL_RENDERER_PRESENTCOPY;
|
||||
n = 1;
|
||||
}
|
||||
data->format = displayMode->format;
|
||||
|
||||
/* Find a render driver that we can use to display data */
|
||||
renderer_flags = (SDL_Renderer_SingleBuffer |
|
||||
SDL_Renderer_PresentDiscard);
|
||||
if (flags & SDL_Renderer_PresentVSync) {
|
||||
renderer_flags |= SDL_Renderer_PresentVSync;
|
||||
renderer_flags = (SDL_RENDERER_SINGLEBUFFER |
|
||||
SDL_RENDERER_PRESENTDISCARD);
|
||||
if (flags & SDL_RENDERER_PRESENTVSYNC) {
|
||||
renderer_flags |= SDL_RENDERER_PRESENTVSYNC;
|
||||
}
|
||||
desired_driver = SDL_getenv("SDL_VIDEO_RENDERER_SWDRIVER");
|
||||
for (i = 0; i < display->num_render_drivers; ++i) {
|
||||
@ -237,8 +237,8 @@ SW_CreateRenderer(SDL_Window * window, Uint32 flags)
|
||||
SDL_SetError("Couldn't find display render driver");
|
||||
return NULL;
|
||||
}
|
||||
if (data->renderer->info.flags & SDL_Renderer_PresentVSync) {
|
||||
renderer->info.flags |= SDL_Renderer_PresentVSync;
|
||||
if (data->renderer->info.flags & SDL_RENDERER_PRESENTVSYNC) {
|
||||
renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC;
|
||||
}
|
||||
|
||||
/* Create the textures we'll use for display */
|
||||
@ -411,7 +411,7 @@ SW_RenderFill(SDL_Renderer * renderer, const SDL_Rect * rect, Uint32 color)
|
||||
SDL_Rect real_rect;
|
||||
int status;
|
||||
|
||||
if (data->renderer->info.flags & SDL_Renderer_PresentCopy) {
|
||||
if (data->renderer->info.flags & SDL_RENDERER_PRESENTCOPY) {
|
||||
SDL_AddDirtyRect(&data->dirty, rect);
|
||||
}
|
||||
|
||||
@ -449,7 +449,7 @@ SW_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
|
||||
SDL_Window *window = SDL_GetWindowFromID(renderer->window);
|
||||
int status;
|
||||
|
||||
if (data->renderer->info.flags & SDL_Renderer_PresentCopy) {
|
||||
if (data->renderer->info.flags & SDL_RENDERER_PRESENTCOPY) {
|
||||
SDL_AddDirtyRect(&data->dirty, dstrect);
|
||||
}
|
||||
|
||||
@ -477,12 +477,12 @@ SW_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
|
||||
real_dstrect = data->surface.clip_rect;
|
||||
|
||||
if (blendMode &
|
||||
(SDL_TextureBlendMode_Mask | SDL_TextureBlendMode_Blend)) {
|
||||
(SDL_TEXTUREBLENDMODE_MASK | SDL_TEXTUREBLENDMODE_BLEND)) {
|
||||
SDL_SetAlpha(surface, SDL_SRCALPHA, 0);
|
||||
} else {
|
||||
SDL_SetAlpha(surface, 0, 0);
|
||||
}
|
||||
if (scaleMode != SDL_TextureScaleMode_None &&
|
||||
if (scaleMode != SDL_TEXTURESCALEMODE_NONE &&
|
||||
(srcrect->w != dstrect->w || srcrect->h != dstrect->h)) {
|
||||
status =
|
||||
SDL_SoftStretch(surface, &real_srcrect, &data->surface,
|
||||
@ -505,13 +505,13 @@ SW_RenderPresent(SDL_Renderer * renderer)
|
||||
SDL_Texture *texture = data->texture[data->current_texture];
|
||||
|
||||
/* Send the data to the display */
|
||||
if (data->renderer->info.flags & SDL_Renderer_PresentCopy) {
|
||||
if (data->renderer->info.flags & SDL_RENDERER_PRESENTCOPY) {
|
||||
SDL_DirtyRect *dirty;
|
||||
for (dirty = data->dirty.list; dirty; dirty = dirty->next) {
|
||||
data->renderer->RenderCopy(data->renderer, texture, &dirty->rect,
|
||||
&dirty->rect,
|
||||
SDL_TextureBlendMode_None,
|
||||
SDL_TextureScaleMode_None);
|
||||
SDL_TEXTUREBLENDMODE_NONE,
|
||||
SDL_TEXTURESCALEMODE_NONE);
|
||||
}
|
||||
SDL_ClearDirtyRects(&data->dirty);
|
||||
} else {
|
||||
@ -521,15 +521,15 @@ SW_RenderPresent(SDL_Renderer * renderer)
|
||||
rect.w = texture->w;
|
||||
rect.h = texture->h;
|
||||
data->renderer->RenderCopy(data->renderer, texture, &rect, &rect,
|
||||
SDL_TextureBlendMode_None,
|
||||
SDL_TextureScaleMode_None);
|
||||
SDL_TEXTUREBLENDMODE_NONE,
|
||||
SDL_TEXTURESCALEMODE_NONE);
|
||||
}
|
||||
data->renderer->RenderPresent(data->renderer);
|
||||
|
||||
/* Update the flipping chain, if any */
|
||||
if (renderer->info.flags & SDL_Renderer_PresentFlip2) {
|
||||
if (renderer->info.flags & SDL_RENDERER_PRESENTFLIP2) {
|
||||
data->current_texture = (data->current_texture + 1) % 2;
|
||||
} else if (renderer->info.flags & SDL_Renderer_PresentFlip3) {
|
||||
} else if (renderer->info.flags & SDL_RENDERER_PRESENTFLIP3) {
|
||||
data->current_texture = (data->current_texture + 1) % 3;
|
||||
}
|
||||
}
|
||||
|
@ -531,7 +531,7 @@ SDL_GetClosestDisplayMode(const SDL_DisplayMode * mode,
|
||||
|
||||
/* Pick some reasonable defaults if the app and driver don't care */
|
||||
if (!closest->format) {
|
||||
closest->format = SDL_PixelFormat_RGB888;
|
||||
closest->format = SDL_PIXELFORMAT_RGB888;
|
||||
}
|
||||
if (!closest->w) {
|
||||
closest->w = 640;
|
||||
|
@ -975,8 +975,8 @@ SDL_SW_SetupYUVDisplay(SDL_SW_YUVTexture * swdata, Uint32 target_format)
|
||||
|
||||
/* You have chosen wisely... */
|
||||
switch (swdata->texture->format) {
|
||||
case SDL_PixelFormat_YV12:
|
||||
case SDL_PixelFormat_IYUV:
|
||||
case SDL_PIXELFORMAT_YV12:
|
||||
case SDL_PIXELFORMAT_IYUV:
|
||||
if (SDL_BYTESPERPIXEL(target_format) == 2) {
|
||||
#if 0 /*defined(__GNUC__) && defined(__i386__) && SDL_ASSEMBLY_ROUTINES */
|
||||
/* inline assembly functions */
|
||||
@ -1015,9 +1015,9 @@ SDL_SW_SetupYUVDisplay(SDL_SW_YUVTexture * swdata, Uint32 target_format)
|
||||
swdata->Display2X = Color32DitherYV12Mod2X;
|
||||
}
|
||||
break;
|
||||
case SDL_PixelFormat_YUY2:
|
||||
case SDL_PixelFormat_UYVY:
|
||||
case SDL_PixelFormat_YVYU:
|
||||
case SDL_PIXELFORMAT_YUY2:
|
||||
case SDL_PIXELFORMAT_UYVY:
|
||||
case SDL_PIXELFORMAT_YVYU:
|
||||
if (SDL_BYTESPERPIXEL(target_format) == 2) {
|
||||
swdata->Display1X = Color16DitherYUY2Mod1X;
|
||||
swdata->Display2X = Color16DitherYUY2Mod2X;
|
||||
@ -1061,11 +1061,11 @@ SDL_SW_CreateYUVTexture(SDL_Texture * texture)
|
||||
}
|
||||
|
||||
switch (texture->format) {
|
||||
case SDL_PixelFormat_YV12:
|
||||
case SDL_PixelFormat_IYUV:
|
||||
case SDL_PixelFormat_YUY2:
|
||||
case SDL_PixelFormat_UYVY:
|
||||
case SDL_PixelFormat_YVYU:
|
||||
case SDL_PIXELFORMAT_YV12:
|
||||
case SDL_PIXELFORMAT_IYUV:
|
||||
case SDL_PIXELFORMAT_YUY2:
|
||||
case SDL_PIXELFORMAT_UYVY:
|
||||
case SDL_PIXELFORMAT_YVYU:
|
||||
break;
|
||||
default:
|
||||
SDL_SetError("Unsupported YUV format");
|
||||
@ -1073,7 +1073,7 @@ SDL_SW_CreateYUVTexture(SDL_Texture * texture)
|
||||
}
|
||||
|
||||
swdata->texture = texture;
|
||||
swdata->target_format = SDL_PixelFormat_Unknown;
|
||||
swdata->target_format = SDL_PIXELFORMAT_UNKNOWN;
|
||||
swdata->pixels = (Uint8 *) SDL_malloc(texture->w * texture->h * 2);
|
||||
swdata->colortab = (int *) SDL_malloc(4 * 256 * sizeof(int));
|
||||
swdata->rgb_2_pix = (Uint32 *) SDL_malloc(3 * 768 * sizeof(Uint32));
|
||||
@ -1101,8 +1101,8 @@ SDL_SW_CreateYUVTexture(SDL_Texture * texture)
|
||||
|
||||
/* Find the pitch and offset values for the overlay */
|
||||
switch (texture->format) {
|
||||
case SDL_PixelFormat_YV12:
|
||||
case SDL_PixelFormat_IYUV:
|
||||
case SDL_PIXELFORMAT_YV12:
|
||||
case SDL_PIXELFORMAT_IYUV:
|
||||
swdata->pitches[0] = texture->w;
|
||||
swdata->pitches[1] = swdata->pitches[0] / 2;
|
||||
swdata->pitches[2] = swdata->pitches[0] / 2;
|
||||
@ -1112,9 +1112,9 @@ SDL_SW_CreateYUVTexture(SDL_Texture * texture)
|
||||
swdata->planes[2] =
|
||||
swdata->planes[1] + swdata->pitches[1] * texture->h / 2;
|
||||
break;
|
||||
case SDL_PixelFormat_YUY2:
|
||||
case SDL_PixelFormat_UYVY:
|
||||
case SDL_PixelFormat_YVYU:
|
||||
case SDL_PIXELFORMAT_YUY2:
|
||||
case SDL_PIXELFORMAT_UYVY:
|
||||
case SDL_PIXELFORMAT_YVYU:
|
||||
swdata->pitches[0] = texture->w * 2;
|
||||
swdata->planes[0] = swdata->pixels;
|
||||
break;
|
||||
@ -1143,8 +1143,8 @@ SDL_SW_UpdateYUVTexture(SDL_SW_YUVTexture * swdata, const SDL_Rect * rect,
|
||||
SDL_Texture *texture = swdata->texture;
|
||||
|
||||
switch (texture->format) {
|
||||
case SDL_PixelFormat_YV12:
|
||||
case SDL_PixelFormat_IYUV:
|
||||
case SDL_PIXELFORMAT_YV12:
|
||||
case SDL_PIXELFORMAT_IYUV:
|
||||
if (rect
|
||||
&& (rect->x != 0 || rect->y != 0 || rect->w != texture->w
|
||||
|| rect->h != texture->h)) {
|
||||
@ -1154,9 +1154,9 @@ SDL_SW_UpdateYUVTexture(SDL_SW_YUVTexture * swdata, const SDL_Rect * rect,
|
||||
}
|
||||
SDL_memcpy(swdata->pixels, pixels, texture->h * texture->w * 2);
|
||||
break;
|
||||
case SDL_PixelFormat_YUY2:
|
||||
case SDL_PixelFormat_UYVY:
|
||||
case SDL_PixelFormat_YVYU:
|
||||
case SDL_PIXELFORMAT_YUY2:
|
||||
case SDL_PIXELFORMAT_UYVY:
|
||||
case SDL_PIXELFORMAT_YVYU:
|
||||
{
|
||||
Uint8 *src, *dst;
|
||||
int row;
|
||||
@ -1185,8 +1185,8 @@ SDL_SW_LockYUVTexture(SDL_SW_YUVTexture * swdata, const SDL_Rect * rect,
|
||||
SDL_Texture *texture = swdata->texture;
|
||||
|
||||
switch (texture->format) {
|
||||
case SDL_PixelFormat_YV12:
|
||||
case SDL_PixelFormat_IYUV:
|
||||
case SDL_PIXELFORMAT_YV12:
|
||||
case SDL_PIXELFORMAT_IYUV:
|
||||
if (rect
|
||||
&& (rect->x != 0 || rect->y != 0 || rect->w != texture->w
|
||||
|| rect->h != texture->h)) {
|
||||
@ -1277,27 +1277,27 @@ SDL_SW_CopyYUVToRGB(SDL_SW_YUVTexture * swdata, const SDL_Rect * srcrect,
|
||||
pitch = swdata->stretch->pitch;
|
||||
}
|
||||
switch (texture->format) {
|
||||
case SDL_PixelFormat_YV12:
|
||||
case SDL_PIXELFORMAT_YV12:
|
||||
lum = swdata->planes[0];
|
||||
Cr = swdata->planes[1];
|
||||
Cb = swdata->planes[2];
|
||||
break;
|
||||
case SDL_PixelFormat_IYUV:
|
||||
case SDL_PIXELFORMAT_IYUV:
|
||||
lum = swdata->planes[0];
|
||||
Cr = swdata->planes[2];
|
||||
Cb = swdata->planes[1];
|
||||
break;
|
||||
case SDL_PixelFormat_YUY2:
|
||||
case SDL_PIXELFORMAT_YUY2:
|
||||
lum = swdata->planes[0];
|
||||
Cr = lum + 3;
|
||||
Cb = lum + 1;
|
||||
break;
|
||||
case SDL_PixelFormat_UYVY:
|
||||
case SDL_PIXELFORMAT_UYVY:
|
||||
lum = swdata->planes[0] + 1;
|
||||
Cr = lum + 1;
|
||||
Cb = lum - 1;
|
||||
break;
|
||||
case SDL_PixelFormat_YVYU:
|
||||
case SDL_PIXELFORMAT_YVYU:
|
||||
lum = swdata->planes[0];
|
||||
Cr = lum + 1;
|
||||
Cb = lum + 3;
|
||||
|
@ -80,25 +80,25 @@ SDL_RenderDriver SDL_DUMMY_RenderDriver = {
|
||||
SDL_DUMMY_CreateRenderer,
|
||||
{
|
||||
"dummy",
|
||||
(SDL_Renderer_SingleBuffer | SDL_Renderer_PresentCopy |
|
||||
SDL_Renderer_PresentFlip2 | SDL_Renderer_PresentFlip3 |
|
||||
SDL_Renderer_PresentDiscard),
|
||||
(SDL_TextureBlendMode_None | SDL_TextureBlendMode_Mask |
|
||||
SDL_TextureBlendMode_Blend),
|
||||
(SDL_TextureScaleMode_None | SDL_TextureScaleMode_Fast),
|
||||
(SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTCOPY |
|
||||
SDL_RENDERER_PRESENTFLIP2 | SDL_RENDERER_PRESENTFLIP3 |
|
||||
SDL_RENDERER_PRESENTDISCARD),
|
||||
(SDL_TEXTUREBLENDMODE_NONE | SDL_TEXTUREBLENDMODE_MASK |
|
||||
SDL_TEXTUREBLENDMODE_BLEND),
|
||||
(SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_FAST),
|
||||
11,
|
||||
{
|
||||
SDL_PixelFormat_Index8,
|
||||
SDL_PixelFormat_RGB555,
|
||||
SDL_PixelFormat_RGB565,
|
||||
SDL_PixelFormat_RGB888,
|
||||
SDL_PixelFormat_BGR888,
|
||||
SDL_PixelFormat_ARGB8888,
|
||||
SDL_PixelFormat_RGBA8888,
|
||||
SDL_PixelFormat_ABGR8888,
|
||||
SDL_PixelFormat_BGRA8888,
|
||||
SDL_PixelFormat_YUY2,
|
||||
SDL_PixelFormat_UYVY},
|
||||
SDL_PIXELFORMAT_INDEX8,
|
||||
SDL_PIXELFORMAT_RGB555,
|
||||
SDL_PIXELFORMAT_RGB565,
|
||||
SDL_PIXELFORMAT_RGB888,
|
||||
SDL_PIXELFORMAT_BGR888,
|
||||
SDL_PIXELFORMAT_ARGB8888,
|
||||
SDL_PIXELFORMAT_RGBA8888,
|
||||
SDL_PIXELFORMAT_ABGR8888,
|
||||
SDL_PIXELFORMAT_BGRA8888,
|
||||
SDL_PIXELFORMAT_YUY2,
|
||||
SDL_PIXELFORMAT_UYVY},
|
||||
0,
|
||||
0}
|
||||
};
|
||||
@ -159,14 +159,14 @@ SDL_DUMMY_CreateRenderer(SDL_Window * window, Uint32 flags)
|
||||
|
||||
renderer->info.flags = 0;
|
||||
|
||||
if (flags & SDL_Renderer_PresentFlip2) {
|
||||
renderer->info.flags |= SDL_Renderer_PresentFlip2;
|
||||
if (flags & SDL_RENDERER_PRESENTFLIP2) {
|
||||
renderer->info.flags |= SDL_RENDERER_PRESENTFLIP2;
|
||||
n = 2;
|
||||
} else if (flags & SDL_Renderer_PresentFlip3) {
|
||||
renderer->info.flags |= SDL_Renderer_PresentFlip3;
|
||||
} else if (flags & SDL_RENDERER_PRESENTFLIP3) {
|
||||
renderer->info.flags |= SDL_RENDERER_PRESENTFLIP3;
|
||||
n = 3;
|
||||
} else {
|
||||
renderer->info.flags |= SDL_Renderer_PresentCopy;
|
||||
renderer->info.flags |= SDL_RENDERER_PRESENTCOPY;
|
||||
n = 1;
|
||||
}
|
||||
for (i = 0; i < n; ++i) {
|
||||
@ -364,12 +364,12 @@ SDL_DUMMY_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
|
||||
SDL_Rect real_dstrect = *dstrect;
|
||||
|
||||
if (blendMode &
|
||||
(SDL_TextureBlendMode_Mask | SDL_TextureBlendMode_Blend)) {
|
||||
(SDL_TEXTUREBLENDMODE_MASK | SDL_TEXTUREBLENDMODE_BLEND)) {
|
||||
SDL_SetAlpha(surface, SDL_SRCALPHA, 0);
|
||||
} else {
|
||||
SDL_SetAlpha(surface, 0, 0);
|
||||
}
|
||||
if (scaleMode != SDL_TextureScaleMode_None &&
|
||||
if (scaleMode != SDL_TEXTURESCALEMODE_NONE &&
|
||||
(srcrect->w != dstrect->w || srcrect->h != dstrect->h)) {
|
||||
return SDL_SoftStretch(surface, &real_srcrect, target,
|
||||
&real_dstrect);
|
||||
@ -396,9 +396,9 @@ SDL_DUMMY_RenderPresent(SDL_Renderer * renderer)
|
||||
}
|
||||
|
||||
/* Update the flipping chain, if any */
|
||||
if (renderer->info.flags & SDL_Renderer_PresentFlip2) {
|
||||
if (renderer->info.flags & SDL_RENDERER_PRESENTFLIP2) {
|
||||
data->current_screen = (data->current_screen + 1) % 2;
|
||||
} else if (renderer->info.flags & SDL_Renderer_PresentFlip3) {
|
||||
} else if (renderer->info.flags & SDL_RENDERER_PRESENTFLIP3) {
|
||||
data->current_screen = (data->current_screen + 1) % 3;
|
||||
}
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ DUMMY_VideoInit(_THIS)
|
||||
SDL_DisplayMode mode;
|
||||
|
||||
/* Use a fake 32-bpp desktop mode */
|
||||
mode.format = SDL_PixelFormat_RGB888;
|
||||
mode.format = SDL_PIXELFORMAT_RGB888;
|
||||
mode.w = 1024;
|
||||
mode.h = 768;
|
||||
mode.refresh_rate = 0;
|
||||
|
@ -60,29 +60,29 @@ SDL_RenderDriver D3D_RenderDriver = {
|
||||
D3D_CreateRenderer,
|
||||
{
|
||||
"d3d",
|
||||
(SDL_Renderer_SingleBuffer | SDL_Renderer_PresentCopy |
|
||||
SDL_Renderer_PresentFlip2 | SDL_Renderer_PresentFlip3 |
|
||||
SDL_Renderer_PresentDiscard | SDL_Renderer_PresentVSync |
|
||||
SDL_Renderer_Accelerated),
|
||||
(SDL_TextureBlendMode_None | SDL_TextureBlendMode_Mask |
|
||||
SDL_TextureBlendMode_Blend | SDL_TextureBlendMode_Add |
|
||||
SDL_TextureBlendMode_Mod),
|
||||
(SDL_TextureScaleMode_None | SDL_TextureScaleMode_Fast |
|
||||
SDL_TextureScaleMode_Slow | SDL_TextureScaleMode_Best),
|
||||
(SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTCOPY |
|
||||
SDL_RENDERER_PRESENTFLIP2 | sDL_RENDERER_PRESENTFLIP3 |
|
||||
SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_PRESENTVSYNC |
|
||||
SDL_RENDERER_ACCELERATED),
|
||||
(SDL_TEXTUREBLENDMODE_NONE | SDL_TEXTUREBLENDMODE_MASK |
|
||||
SDL_TEXTUREBLENDMODE_BLEND | SDL_TEXTUREBLENDMODE_ADD |
|
||||
SDL_TEXTUREBLENDMODE_MOD),
|
||||
(SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_FAST |
|
||||
SDL_TEXTURESCALEMODE_SLOW | SDL_TEXTURESCALEMODE_BEST),
|
||||
12,
|
||||
{
|
||||
SDL_PixelFormat_Index8,
|
||||
SDL_PixelFormat_RGB332,
|
||||
SDL_PixelFormat_RGB444,
|
||||
SDL_PixelFormat_RGB555,
|
||||
SDL_PixelFormat_ARGB4444,
|
||||
SDL_PixelFormat_ARGB1555,
|
||||
SDL_PixelFormat_RGB565,
|
||||
SDL_PixelFormat_RGB888,
|
||||
SDL_PixelFormat_ARGB8888,
|
||||
SDL_PixelFormat_ARGB2101010,
|
||||
SDL_PixelFormat_UYVY,
|
||||
SDL_PixelFormat_YUY2},
|
||||
SDL_PIXELFORMAT_INDEX8,
|
||||
SDL_PIXELFORMAT_RGB332,
|
||||
SDL_PIXELFORMAT_RGB444,
|
||||
SDL_PIXELFORMAT_RGB555,
|
||||
SDL_PIXELFORMAT_ARGB4444,
|
||||
SDL_PIXELFORMAT_ARGB1555,
|
||||
SDL_PIXELFORMAT_RGB565,
|
||||
SDL_PIXELFORMAT_RGB888,
|
||||
SDL_PIXELFORMAT_ARGB8888,
|
||||
SDL_PIXELFORMAT_ARGB2101010,
|
||||
SDL_PIXELFORMAT_UYVY,
|
||||
SDL_PIXELFORMAT_YUY2},
|
||||
0,
|
||||
0}
|
||||
};
|
||||
@ -188,29 +188,29 @@ static D3DFORMAT
|
||||
PixelFormatToD3DFMT(Uint32 format)
|
||||
{
|
||||
switch (format) {
|
||||
case SDL_PixelFormat_Index8:
|
||||
case SDL_PIXELFORMAT_INDEX8:
|
||||
return D3DFMT_P8;
|
||||
case SDL_PixelFormat_RGB332:
|
||||
case SDL_PIXELFORMAT_RGB332:
|
||||
return D3DFMT_R3G3B2;
|
||||
case SDL_PixelFormat_RGB444:
|
||||
case SDL_PIXELFORMAT_RGB444:
|
||||
return D3DFMT_X4R4G4B4;
|
||||
case SDL_PixelFormat_RGB555:
|
||||
case SDL_PIXELFORMAT_RGB555:
|
||||
return D3DFMT_X1R5G5B5;
|
||||
case SDL_PixelFormat_ARGB4444:
|
||||
case SDL_PIXELFORMAT_ARGB4444:
|
||||
return D3DFMT_A4R4G4B4;
|
||||
case SDL_PixelFormat_ARGB1555:
|
||||
case SDL_PIXELFORMAT_ARGB1555:
|
||||
return D3DFMT_A1R5G5B5;
|
||||
case SDL_PixelFormat_RGB565:
|
||||
case SDL_PIXELFORMAT_RGB565:
|
||||
return D3DFMT_R5G6B5;
|
||||
case SDL_PixelFormat_RGB888:
|
||||
case SDL_PIXELFORMAT_RGB888:
|
||||
return D3DFMT_X8R8G8B8;
|
||||
case SDL_PixelFormat_ARGB8888:
|
||||
case SDL_PIXELFORMAT_ARGB8888:
|
||||
return D3DFMT_A8R8G8B8;
|
||||
case SDL_PixelFormat_ARGB2101010:
|
||||
case SDL_PIXELFORMAT_ARGB2101010:
|
||||
return D3DFMT_A2R10G10B10;
|
||||
case SDL_PixelFormat_UYVY:
|
||||
case SDL_PIXELFORMAT_UYVY:
|
||||
return D3DFMT_UYVY;
|
||||
case SDL_PixelFormat_YUY2:
|
||||
case SDL_PIXELFORMAT_YUY2:
|
||||
return D3DFMT_YUY2;
|
||||
default:
|
||||
return D3DFMT_UNKNOWN;
|
||||
@ -269,7 +269,7 @@ D3D_CreateRenderer(SDL_Window * window, Uint32 flags)
|
||||
renderer->window = window->id;
|
||||
renderer->driverdata = data;
|
||||
|
||||
renderer->info.flags = SDL_Renderer_Accelerated;
|
||||
renderer->info.flags = SDL_RENDERER_ACCELERATED;
|
||||
|
||||
SDL_zero(pparams);
|
||||
pparams.BackBufferWidth = window->w;
|
||||
@ -280,13 +280,13 @@ D3D_CreateRenderer(SDL_Window * window, Uint32 flags)
|
||||
} else {
|
||||
pparams.BackBufferFormat = D3DFMT_UNKNOWN;
|
||||
}
|
||||
if (flags & SDL_Renderer_PresentFlip2) {
|
||||
if (flags & SDL_RENDERER_PRESENTFLIP2) {
|
||||
pparams.BackBufferCount = 2;
|
||||
pparams.SwapEffect = D3DSWAPEFFECT_FLIP;
|
||||
} else if (flags & SDL_Renderer_PresentFlip3) {
|
||||
} else if (flags & SDL_RENDERER_PRESENTFLIP3) {
|
||||
pparams.BackBufferCount = 3;
|
||||
pparams.SwapEffect = D3DSWAPEFFECT_FLIP;
|
||||
} else if (flags & SDL_Renderer_PresentCopy) {
|
||||
} else if (flags & SDL_RENDERER_PRESENTCOPY) {
|
||||
pparams.BackBufferCount = 1;
|
||||
pparams.SwapEffect = D3DSWAPEFFECT_COPY;
|
||||
} else {
|
||||
@ -301,7 +301,7 @@ D3D_CreateRenderer(SDL_Window * window, Uint32 flags)
|
||||
pparams.Windowed = TRUE;
|
||||
pparams.FullScreen_RefreshRateInHz = 0;
|
||||
}
|
||||
if (flags & SDL_Renderer_PresentVSync) {
|
||||
if (flags & SDL_RENDERER_PRESENTVSYNC) {
|
||||
pparams.PresentationInterval = D3DPRESENT_INTERVAL_ONE;
|
||||
} else {
|
||||
pparams.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
|
||||
@ -336,24 +336,24 @@ D3D_CreateRenderer(SDL_Window * window, Uint32 flags)
|
||||
IDirect3DSwapChain9_Release(chain);
|
||||
switch (pparams.SwapEffect) {
|
||||
case D3DSWAPEFFECT_COPY:
|
||||
renderer->info.flags |= SDL_Renderer_PresentCopy;
|
||||
renderer->info.flags |= SDL_RENDERER_PRESENTCOPY;
|
||||
break;
|
||||
case D3DSWAPEFFECT_FLIP:
|
||||
switch (pparams.BackBufferCount) {
|
||||
case 2:
|
||||
renderer->info.flags |= SDL_Renderer_PresentFlip2;
|
||||
renderer->info.flags |= SDL_RENDERER_PRESENTFLIP2;
|
||||
break;
|
||||
case 3:
|
||||
renderer->info.flags |= SDL_Renderer_PresentFlip3;
|
||||
renderer->info.flags |= SDL_RENDERER_PRESENTFLIP3;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case D3DSWAPEFFECT_DISCARD:
|
||||
renderer->info.flags |= SDL_Renderer_PresentDiscard;
|
||||
renderer->info.flags |= SDL_RENDERER_PRESENTDISCARD;
|
||||
break;
|
||||
}
|
||||
if (pparams.PresentationInterval == D3DPRESENT_INTERVAL_ONE) {
|
||||
renderer->info.flags |= SDL_Renderer_PresentVSync;
|
||||
renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC;
|
||||
}
|
||||
|
||||
IDirect3DDevice9_GetDeviceCaps(data->device, &caps);
|
||||
@ -388,7 +388,7 @@ D3D_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
|
||||
|
||||
texture->driverdata = data;
|
||||
|
||||
if (texture->access == SDL_TextureAccess_Local) {
|
||||
if (texture->access == SDL_TEXTUREACCESS_LOCAL) {
|
||||
pool = D3DPOOL_MANAGED;
|
||||
} else {
|
||||
pool = D3DPOOL_DEFAULT;
|
||||
@ -494,7 +494,7 @@ D3D_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
|
||||
D3DLOCKED_RECT locked;
|
||||
HRESULT result;
|
||||
|
||||
if (texture->access != SDL_TextureAccess_Local) {
|
||||
if (texture->access != SDL_TEXTUREACCESS_LOCAL) {
|
||||
SDL_SetError("Can't lock remote video memory");
|
||||
return -1;
|
||||
}
|
||||
@ -627,12 +627,12 @@ D3D_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
|
||||
vertices[3].v = maxv;
|
||||
|
||||
switch (blendMode) {
|
||||
case SDL_TextureBlendMode_None:
|
||||
case SDL_TEXTUREBLENDMODE_NONE:
|
||||
IDirect3DDevice9_SetRenderState(data->device, D3DRS_ALPHABLENDENABLE,
|
||||
FALSE);
|
||||
break;
|
||||
case SDL_TextureBlendMode_Mask:
|
||||
case SDL_TextureBlendMode_Blend:
|
||||
case SDL_TEXTUREBLENDMODE_MASK:
|
||||
case SDL_TEXTUREBLENDMODE_BLEND:
|
||||
IDirect3DDevice9_SetRenderState(data->device, D3DRS_ALPHABLENDENABLE,
|
||||
TRUE);
|
||||
IDirect3DDevice9_SetRenderState(data->device, D3DRS_SRCBLEND,
|
||||
@ -640,7 +640,7 @@ D3D_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
|
||||
IDirect3DDevice9_SetRenderState(data->device, D3DRS_DESTBLEND,
|
||||
D3DBLEND_INVSRCALPHA);
|
||||
break;
|
||||
case SDL_TextureBlendMode_Add:
|
||||
case SDL_TEXTUREBLENDMODE_ADD:
|
||||
IDirect3DDevice9_SetRenderState(data->device, D3DRS_ALPHABLENDENABLE,
|
||||
TRUE);
|
||||
IDirect3DDevice9_SetRenderState(data->device, D3DRS_SRCBLEND,
|
||||
@ -648,7 +648,7 @@ D3D_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
|
||||
IDirect3DDevice9_SetRenderState(data->device, D3DRS_DESTBLEND,
|
||||
D3DBLEND_ONE);
|
||||
break;
|
||||
case SDL_TextureBlendMode_Mod:
|
||||
case SDL_TEXTUREBLENDMODE_MOD:
|
||||
IDirect3DDevice9_SetRenderState(data->device, D3DRS_ALPHABLENDENABLE,
|
||||
TRUE);
|
||||
IDirect3DDevice9_SetRenderState(data->device, D3DRS_SRCBLEND,
|
||||
@ -659,20 +659,20 @@ D3D_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
|
||||
}
|
||||
|
||||
switch (scaleMode) {
|
||||
case SDL_TextureScaleMode_None:
|
||||
case SDL_TextureScaleMode_Fast:
|
||||
case SDL_TEXTURESCALEMODE_NONE:
|
||||
case SDL_TEXTURESCALEMODE_FAST:
|
||||
IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MINFILTER,
|
||||
D3DTEXF_POINT);
|
||||
IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MAGFILTER,
|
||||
D3DTEXF_POINT);
|
||||
break;
|
||||
case SDL_TextureScaleMode_Slow:
|
||||
case SDL_TEXTURESCALEMODE_SLOW:
|
||||
IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MINFILTER,
|
||||
D3DTEXF_LINEAR);
|
||||
IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MAGFILTER,
|
||||
D3DTEXF_LINEAR);
|
||||
break;
|
||||
case SDL_TextureScaleMode_Best:
|
||||
case SDL_TEXTURESCALEMODE_BEST:
|
||||
IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MINFILTER,
|
||||
D3DTEXF_GAUSSIANQUAD);
|
||||
IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MAGFILTER,
|
||||
|
@ -65,25 +65,25 @@ SDL_RenderDriver GDI_RenderDriver = {
|
||||
GDI_CreateRenderer,
|
||||
{
|
||||
"gdi",
|
||||
(SDL_Renderer_SingleBuffer | SDL_Renderer_PresentCopy |
|
||||
SDL_Renderer_PresentFlip2 | SDL_Renderer_PresentFlip3 |
|
||||
SDL_Renderer_PresentDiscard | SDL_Renderer_Accelerated),
|
||||
(SDL_TextureBlendMode_None | SDL_TextureBlendMode_Mask |
|
||||
SDL_TextureBlendMode_Blend),
|
||||
(SDL_TextureScaleMode_None | SDL_TextureScaleMode_Fast),
|
||||
(SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTCOPY |
|
||||
SDL_RENDERER_PRESENTFLIP2 | sDL_RENDERER_PRESENTFLIP3 |
|
||||
SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_ACCELERATED),
|
||||
(SDL_TEXTUREBLENDMODE_NONE | SDL_TEXTUREBLENDMODE_MASK |
|
||||
SDL_TEXTUREBLENDMODE_BLEND),
|
||||
(SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_FAST),
|
||||
11,
|
||||
{
|
||||
SDL_PixelFormat_Index8,
|
||||
SDL_PixelFormat_RGB555,
|
||||
SDL_PixelFormat_RGB565,
|
||||
SDL_PixelFormat_RGB888,
|
||||
SDL_PixelFormat_BGR888,
|
||||
SDL_PixelFormat_ARGB8888,
|
||||
SDL_PixelFormat_RGBA8888,
|
||||
SDL_PixelFormat_ABGR8888,
|
||||
SDL_PixelFormat_BGRA8888,
|
||||
SDL_PixelFormat_YUY2,
|
||||
SDL_PixelFormat_UYVY},
|
||||
SDL_PIXELFORMAT_INDEX8,
|
||||
SDL_PIXELFORMAT_RGB555,
|
||||
SDL_PIXELFORMAT_RGB565,
|
||||
SDL_PIXELFORMAT_RGB888,
|
||||
SDL_PIXELFORMAT_BGR888,
|
||||
SDL_PIXELFORMAT_ARGB8888,
|
||||
SDL_PIXELFORMAT_RGBA8888,
|
||||
SDL_PIXELFORMAT_ABGR8888,
|
||||
SDL_PIXELFORMAT_BGRA8888,
|
||||
SDL_PIXELFORMAT_YUY2,
|
||||
SDL_PIXELFORMAT_UYVY},
|
||||
0,
|
||||
0}
|
||||
};
|
||||
@ -172,7 +172,7 @@ GDI_CreateRenderer(SDL_Window * window, Uint32 flags)
|
||||
renderer->window = window->id;
|
||||
renderer->driverdata = data;
|
||||
|
||||
renderer->info.flags = SDL_Renderer_Accelerated;
|
||||
renderer->info.flags = SDL_RENDERER_ACCELERATED;
|
||||
|
||||
data->hwnd = windowdata->hwnd;
|
||||
data->window_hdc = windowdata->hdc;
|
||||
@ -194,18 +194,18 @@ GDI_CreateRenderer(SDL_Window * window, Uint32 flags)
|
||||
GetDIBits(data->window_hdc, hbm, 0, 1, NULL, data->bmi, DIB_RGB_COLORS);
|
||||
DeleteObject(hbm);
|
||||
|
||||
if (flags & SDL_Renderer_SingleBuffer) {
|
||||
if (flags & SDL_RENDERER_SINGLEBUFFER) {
|
||||
renderer->info.flags |=
|
||||
(SDL_Renderer_SingleBuffer | SDL_Renderer_PresentCopy);
|
||||
(SDL_RENDERER_SINGLEBUFFER | sDL_RENDERER_PRESENTCOPY);
|
||||
n = 0;
|
||||
} else if (flags & SDL_Renderer_PresentFlip2) {
|
||||
renderer->info.flags |= SDL_Renderer_PresentFlip2;
|
||||
} else if (flags & SDL_RENDERER_PRESENTFLIP2) {
|
||||
renderer->info.flags |= SDL_RENDERER_PRESENTFLIP2;
|
||||
n = 2;
|
||||
} else if (flags & SDL_Renderer_PresentFlip3) {
|
||||
renderer->info.flags |= SDL_Renderer_PresentFlip3;
|
||||
} else if (flags & SDL_RENDERER_PRESENTFLIP3) {
|
||||
renderer->info.flags |= SDL_RENDERER_PRESENTFLIP3;
|
||||
n = 3;
|
||||
} else {
|
||||
renderer->info.flags |= SDL_Renderer_PresentCopy;
|
||||
renderer->info.flags |= SDL_RENDERER_PRESENTCOPY;
|
||||
n = 1;
|
||||
}
|
||||
for (i = 0; i < n; ++i) {
|
||||
@ -257,7 +257,7 @@ GDI_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
|
||||
}
|
||||
data->pitch = (texture->w * SDL_BYTESPERPIXEL(data->format));
|
||||
|
||||
if (data->yuv || texture->access == SDL_TextureAccess_Local
|
||||
if (data->yuv || texture->access == SDL_TEXTUREACCESS_LOCAL
|
||||
|| texture->format != SDL_GetCurrentDisplayMode()->format) {
|
||||
int bmi_size;
|
||||
LPBITMAPINFO bmi;
|
||||
@ -537,7 +537,7 @@ GDI_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
|
||||
SelectPalette(data->memory_hdc, texturedata->hpal, TRUE);
|
||||
RealizePalette(data->memory_hdc);
|
||||
}
|
||||
if (blendMode & (SDL_TextureBlendMode_Mask | SDL_TextureBlendMode_Blend)) {
|
||||
if (blendMode & (SDL_TEXTUREBLENDMODE_MASK | SDL_TEXTUREBLENDMODE_BLEND)) {
|
||||
static BLENDFUNCTION blendFunc = {
|
||||
AC_SRC_OVER,
|
||||
0,
|
||||
@ -581,7 +581,7 @@ GDI_RenderPresent(SDL_Renderer * renderer)
|
||||
SDL_DirtyRect *dirty;
|
||||
|
||||
/* Send the data to the display */
|
||||
if (!(renderer->info.flags & SDL_Renderer_SingleBuffer)) {
|
||||
if (!(renderer->info.flags & SDL_RENDERER_SINGLEBUFFER)) {
|
||||
for (dirty = data->dirty.list; dirty; dirty = dirty->next) {
|
||||
const SDL_Rect *rect = &dirty->rect;
|
||||
BitBlt(data->window_hdc, rect->x, rect->y, rect->w, rect->h,
|
||||
@ -591,10 +591,10 @@ GDI_RenderPresent(SDL_Renderer * renderer)
|
||||
}
|
||||
|
||||
/* Update the flipping chain, if any */
|
||||
if (renderer->info.flags & SDL_Renderer_PresentFlip2) {
|
||||
if (renderer->info.flags & SDL_RENDERER_PRESENTFLIP2) {
|
||||
data->current_hbm = (data->current_hbm + 1) % 2;
|
||||
SelectObject(data->render_hdc, data->hbm[data->current_hbm]);
|
||||
} else if (renderer->info.flags & SDL_Renderer_PresentFlip3) {
|
||||
} else if (renderer->info.flags & SDL_RENDERER_PRESENTFLIP3) {
|
||||
data->current_hbm = (data->current_hbm + 1) % 3;
|
||||
SelectObject(data->render_hdc, data->hbm[data->current_hbm]);
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ WIN_GetDisplayMode(LPCTSTR deviceName, DWORD index, SDL_DisplayMode * mode)
|
||||
DM_DISPLAYFLAGS);
|
||||
|
||||
/* Fill in the mode information */
|
||||
mode->format = SDL_PixelFormat_Unknown;
|
||||
mode->format = SDL_PIXELFORMAT_UNKNOWN;
|
||||
mode->w = devmode.dmPelsWidth;
|
||||
mode->h = devmode.dmPelsHeight;
|
||||
mode->refresh_rate = devmode.dmDisplayFrequency;
|
||||
@ -72,38 +72,38 @@ WIN_GetDisplayMode(LPCTSTR deviceName, DWORD index, SDL_DisplayMode * mode)
|
||||
if (bmi->bmiHeader.biCompression == BI_BITFIELDS) {
|
||||
switch (*(Uint32 *) bmi->bmiColors) {
|
||||
case 0x00FF0000:
|
||||
mode->format = SDL_PixelFormat_RGB888;
|
||||
mode->format = SDL_PIXELFORMAT_RGB888;
|
||||
break;
|
||||
case 0x000000FF:
|
||||
mode->format = SDL_PixelFormat_BGR888;
|
||||
mode->format = SDL_PIXELFORMAT_BGR888;
|
||||
break;
|
||||
case 0xF800:
|
||||
mode->format = SDL_PixelFormat_RGB565;
|
||||
mode->format = SDL_PIXELFORMAT_RGB565;
|
||||
break;
|
||||
case 0x7C00:
|
||||
mode->format = SDL_PixelFormat_RGB555;
|
||||
mode->format = SDL_PIXELFORMAT_RGB555;
|
||||
break;
|
||||
}
|
||||
} else if (bmi->bmiHeader.biBitCount == 8) {
|
||||
mode->format = SDL_PixelFormat_Index8;
|
||||
mode->format = SDL_PIXELFORMAT_INDEX8;
|
||||
}
|
||||
} else {
|
||||
/* FIXME: Can we tell what this will be? */
|
||||
switch (devmode.dmBitsPerPel) {
|
||||
case 32:
|
||||
mode->format = SDL_PixelFormat_RGB888;
|
||||
mode->format = SDL_PIXELFORMAT_RGB888;
|
||||
break;
|
||||
case 24:
|
||||
mode->format = SDL_PixelFormat_RGB24;
|
||||
mode->format = SDL_PIXELFORMAT_RGB24;
|
||||
break;
|
||||
case 16:
|
||||
mode->format = SDL_PixelFormat_RGB565;
|
||||
mode->format = SDL_PIXELFORMAT_RGB565;
|
||||
break;
|
||||
case 15:
|
||||
mode->format = SDL_PixelFormat_RGB555;
|
||||
mode->format = SDL_PIXELFORMAT_RGB555;
|
||||
break;
|
||||
case 8:
|
||||
mode->format = SDL_PixelFormat_Index8;
|
||||
mode->format = SDL_PIXELFORMAT_INDEX8;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -170,7 +170,7 @@ CommonArg(CommonState * state, int index)
|
||||
return 2;
|
||||
}
|
||||
if (SDL_strcasecmp(argv[index], "--vsync") == 0) {
|
||||
state->render_flags |= SDL_Renderer_PresentVSync;
|
||||
state->render_flags |= SDL_RENDERER_PRESENTVSYNC;
|
||||
return 1;
|
||||
}
|
||||
if (SDL_strcasecmp(argv[index], "--noframe") == 0) {
|
||||
@ -283,25 +283,25 @@ static void
|
||||
PrintRendererFlag(Uint32 flag)
|
||||
{
|
||||
switch (flag) {
|
||||
case SDL_Renderer_SingleBuffer:
|
||||
case SDL_RENDERER_SINGLEBUFFER:
|
||||
fprintf(stderr, "SingleBuffer");
|
||||
break;
|
||||
case SDL_Renderer_PresentCopy:
|
||||
case SDL_RENDERER_PRESENTCOPY:
|
||||
fprintf(stderr, "PresentCopy");
|
||||
break;
|
||||
case SDL_Renderer_PresentFlip2:
|
||||
case SDL_RENDERER_PRESENTFLIP2:
|
||||
fprintf(stderr, "PresentFlip2");
|
||||
break;
|
||||
case SDL_Renderer_PresentFlip3:
|
||||
case SDL_RENDERER_PRESENTFLIP3:
|
||||
fprintf(stderr, "PresentFlip3");
|
||||
break;
|
||||
case SDL_Renderer_PresentDiscard:
|
||||
case SDL_RENDERER_PRESENTDISCARD:
|
||||
fprintf(stderr, "PresentDiscard");
|
||||
break;
|
||||
case SDL_Renderer_PresentVSync:
|
||||
case SDL_RENDERER_PRESENTVSYNC:
|
||||
fprintf(stderr, "PresentVSync");
|
||||
break;
|
||||
case SDL_Renderer_Accelerated:
|
||||
case SDL_RENDERER_ACCELERATED:
|
||||
fprintf(stderr, "Accelerated");
|
||||
break;
|
||||
default:
|
||||
@ -314,19 +314,19 @@ static void
|
||||
PrintBlendMode(Uint32 flag)
|
||||
{
|
||||
switch (flag) {
|
||||
case SDL_TextureBlendMode_None:
|
||||
case SDL_TEXTUREBLENDMODE_NONE:
|
||||
fprintf(stderr, "None");
|
||||
break;
|
||||
case SDL_TextureBlendMode_Mask:
|
||||
case SDL_TEXTUREBLENDMODE_MASK:
|
||||
fprintf(stderr, "Mask");
|
||||
break;
|
||||
case SDL_TextureBlendMode_Blend:
|
||||
case SDL_TEXTUREBLENDMODE_BLEND:
|
||||
fprintf(stderr, "Blend");
|
||||
break;
|
||||
case SDL_TextureBlendMode_Add:
|
||||
case SDL_TEXTUREBLENDMODE_ADD:
|
||||
fprintf(stderr, "Add");
|
||||
break;
|
||||
case SDL_TextureBlendMode_Mod:
|
||||
case SDL_TEXTUREBLENDMODE_MOD:
|
||||
fprintf(stderr, "Mod");
|
||||
break;
|
||||
default:
|
||||
@ -339,16 +339,16 @@ static void
|
||||
PrintScaleMode(Uint32 flag)
|
||||
{
|
||||
switch (flag) {
|
||||
case SDL_TextureScaleMode_None:
|
||||
case SDL_TEXTURESCALEMODE_NONE:
|
||||
fprintf(stderr, "None");
|
||||
break;
|
||||
case SDL_TextureScaleMode_Fast:
|
||||
case SDL_TEXTURESCALEMODE_FAST:
|
||||
fprintf(stderr, "Fast");
|
||||
break;
|
||||
case SDL_TextureScaleMode_Slow:
|
||||
case SDL_TEXTURESCALEMODE_SLOW:
|
||||
fprintf(stderr, "Slow");
|
||||
break;
|
||||
case SDL_TextureScaleMode_Best:
|
||||
case SDL_TEXTURESCALEMODE_BEST:
|
||||
fprintf(stderr, "Best");
|
||||
break;
|
||||
default:
|
||||
@ -361,82 +361,82 @@ static void
|
||||
PrintPixelFormat(Uint32 format)
|
||||
{
|
||||
switch (format) {
|
||||
case SDL_PixelFormat_Unknown:
|
||||
case SDL_PIXELFORMAT_UNKNOWN:
|
||||
fprintf(stderr, "Unknwon");
|
||||
break;
|
||||
case SDL_PixelFormat_Index1LSB:
|
||||
case SDL_PIXELFORMAT_INDEX1LSB:
|
||||
fprintf(stderr, "Index1LSB");
|
||||
break;
|
||||
case SDL_PixelFormat_Index1MSB:
|
||||
case SDL_PIXELFORMAT_INDEX1MSB:
|
||||
fprintf(stderr, "Index1MSB");
|
||||
break;
|
||||
case SDL_PixelFormat_Index4LSB:
|
||||
case SDL_PIXELFORMAT_INDEX4LSB:
|
||||
fprintf(stderr, "Index4LSB");
|
||||
break;
|
||||
case SDL_PixelFormat_Index4MSB:
|
||||
case SDL_PIXELFORMAT_INDEX4MSB:
|
||||
fprintf(stderr, "Index4MSB");
|
||||
break;
|
||||
case SDL_PixelFormat_Index8:
|
||||
case SDL_PIXELFORMAT_INDEX8:
|
||||
fprintf(stderr, "Index8");
|
||||
break;
|
||||
case SDL_PixelFormat_RGB332:
|
||||
case SDL_PIXELFORMAT_RGB332:
|
||||
fprintf(stderr, "RGB332");
|
||||
break;
|
||||
case SDL_PixelFormat_RGB444:
|
||||
case SDL_PIXELFORMAT_RGB444:
|
||||
fprintf(stderr, "RGB444");
|
||||
break;
|
||||
case SDL_PixelFormat_RGB555:
|
||||
case SDL_PIXELFORMAT_RGB555:
|
||||
fprintf(stderr, "RGB555");
|
||||
break;
|
||||
case SDL_PixelFormat_ARGB4444:
|
||||
case SDL_PIXELFORMAT_ARGB4444:
|
||||
fprintf(stderr, "ARGB4444");
|
||||
break;
|
||||
case SDL_PixelFormat_ARGB1555:
|
||||
case SDL_PIXELFORMAT_ARGB1555:
|
||||
fprintf(stderr, "ARGB1555");
|
||||
break;
|
||||
case SDL_PixelFormat_RGB565:
|
||||
case SDL_PIXELFORMAT_RGB565:
|
||||
fprintf(stderr, "RGB565");
|
||||
break;
|
||||
case SDL_PixelFormat_RGB24:
|
||||
case SDL_PIXELFORMAT_RGB24:
|
||||
fprintf(stderr, "RGB24");
|
||||
break;
|
||||
case SDL_PixelFormat_BGR24:
|
||||
case SDL_PIXELFORMAT_BGR24:
|
||||
fprintf(stderr, "BGR24");
|
||||
break;
|
||||
case SDL_PixelFormat_RGB888:
|
||||
case SDL_PIXELFORMAT_RGB888:
|
||||
fprintf(stderr, "RGB888");
|
||||
break;
|
||||
case SDL_PixelFormat_BGR888:
|
||||
case SDL_PIXELFORMAT_BGR888:
|
||||
fprintf(stderr, "BGR888");
|
||||
break;
|
||||
case SDL_PixelFormat_ARGB8888:
|
||||
case SDL_PIXELFORMAT_ARGB8888:
|
||||
fprintf(stderr, "ARGB8888");
|
||||
break;
|
||||
case SDL_PixelFormat_RGBA8888:
|
||||
case SDL_PIXELFORMAT_RGBA8888:
|
||||
fprintf(stderr, "RGBA8888");
|
||||
break;
|
||||
case SDL_PixelFormat_ABGR8888:
|
||||
case SDL_PIXELFORMAT_ABGR8888:
|
||||
fprintf(stderr, "ABGR8888");
|
||||
break;
|
||||
case SDL_PixelFormat_BGRA8888:
|
||||
case SDL_PIXELFORMAT_BGRA8888:
|
||||
fprintf(stderr, "BGRA8888");
|
||||
break;
|
||||
case SDL_PixelFormat_ARGB2101010:
|
||||
case SDL_PIXELFORMAT_ARGB2101010:
|
||||
fprintf(stderr, "ARGB2101010");
|
||||
break;
|
||||
case SDL_PixelFormat_YV12:
|
||||
case SDL_PIXELFORMAT_YV12:
|
||||
fprintf(stderr, "YV12");
|
||||
break;
|
||||
case SDL_PixelFormat_IYUV:
|
||||
case SDL_PIXELFORMAT_IYUV:
|
||||
fprintf(stderr, "IYUV");
|
||||
break;
|
||||
case SDL_PixelFormat_YUY2:
|
||||
case SDL_PIXELFORMAT_YUY2:
|
||||
fprintf(stderr, "YUY2");
|
||||
break;
|
||||
case SDL_PixelFormat_UYVY:
|
||||
case SDL_PIXELFORMAT_UYVY:
|
||||
fprintf(stderr, "UYVY");
|
||||
break;
|
||||
case SDL_PixelFormat_YVYU:
|
||||
case SDL_PIXELFORMAT_YVYU:
|
||||
fprintf(stderr, "YVYU");
|
||||
break;
|
||||
default:
|
||||
@ -617,16 +617,16 @@ CommonInit(CommonState * state)
|
||||
|
||||
switch (state->depth) {
|
||||
case 8:
|
||||
fullscreen_mode.format = SDL_PixelFormat_Index8;
|
||||
fullscreen_mode.format = SDL_PIXELFORMAT_INDEX8;
|
||||
break;
|
||||
case 15:
|
||||
fullscreen_mode.format = SDL_PixelFormat_RGB555;
|
||||
fullscreen_mode.format = SDL_PIXELFORMAT_RGB555;
|
||||
break;
|
||||
case 16:
|
||||
fullscreen_mode.format = SDL_PixelFormat_RGB565;
|
||||
fullscreen_mode.format = SDL_PIXELFORMAT_RGB565;
|
||||
break;
|
||||
default:
|
||||
fullscreen_mode.format = SDL_PixelFormat_RGB888;
|
||||
fullscreen_mode.format = SDL_PIXELFORMAT_RGB888;
|
||||
break;
|
||||
}
|
||||
fullscreen_mode.w = state->window_w;
|
||||
@ -909,6 +909,11 @@ CommonEvent(CommonState * state, SDL_Event * event, int *done)
|
||||
case SDL_KEYDOWN:
|
||||
switch (event->key.keysym.sym) {
|
||||
/* Add hotkeys here */
|
||||
case SDLK_g:
|
||||
if (event->key.keysym.mod & KMOD_CTRL) {
|
||||
/* Ctrl-G toggle grab */
|
||||
}
|
||||
break;
|
||||
case SDLK_ESCAPE:
|
||||
*done = 1;
|
||||
break;
|
||||
|
@ -229,7 +229,7 @@ main(int argc, char *argv[])
|
||||
quit(2);
|
||||
}
|
||||
|
||||
if (state->render_flags & SDL_Renderer_PresentVSync) {
|
||||
if (state->render_flags & SDL_RENDERER_PRESENTVSYNC) {
|
||||
SDL_GL_SetSwapInterval(1);
|
||||
} else {
|
||||
SDL_GL_SetSwapInterval(0);
|
||||
|
@ -16,8 +16,8 @@ static SDL_TextureID *sprites;
|
||||
static SDL_Rect *positions;
|
||||
static SDL_Rect *velocities;
|
||||
static int sprite_w, sprite_h;
|
||||
static SDL_TextureBlendMode blendMode = SDL_TextureBlendMode_Mask;
|
||||
static SDL_TextureScaleMode scaleMode = SDL_TextureScaleMode_None;
|
||||
static SDL_TextureBlendMode blendMode = SDL_TEXTUREBLENDMODE_MASK;
|
||||
static SDL_TextureScaleMode scaleMode = SDL_TEXTURESCALEMODE_NONE;
|
||||
|
||||
/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
|
||||
static void
|
||||
@ -60,7 +60,7 @@ LoadSprite(char *file)
|
||||
for (i = 0; i < state->num_windows; ++i) {
|
||||
SDL_SelectRenderer(state->windows[i]);
|
||||
sprites[i] =
|
||||
SDL_CreateTextureFromSurface(0, SDL_TextureAccess_Remote, temp);
|
||||
SDL_CreateTextureFromSurface(0, SDL_TEXTUREACCESS_REMOTE, temp);
|
||||
if (!sprites[i]) {
|
||||
fprintf(stderr, "Couldn't create texture: %s\n", SDL_GetError());
|
||||
SDL_FreeSurface(temp);
|
||||
@ -134,35 +134,35 @@ main(int argc, char *argv[])
|
||||
if (SDL_strcasecmp(argv[i], "--blend") == 0) {
|
||||
if (argv[i + 1]) {
|
||||
if (SDL_strcasecmp(argv[i + 1], "none") == 0) {
|
||||
blendMode = SDL_TextureBlendMode_None;
|
||||
blendMode = SDL_TEXTUREBLENDMODE_NONE;
|
||||
consumed = 2;
|
||||
} else if (SDL_strcasecmp(argv[i + 1], "mask") == 0) {
|
||||
blendMode = SDL_TextureBlendMode_Mask;
|
||||
blendMode = SDL_TEXTUREBLENDMODE_MASK;
|
||||
consumed = 2;
|
||||
} else if (SDL_strcasecmp(argv[i + 1], "blend") == 0) {
|
||||
blendMode = SDL_TextureBlendMode_Blend;
|
||||
blendMode = SDL_TEXTUREBLENDMODE_BLEND;
|
||||
consumed = 2;
|
||||
} else if (SDL_strcasecmp(argv[i + 1], "add") == 0) {
|
||||
blendMode = SDL_TextureBlendMode_Add;
|
||||
blendMode = SDL_TEXTUREBLENDMODE_ADD;
|
||||
consumed = 2;
|
||||
} else if (SDL_strcasecmp(argv[i + 1], "mod") == 0) {
|
||||
blendMode = SDL_TextureBlendMode_Mod;
|
||||
blendMode = SDL_TEXTUREBLENDMODE_MOD;
|
||||
consumed = 2;
|
||||
}
|
||||
}
|
||||
} else if (SDL_strcasecmp(argv[i], "--scale") == 0) {
|
||||
if (argv[i + 1]) {
|
||||
if (SDL_strcasecmp(argv[i + 1], "none") == 0) {
|
||||
scaleMode = SDL_TextureScaleMode_None;
|
||||
scaleMode = SDL_TEXTURESCALEMODE_NONE;
|
||||
consumed = 2;
|
||||
} else if (SDL_strcasecmp(argv[i + 1], "fast") == 0) {
|
||||
scaleMode = SDL_TextureScaleMode_Fast;
|
||||
scaleMode = SDL_TEXTURESCALEMODE_FAST;
|
||||
consumed = 2;
|
||||
} else if (SDL_strcasecmp(argv[i + 1], "slow") == 0) {
|
||||
scaleMode = SDL_TextureScaleMode_Slow;
|
||||
scaleMode = SDL_TEXTURESCALEMODE_SLOW;
|
||||
consumed = 2;
|
||||
} else if (SDL_strcasecmp(argv[i + 1], "best") == 0) {
|
||||
scaleMode = SDL_TextureScaleMode_Best;
|
||||
scaleMode = SDL_TEXTURESCALEMODE_BEST;
|
||||
consumed = 2;
|
||||
}
|
||||
}
|
||||
@ -206,7 +206,7 @@ main(int argc, char *argv[])
|
||||
quit(2);
|
||||
}
|
||||
srand(time(NULL));
|
||||
if (scaleMode != SDL_TextureScaleMode_None) {
|
||||
if (scaleMode != SDL_TEXTURESCALEMODE_NONE) {
|
||||
sprite_w += sprite_w / 2;
|
||||
sprite_h += sprite_h / 2;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user