Playing around, trying to find a fast path with GDI
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401943
This commit is contained in:
parent
d1be2d9e1c
commit
4beaa4e63c
2 changed files with 10 additions and 4 deletions
|
@ -78,8 +78,10 @@ SDL_RenderDriver SDL_D3D_RenderDriver = {
|
|||
SDL_D3D_CreateRenderer,
|
||||
{
|
||||
"d3d",
|
||||
(SDL_Renderer_PresentDiscard |
|
||||
SDL_Renderer_PresentCopy | SDL_Renderer_RenderTarget),
|
||||
(SDL_Renderer_Minimal |
|
||||
SDL_Renderer_SingleBuffer | SDL_Renderer_PresentCopy |
|
||||
SDL_Renderer_PresentFlip2 | SDL_Renderer_PresentFlip3 |
|
||||
SDL_Renderer_PresentDiscard | SDL_Renderer_RenderTarget),
|
||||
(SDL_TextureBlendMode_None |
|
||||
SDL_TextureBlendMode_Mask | SDL_TextureBlendMode_Blend),
|
||||
(SDL_TextureScaleMode_None | SDL_TextureScaleMode_Fast),
|
||||
|
|
|
@ -79,7 +79,8 @@ SDL_RenderDriver SDL_GDI_RenderDriver = {
|
|||
SDL_GDI_CreateRenderer,
|
||||
{
|
||||
"gdi",
|
||||
(SDL_Renderer_SingleBuffer | SDL_Renderer_PresentCopy |
|
||||
(//SDL_Renderer_Minimal |
|
||||
SDL_Renderer_SingleBuffer | SDL_Renderer_PresentCopy |
|
||||
SDL_Renderer_PresentFlip2 | SDL_Renderer_PresentFlip3 |
|
||||
SDL_Renderer_PresentDiscard | SDL_Renderer_RenderTarget),
|
||||
(SDL_TextureBlendMode_None | SDL_TextureBlendMode_Mask |
|
||||
|
@ -491,13 +492,16 @@ SDL_GDI_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
|
|||
if (data->yuv) {
|
||||
return SDL_SW_LockYUVTexture(data->yuv, rect, markDirty, pixels,
|
||||
pitch);
|
||||
} else {
|
||||
} else if (data->pixels) {
|
||||
GdiFlush();
|
||||
*pixels =
|
||||
(void *) ((Uint8 *) data->pixels + rect->y * data->pitch +
|
||||
rect->x * SDL_BYTESPERPIXEL(texture->format));
|
||||
*pitch = data->pitch;
|
||||
return 0;
|
||||
} else {
|
||||
SDL_SetError("No pixels available");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue