src/video/win32/SDL_d3drender.c
changeset 1965 a788656ca29a
parent 1925 411bfb37082b
child 1975 ccef0d0c40c6
     1.1 --- a/src/video/win32/SDL_d3drender.c	Thu Aug 03 19:34:05 2006 +0000
     1.2 +++ b/src/video/win32/SDL_d3drender.c	Sat Aug 05 17:09:42 2006 +0000
     1.3 @@ -60,29 +60,29 @@
     1.4      D3D_CreateRenderer,
     1.5      {
     1.6       "d3d",
     1.7 -     (SDL_Renderer_SingleBuffer | SDL_Renderer_PresentCopy |
     1.8 -      SDL_Renderer_PresentFlip2 | SDL_Renderer_PresentFlip3 |
     1.9 -      SDL_Renderer_PresentDiscard | SDL_Renderer_PresentVSync |
    1.10 -      SDL_Renderer_Accelerated),
    1.11 -     (SDL_TextureBlendMode_None | SDL_TextureBlendMode_Mask |
    1.12 -      SDL_TextureBlendMode_Blend | SDL_TextureBlendMode_Add |
    1.13 -      SDL_TextureBlendMode_Mod),
    1.14 -     (SDL_TextureScaleMode_None | SDL_TextureScaleMode_Fast |
    1.15 -      SDL_TextureScaleMode_Slow | SDL_TextureScaleMode_Best),
    1.16 +     (SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTCOPY |
    1.17 +      SDL_RENDERER_PRESENTFLIP2 | sDL_RENDERER_PRESENTFLIP3 |
    1.18 +      SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_PRESENTVSYNC |
    1.19 +      SDL_RENDERER_ACCELERATED),
    1.20 +     (SDL_TEXTUREBLENDMODE_NONE | SDL_TEXTUREBLENDMODE_MASK |
    1.21 +      SDL_TEXTUREBLENDMODE_BLEND | SDL_TEXTUREBLENDMODE_ADD |
    1.22 +      SDL_TEXTUREBLENDMODE_MOD),
    1.23 +     (SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_FAST |
    1.24 +      SDL_TEXTURESCALEMODE_SLOW | SDL_TEXTURESCALEMODE_BEST),
    1.25       12,
    1.26       {
    1.27 -      SDL_PixelFormat_Index8,
    1.28 -      SDL_PixelFormat_RGB332,
    1.29 -      SDL_PixelFormat_RGB444,
    1.30 -      SDL_PixelFormat_RGB555,
    1.31 -      SDL_PixelFormat_ARGB4444,
    1.32 -      SDL_PixelFormat_ARGB1555,
    1.33 -      SDL_PixelFormat_RGB565,
    1.34 -      SDL_PixelFormat_RGB888,
    1.35 -      SDL_PixelFormat_ARGB8888,
    1.36 -      SDL_PixelFormat_ARGB2101010,
    1.37 -      SDL_PixelFormat_UYVY,
    1.38 -      SDL_PixelFormat_YUY2},
    1.39 +      SDL_PIXELFORMAT_INDEX8,
    1.40 +      SDL_PIXELFORMAT_RGB332,
    1.41 +      SDL_PIXELFORMAT_RGB444,
    1.42 +      SDL_PIXELFORMAT_RGB555,
    1.43 +      SDL_PIXELFORMAT_ARGB4444,
    1.44 +      SDL_PIXELFORMAT_ARGB1555,
    1.45 +      SDL_PIXELFORMAT_RGB565,
    1.46 +      SDL_PIXELFORMAT_RGB888,
    1.47 +      SDL_PIXELFORMAT_ARGB8888,
    1.48 +      SDL_PIXELFORMAT_ARGB2101010,
    1.49 +      SDL_PIXELFORMAT_UYVY,
    1.50 +      SDL_PIXELFORMAT_YUY2},
    1.51       0,
    1.52       0}
    1.53  };
    1.54 @@ -188,29 +188,29 @@
    1.55  PixelFormatToD3DFMT(Uint32 format)
    1.56  {
    1.57      switch (format) {
    1.58 -    case SDL_PixelFormat_Index8:
    1.59 +    case SDL_PIXELFORMAT_INDEX8:
    1.60          return D3DFMT_P8;
    1.61 -    case SDL_PixelFormat_RGB332:
    1.62 +    case SDL_PIXELFORMAT_RGB332:
    1.63          return D3DFMT_R3G3B2;
    1.64 -    case SDL_PixelFormat_RGB444:
    1.65 +    case SDL_PIXELFORMAT_RGB444:
    1.66          return D3DFMT_X4R4G4B4;
    1.67 -    case SDL_PixelFormat_RGB555:
    1.68 +    case SDL_PIXELFORMAT_RGB555:
    1.69          return D3DFMT_X1R5G5B5;
    1.70 -    case SDL_PixelFormat_ARGB4444:
    1.71 +    case SDL_PIXELFORMAT_ARGB4444:
    1.72          return D3DFMT_A4R4G4B4;
    1.73 -    case SDL_PixelFormat_ARGB1555:
    1.74 +    case SDL_PIXELFORMAT_ARGB1555:
    1.75          return D3DFMT_A1R5G5B5;
    1.76 -    case SDL_PixelFormat_RGB565:
    1.77 +    case SDL_PIXELFORMAT_RGB565:
    1.78          return D3DFMT_R5G6B5;
    1.79 -    case SDL_PixelFormat_RGB888:
    1.80 +    case SDL_PIXELFORMAT_RGB888:
    1.81          return D3DFMT_X8R8G8B8;
    1.82 -    case SDL_PixelFormat_ARGB8888:
    1.83 +    case SDL_PIXELFORMAT_ARGB8888:
    1.84          return D3DFMT_A8R8G8B8;
    1.85 -    case SDL_PixelFormat_ARGB2101010:
    1.86 +    case SDL_PIXELFORMAT_ARGB2101010:
    1.87          return D3DFMT_A2R10G10B10;
    1.88 -    case SDL_PixelFormat_UYVY:
    1.89 +    case SDL_PIXELFORMAT_UYVY:
    1.90          return D3DFMT_UYVY;
    1.91 -    case SDL_PixelFormat_YUY2:
    1.92 +    case SDL_PIXELFORMAT_YUY2:
    1.93          return D3DFMT_YUY2;
    1.94      default:
    1.95          return D3DFMT_UNKNOWN;
    1.96 @@ -269,7 +269,7 @@
    1.97      renderer->window = window->id;
    1.98      renderer->driverdata = data;
    1.99  
   1.100 -    renderer->info.flags = SDL_Renderer_Accelerated;
   1.101 +    renderer->info.flags = SDL_RENDERER_ACCELERATED;
   1.102  
   1.103      SDL_zero(pparams);
   1.104      pparams.BackBufferWidth = window->w;
   1.105 @@ -280,13 +280,13 @@
   1.106      } else {
   1.107          pparams.BackBufferFormat = D3DFMT_UNKNOWN;
   1.108      }
   1.109 -    if (flags & SDL_Renderer_PresentFlip2) {
   1.110 +    if (flags & SDL_RENDERER_PRESENTFLIP2) {
   1.111          pparams.BackBufferCount = 2;
   1.112          pparams.SwapEffect = D3DSWAPEFFECT_FLIP;
   1.113 -    } else if (flags & SDL_Renderer_PresentFlip3) {
   1.114 +    } else if (flags & SDL_RENDERER_PRESENTFLIP3) {
   1.115          pparams.BackBufferCount = 3;
   1.116          pparams.SwapEffect = D3DSWAPEFFECT_FLIP;
   1.117 -    } else if (flags & SDL_Renderer_PresentCopy) {
   1.118 +    } else if (flags & SDL_RENDERER_PRESENTCOPY) {
   1.119          pparams.BackBufferCount = 1;
   1.120          pparams.SwapEffect = D3DSWAPEFFECT_COPY;
   1.121      } else {
   1.122 @@ -301,7 +301,7 @@
   1.123          pparams.Windowed = TRUE;
   1.124          pparams.FullScreen_RefreshRateInHz = 0;
   1.125      }
   1.126 -    if (flags & SDL_Renderer_PresentVSync) {
   1.127 +    if (flags & SDL_RENDERER_PRESENTVSYNC) {
   1.128          pparams.PresentationInterval = D3DPRESENT_INTERVAL_ONE;
   1.129      } else {
   1.130          pparams.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
   1.131 @@ -336,24 +336,24 @@
   1.132      IDirect3DSwapChain9_Release(chain);
   1.133      switch (pparams.SwapEffect) {
   1.134      case D3DSWAPEFFECT_COPY:
   1.135 -        renderer->info.flags |= SDL_Renderer_PresentCopy;
   1.136 +        renderer->info.flags |= SDL_RENDERER_PRESENTCOPY;
   1.137          break;
   1.138      case D3DSWAPEFFECT_FLIP:
   1.139          switch (pparams.BackBufferCount) {
   1.140          case 2:
   1.141 -            renderer->info.flags |= SDL_Renderer_PresentFlip2;
   1.142 +            renderer->info.flags |= SDL_RENDERER_PRESENTFLIP2;
   1.143              break;
   1.144          case 3:
   1.145 -            renderer->info.flags |= SDL_Renderer_PresentFlip3;
   1.146 +            renderer->info.flags |= SDL_RENDERER_PRESENTFLIP3;
   1.147              break;
   1.148          }
   1.149          break;
   1.150      case D3DSWAPEFFECT_DISCARD:
   1.151 -        renderer->info.flags |= SDL_Renderer_PresentDiscard;
   1.152 +        renderer->info.flags |= SDL_RENDERER_PRESENTDISCARD;
   1.153          break;
   1.154      }
   1.155      if (pparams.PresentationInterval == D3DPRESENT_INTERVAL_ONE) {
   1.156 -        renderer->info.flags |= SDL_Renderer_PresentVSync;
   1.157 +        renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC;
   1.158      }
   1.159  
   1.160      IDirect3DDevice9_GetDeviceCaps(data->device, &caps);
   1.161 @@ -388,7 +388,7 @@
   1.162  
   1.163      texture->driverdata = data;
   1.164  
   1.165 -    if (texture->access == SDL_TextureAccess_Local) {
   1.166 +    if (texture->access == SDL_TEXTUREACCESS_LOCAL) {
   1.167          pool = D3DPOOL_MANAGED;
   1.168      } else {
   1.169          pool = D3DPOOL_DEFAULT;
   1.170 @@ -494,7 +494,7 @@
   1.171      D3DLOCKED_RECT locked;
   1.172      HRESULT result;
   1.173  
   1.174 -    if (texture->access != SDL_TextureAccess_Local) {
   1.175 +    if (texture->access != SDL_TEXTUREACCESS_LOCAL) {
   1.176          SDL_SetError("Can't lock remote video memory");
   1.177          return -1;
   1.178      }
   1.179 @@ -627,12 +627,12 @@
   1.180      vertices[3].v = maxv;
   1.181  
   1.182      switch (blendMode) {
   1.183 -    case SDL_TextureBlendMode_None:
   1.184 +    case SDL_TEXTUREBLENDMODE_NONE:
   1.185          IDirect3DDevice9_SetRenderState(data->device, D3DRS_ALPHABLENDENABLE,
   1.186                                          FALSE);
   1.187          break;
   1.188 -    case SDL_TextureBlendMode_Mask:
   1.189 -    case SDL_TextureBlendMode_Blend:
   1.190 +    case SDL_TEXTUREBLENDMODE_MASK:
   1.191 +    case SDL_TEXTUREBLENDMODE_BLEND:
   1.192          IDirect3DDevice9_SetRenderState(data->device, D3DRS_ALPHABLENDENABLE,
   1.193                                          TRUE);
   1.194          IDirect3DDevice9_SetRenderState(data->device, D3DRS_SRCBLEND,
   1.195 @@ -640,7 +640,7 @@
   1.196          IDirect3DDevice9_SetRenderState(data->device, D3DRS_DESTBLEND,
   1.197                                          D3DBLEND_INVSRCALPHA);
   1.198          break;
   1.199 -    case SDL_TextureBlendMode_Add:
   1.200 +    case SDL_TEXTUREBLENDMODE_ADD:
   1.201          IDirect3DDevice9_SetRenderState(data->device, D3DRS_ALPHABLENDENABLE,
   1.202                                          TRUE);
   1.203          IDirect3DDevice9_SetRenderState(data->device, D3DRS_SRCBLEND,
   1.204 @@ -648,7 +648,7 @@
   1.205          IDirect3DDevice9_SetRenderState(data->device, D3DRS_DESTBLEND,
   1.206                                          D3DBLEND_ONE);
   1.207          break;
   1.208 -    case SDL_TextureBlendMode_Mod:
   1.209 +    case SDL_TEXTUREBLENDMODE_MOD:
   1.210          IDirect3DDevice9_SetRenderState(data->device, D3DRS_ALPHABLENDENABLE,
   1.211                                          TRUE);
   1.212          IDirect3DDevice9_SetRenderState(data->device, D3DRS_SRCBLEND,
   1.213 @@ -659,20 +659,20 @@
   1.214      }
   1.215  
   1.216      switch (scaleMode) {
   1.217 -    case SDL_TextureScaleMode_None:
   1.218 -    case SDL_TextureScaleMode_Fast:
   1.219 +    case SDL_TEXTURESCALEMODE_NONE:
   1.220 +    case SDL_TEXTURESCALEMODE_FAST:
   1.221          IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MINFILTER,
   1.222                                           D3DTEXF_POINT);
   1.223          IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MAGFILTER,
   1.224                                           D3DTEXF_POINT);
   1.225          break;
   1.226 -    case SDL_TextureScaleMode_Slow:
   1.227 +    case SDL_TEXTURESCALEMODE_SLOW:
   1.228          IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MINFILTER,
   1.229                                           D3DTEXF_LINEAR);
   1.230          IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MAGFILTER,
   1.231                                           D3DTEXF_LINEAR);
   1.232          break;
   1.233 -    case SDL_TextureScaleMode_Best:
   1.234 +    case SDL_TEXTURESCALEMODE_BEST:
   1.235          IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MINFILTER,
   1.236                                           D3DTEXF_GAUSSIANQUAD);
   1.237          IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MAGFILTER,