comparison src/video/win32/SDL_gdirender.c @ 1898:f89e49e51e89

Playing around, trying to find a fast path with GDI
author Sam Lantinga <slouken@libsdl.org>
date Wed, 12 Jul 2006 07:01:35 +0000
parents c2a27da60b18
children 6a11e61bf805
comparison
equal deleted inserted replaced
1897:c2a27da60b18 1898:f89e49e51e89
77 77
78 SDL_RenderDriver SDL_GDI_RenderDriver = { 78 SDL_RenderDriver SDL_GDI_RenderDriver = {
79 SDL_GDI_CreateRenderer, 79 SDL_GDI_CreateRenderer,
80 { 80 {
81 "gdi", 81 "gdi",
82 (SDL_Renderer_SingleBuffer | SDL_Renderer_PresentCopy | 82 (//SDL_Renderer_Minimal |
83 SDL_Renderer_SingleBuffer | SDL_Renderer_PresentCopy |
83 SDL_Renderer_PresentFlip2 | SDL_Renderer_PresentFlip3 | 84 SDL_Renderer_PresentFlip2 | SDL_Renderer_PresentFlip3 |
84 SDL_Renderer_PresentDiscard | SDL_Renderer_RenderTarget), 85 SDL_Renderer_PresentDiscard | SDL_Renderer_RenderTarget),
85 (SDL_TextureBlendMode_None | SDL_TextureBlendMode_Mask | 86 (SDL_TextureBlendMode_None | SDL_TextureBlendMode_Mask |
86 SDL_TextureBlendMode_Blend), 87 SDL_TextureBlendMode_Blend),
87 (SDL_TextureScaleMode_None | SDL_TextureScaleMode_Fast), 88 (SDL_TextureScaleMode_None | SDL_TextureScaleMode_Fast),
489 SDL_GDI_TextureData *data = (SDL_GDI_TextureData *) texture->driverdata; 490 SDL_GDI_TextureData *data = (SDL_GDI_TextureData *) texture->driverdata;
490 491
491 if (data->yuv) { 492 if (data->yuv) {
492 return SDL_SW_LockYUVTexture(data->yuv, rect, markDirty, pixels, 493 return SDL_SW_LockYUVTexture(data->yuv, rect, markDirty, pixels,
493 pitch); 494 pitch);
494 } else { 495 } else if (data->pixels) {
495 GdiFlush(); 496 GdiFlush();
496 *pixels = 497 *pixels =
497 (void *) ((Uint8 *) data->pixels + rect->y * data->pitch + 498 (void *) ((Uint8 *) data->pixels + rect->y * data->pitch +
498 rect->x * SDL_BYTESPERPIXEL(texture->format)); 499 rect->x * SDL_BYTESPERPIXEL(texture->format));
499 *pitch = data->pitch; 500 *pitch = data->pitch;
500 return 0; 501 return 0;
502 } else {
503 SDL_SetError("No pixels available");
504 return -1;
501 } 505 }
502 } 506 }
503 507
504 static void 508 static void
505 SDL_GDI_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture) 509 SDL_GDI_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture)