Commit bfe4f31c authored by Sam Lantinga's avatar Sam Lantinga

SDL constants are all uppercase.

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