comparison src/render/SDL_sysrender.h @ 5159:307ccc9c135e

Made it possible to create a texture of any format, even if not supported by the renderer. This allows me to reduce the set of formats supported by the renderers to the most optimal set, for a nice speed boost.
author Sam Lantinga <slouken@libsdl.org>
date Thu, 03 Feb 2011 00:19:40 -0800
parents fb424691cfc7
children 657543cc92f9
comparison
equal deleted inserted replaced
5158:f3ebd1950442 5159:307ccc9c135e
24 #ifndef _SDL_sysrender_h 24 #ifndef _SDL_sysrender_h
25 #define _SDL_sysrender_h 25 #define _SDL_sysrender_h
26 26
27 #include "SDL_render.h" 27 #include "SDL_render.h"
28 #include "SDL_events.h" 28 #include "SDL_events.h"
29 #include "SDL_yuv_sw_c.h"
29 30
30 /* The SDL 2D rendering system */ 31 /* The SDL 2D rendering system */
31 32
32 typedef struct SDL_RenderDriver SDL_RenderDriver; 33 typedef struct SDL_RenderDriver SDL_RenderDriver;
33 34
43 SDL_BlendMode blendMode; /**< The texture blend mode */ 44 SDL_BlendMode blendMode; /**< The texture blend mode */
44 Uint8 r, g, b, a; /**< Texture modulation values */ 45 Uint8 r, g, b, a; /**< Texture modulation values */
45 46
46 SDL_Renderer *renderer; 47 SDL_Renderer *renderer;
47 48
49 /* Support for formats not supported directly by the renderer */
50 SDL_Texture *native;
51 SDL_SW_YUVTexture *yuv;
52 void *pixels;
53 int pitch;
54 SDL_Rect locked_rect;
55
48 void *driverdata; /**< Driver specific texture representation */ 56 void *driverdata; /**< Driver specific texture representation */
49 57
50 SDL_Texture *prev; 58 SDL_Texture *prev;
51 SDL_Texture *next; 59 SDL_Texture *next;
52 }; 60 };
56 { 64 {
57 const void *magic; 65 const void *magic;
58 66
59 void (*WindowEvent) (SDL_Renderer * renderer, const SDL_WindowEvent *event); 67 void (*WindowEvent) (SDL_Renderer * renderer, const SDL_WindowEvent *event);
60 int (*CreateTexture) (SDL_Renderer * renderer, SDL_Texture * texture); 68 int (*CreateTexture) (SDL_Renderer * renderer, SDL_Texture * texture);
61 int (*QueryTexturePixels) (SDL_Renderer * renderer, SDL_Texture * texture,
62 void **pixels, int *pitch);
63 int (*SetTextureColorMod) (SDL_Renderer * renderer, 69 int (*SetTextureColorMod) (SDL_Renderer * renderer,
64 SDL_Texture * texture); 70 SDL_Texture * texture);
65 int (*SetTextureAlphaMod) (SDL_Renderer * renderer, 71 int (*SetTextureAlphaMod) (SDL_Renderer * renderer,
66 SDL_Texture * texture); 72 SDL_Texture * texture);
67 int (*SetTextureBlendMode) (SDL_Renderer * renderer, 73 int (*SetTextureBlendMode) (SDL_Renderer * renderer,
68 SDL_Texture * texture); 74 SDL_Texture * texture);
69 int (*UpdateTexture) (SDL_Renderer * renderer, SDL_Texture * texture, 75 int (*UpdateTexture) (SDL_Renderer * renderer, SDL_Texture * texture,
70 const SDL_Rect * rect, const void *pixels, 76 const SDL_Rect * rect, const void *pixels,
71 int pitch); 77 int pitch);
72 int (*LockTexture) (SDL_Renderer * renderer, SDL_Texture * texture, 78 int (*LockTexture) (SDL_Renderer * renderer, SDL_Texture * texture,
73 const SDL_Rect * rect, int markDirty, void **pixels, 79 const SDL_Rect * rect, void **pixels, int *pitch);
74 int *pitch);
75 void (*UnlockTexture) (SDL_Renderer * renderer, SDL_Texture * texture); 80 void (*UnlockTexture) (SDL_Renderer * renderer, SDL_Texture * texture);
76 void (*DirtyTexture) (SDL_Renderer * renderer, SDL_Texture * texture,
77 int numrects, const SDL_Rect * rects);
78 int (*RenderClear) (SDL_Renderer * renderer); 81 int (*RenderClear) (SDL_Renderer * renderer);
79 int (*RenderDrawPoints) (SDL_Renderer * renderer, const SDL_Point * points, 82 int (*RenderDrawPoints) (SDL_Renderer * renderer, const SDL_Point * points,
80 int count); 83 int count);
81 int (*RenderDrawLines) (SDL_Renderer * renderer, const SDL_Point * points, 84 int (*RenderDrawLines) (SDL_Renderer * renderer, const SDL_Point * points,
82 int count); 85 int count);