src/video/windows/SDL_ceddrawrender.c
changeset 5138 da10636e5eca
parent 5062 e8916fe9cfc8
equal deleted inserted replaced
5137:e594f07297a9 5138:da10636e5eca
    48 static int DDRAW_SetTextureColorMod(SDL_Renderer * renderer,
    48 static int DDRAW_SetTextureColorMod(SDL_Renderer * renderer,
    49                                     SDL_Texture * texture);
    49                                     SDL_Texture * texture);
    50 static int DDRAW_SetTextureAlphaMod(SDL_Renderer * renderer,
    50 static int DDRAW_SetTextureAlphaMod(SDL_Renderer * renderer,
    51                                     SDL_Texture * texture);
    51                                     SDL_Texture * texture);
    52 static int DDRAW_SetTextureBlendMode(SDL_Renderer * renderer,
    52 static int DDRAW_SetTextureBlendMode(SDL_Renderer * renderer,
    53                                      SDL_Texture * texture);
       
    54 static int DDRAW_SetTextureScaleMode(SDL_Renderer * renderer,
       
    55                                      SDL_Texture * texture);
    53                                      SDL_Texture * texture);
    56 static int DDRAW_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
    54 static int DDRAW_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
    57                                const SDL_Rect * rect, const void *pixels,
    55                                const SDL_Rect * rect, const void *pixels,
    58                                int pitch);
    56                                int pitch);
    59 static int DDRAW_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
    57 static int DDRAW_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
    83      (SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTCOPY |
    81      (SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTCOPY |
    84       SDL_RENDERER_PRESENTFLIP2 | SDL_RENDERER_PRESENTFLIP3 |
    82       SDL_RENDERER_PRESENTFLIP2 | SDL_RENDERER_PRESENTFLIP3 |
    85       SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_ACCELERATED),
    83       SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_ACCELERATED),
    86      (SDL_TEXTUREMODULATE_NONE),
    84      (SDL_TEXTUREMODULATE_NONE),
    87      (SDL_BLENDMODE_NONE),
    85      (SDL_BLENDMODE_NONE),
    88      (SDL_SCALEMODE_NONE),
       
    89      0,
    86      0,
    90      {0},
    87      {0},
    91      0,
    88      0,
    92      0}
    89      0}
    93 };
    90 };
   466     renderer->QueryTexturePixels = DDRAW_QueryTexturePixels;
   463     renderer->QueryTexturePixels = DDRAW_QueryTexturePixels;
   467 
   464 
   468     renderer->SetTextureColorMod = DDRAW_SetTextureColorMod;
   465     renderer->SetTextureColorMod = DDRAW_SetTextureColorMod;
   469     renderer->SetTextureAlphaMod = DDRAW_SetTextureAlphaMod;
   466     renderer->SetTextureAlphaMod = DDRAW_SetTextureAlphaMod;
   470     renderer->SetTextureBlendMode = DDRAW_SetTextureBlendMode;
   467     renderer->SetTextureBlendMode = DDRAW_SetTextureBlendMode;
   471     renderer->SetTextureScaleMode = DDRAW_SetTextureScaleMode;
       
   472     renderer->UpdateTexture = DDRAW_UpdateTexture;
   468     renderer->UpdateTexture = DDRAW_UpdateTexture;
   473     renderer->LockTexture = DDRAW_LockTexture;
   469     renderer->LockTexture = DDRAW_LockTexture;
   474     renderer->UnlockTexture = DDRAW_UnlockTexture;
   470     renderer->UnlockTexture = DDRAW_UnlockTexture;
   475     renderer->DirtyTexture = DDRAW_DirtyTexture;
   471     renderer->DirtyTexture = DDRAW_DirtyTexture;
   476     renderer->RenderPoint = DDRAW_RenderPoint;
   472     renderer->RenderPoint = DDRAW_RenderPoint;
   661         return -1;
   657         return -1;
   662     }
   658     }
   663 }
   659 }
   664 
   660 
   665 static int
   661 static int
   666 DDRAW_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture)
       
   667 {
       
   668     switch (texture->scaleMode) {
       
   669     case SDL_SCALEMODE_NONE:
       
   670     default:
       
   671         SDL_Unsupported();
       
   672         texture->scaleMode = SDL_SCALEMODE_NONE;
       
   673         return -1;
       
   674     }
       
   675     return 0;
       
   676 }
       
   677 
       
   678 static int
       
   679 DDRAW_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
   662 DDRAW_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
   680                     const SDL_Rect * rect, const void *pixels, int pitch)
   663                     const SDL_Rect * rect, const void *pixels, int pitch)
   681 {
   664 {
   682     DDRAW_TextureData *data = (DDRAW_TextureData *) texture->driverdata;
   665     DDRAW_TextureData *data = (DDRAW_TextureData *) texture->driverdata;
   683 
   666