SDL_render.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. #ifndef _SDL_render_h
  2. #define _SDL_render_h
  3. #include "SDL_stdinc.h"
  4. #include "SDL_rect.h"
  5. #include "SDL_video.h"
  6. #include "begin_code.h"
  7. #ifdef __cplusplus
  8. extern "C" {
  9. #endif
  10. typedef enum
  11. {
  12. SDL_RENDERER_SOFTWARE = 0x00000001,
  13. SDL_RENDERER_ACCELERATED = 0x00000002,
  14. SDL_RENDERER_PRESENTVSYNC = 0x00000004,
  15. SDL_RENDERER_TARGETTEXTURE = 0x00000008
  16. } SDL_RendererFlags;
  17. typedef struct SDL_RendererInfo
  18. {
  19. const char *name;
  20. Uint32 flags;
  21. Uint32 num_texture_formats;
  22. Uint32 texture_formats[16];
  23. int max_texture_width;
  24. int max_texture_height;
  25. } SDL_RendererInfo;
  26. typedef enum
  27. {
  28. SDL_TEXTUREACCESS_STATIC,
  29. SDL_TEXTUREACCESS_STREAMING,
  30. SDL_TEXTUREACCESS_TARGET
  31. } SDL_TextureAccess;
  32. typedef enum
  33. {
  34. SDL_TEXTUREMODULATE_NONE = 0x00000000,
  35. SDL_TEXTUREMODULATE_COLOR = 0x00000001,
  36. SDL_TEXTUREMODULATE_ALPHA = 0x00000002
  37. } SDL_TextureModulate;
  38. typedef enum
  39. {
  40. SDL_FLIP_NONE = 0x00000000,
  41. SDL_FLIP_HORIZONTAL = 0x00000001,
  42. SDL_FLIP_VERTICAL = 0x00000002
  43. } SDL_RendererFlip;
  44. struct SDL_Renderer;
  45. typedef struct SDL_Renderer SDL_Renderer;
  46. struct SDL_Texture;
  47. typedef struct SDL_Texture SDL_Texture;
  48. typedef int SDLCALL tSDL_GetNumRenderDrivers(void);
  49. typedef int SDLCALL tSDL_GetRenderDriverInfo(int index,
  50. SDL_RendererInfo * info);
  51. typedef int SDLCALL tSDL_CreateWindowAndRenderer(
  52. int width, int height, Uint32 window_flags,
  53. SDL_Window **window, SDL_Renderer **renderer);
  54. typedef SDL_Renderer * SDLCALL tSDL_CreateRenderer(SDL_Window * window,
  55. int index, Uint32 flags);
  56. typedef SDL_Renderer * SDLCALL tSDL_CreateSoftwareRenderer(SDL_Surface * surface);
  57. typedef SDL_Renderer * SDLCALL tSDL_GetRenderer(SDL_Window * window);
  58. typedef int SDLCALL tSDL_GetRendererInfo(SDL_Renderer * renderer,
  59. SDL_RendererInfo * info);
  60. typedef int SDLCALL tSDL_GetRendererOutputSize(SDL_Renderer * renderer,
  61. int *w, int *h);
  62. typedef SDL_Texture * SDLCALL tSDL_CreateTexture(SDL_Renderer * renderer,
  63. Uint32 format,
  64. int access, int w,
  65. int h);
  66. typedef SDL_Texture * SDLCALL tSDL_CreateTextureFromSurface(SDL_Renderer * renderer, SDL_Surface * surface);
  67. typedef int SDLCALL tSDL_QueryTexture(SDL_Texture * texture,
  68. Uint32 * format, int *access,
  69. int *w, int *h);
  70. typedef int SDLCALL tSDL_SetTextureColorMod(SDL_Texture * texture,
  71. Uint8 r, Uint8 g, Uint8 b);
  72. typedef int SDLCALL tSDL_GetTextureColorMod(SDL_Texture * texture,
  73. Uint8 * r, Uint8 * g,
  74. Uint8 * b);
  75. typedef int SDLCALL tSDL_SetTextureAlphaMod(SDL_Texture * texture,
  76. Uint8 alpha);
  77. typedef int SDLCALL tSDL_GetTextureAlphaMod(SDL_Texture * texture,
  78. Uint8 * alpha);
  79. typedef int SDLCALL tSDL_SetTextureBlendMode(SDL_Texture * texture,
  80. SDL_BlendMode blendMode);
  81. typedef int SDLCALL tSDL_GetTextureBlendMode(SDL_Texture * texture,
  82. SDL_BlendMode *blendMode);
  83. typedef int SDLCALL tSDL_UpdateTexture(SDL_Texture * texture,
  84. const SDL_Rect * rect,
  85. const void *pixels, int pitch);
  86. typedef int SDLCALL tSDL_LockTexture(SDL_Texture * texture,
  87. const SDL_Rect * rect,
  88. void **pixels, int *pitch);
  89. typedef void SDLCALL tSDL_UnlockTexture(SDL_Texture * texture);
  90. typedef SDL_bool SDLCALL tSDL_RenderTargetSupported(SDL_Renderer *renderer);
  91. typedef int SDLCALL tSDL_SetRenderTarget(SDL_Renderer *renderer,
  92. SDL_Texture *texture);
  93. typedef SDL_Texture * SDLCALL tSDL_GetRenderTarget(SDL_Renderer *renderer);
  94. typedef int SDLCALL tSDL_RenderSetLogicalSize(SDL_Renderer * renderer, int w, int h);
  95. typedef void SDLCALL tSDL_RenderGetLogicalSize(SDL_Renderer * renderer, int *w, int *h);
  96. typedef int SDLCALL tSDL_RenderSetViewport(SDL_Renderer * renderer,
  97. const SDL_Rect * rect);
  98. typedef void SDLCALL tSDL_RenderGetViewport(SDL_Renderer * renderer,
  99. SDL_Rect * rect);
  100. typedef int SDLCALL tSDL_RenderSetClipRect(SDL_Renderer * renderer,
  101. const SDL_Rect * rect);
  102. typedef void SDLCALL tSDL_RenderGetClipRect(SDL_Renderer * renderer,
  103. SDL_Rect * rect);
  104. typedef int SDLCALL tSDL_RenderSetScale(SDL_Renderer * renderer,
  105. float scaleX, float scaleY);
  106. typedef void SDLCALL tSDL_RenderGetScale(SDL_Renderer * renderer,
  107. float *scaleX, float *scaleY);
  108. extern DECLSPEC int SDL_SetRenderDrawColor(SDL_Renderer * renderer,
  109. Uint8 r, Uint8 g, Uint8 b,
  110. Uint8 a);
  111. extern DECLSPEC int SDL_GetRenderDrawColor(SDL_Renderer * renderer,
  112. Uint8 * r, Uint8 * g, Uint8 * b,
  113. Uint8 * a);
  114. typedef int SDLCALL tSDL_SetRenderDrawBlendMode(SDL_Renderer * renderer,
  115. SDL_BlendMode blendMode);
  116. typedef int SDLCALL tSDL_GetRenderDrawBlendMode(SDL_Renderer * renderer,
  117. SDL_BlendMode *blendMode);
  118. typedef int SDLCALL tSDL_RenderClear(SDL_Renderer * renderer);
  119. typedef int SDLCALL tSDL_RenderDrawPoint(SDL_Renderer * renderer,
  120. int x, int y);
  121. typedef int SDLCALL tSDL_RenderDrawPoints(SDL_Renderer * renderer,
  122. const SDL_Point * points,
  123. int count);
  124. typedef int SDLCALL tSDL_RenderDrawLine(SDL_Renderer * renderer,
  125. int x1, int y1, int x2, int y2);
  126. typedef int SDLCALL tSDL_RenderDrawLines(SDL_Renderer * renderer,
  127. const SDL_Point * points,
  128. int count);
  129. typedef int SDLCALL tSDL_RenderDrawRect(SDL_Renderer * renderer,
  130. const SDL_Rect * rect);
  131. typedef int SDLCALL tSDL_RenderDrawRects(SDL_Renderer * renderer,
  132. const SDL_Rect * rects,
  133. int count);
  134. typedef int SDLCALL tSDL_RenderFillRect(SDL_Renderer * renderer,
  135. const SDL_Rect * rect);
  136. typedef int SDLCALL tSDL_RenderFillRects(SDL_Renderer * renderer,
  137. const SDL_Rect * rects,
  138. int count);
  139. typedef int SDLCALL tSDL_RenderCopy(SDL_Renderer * renderer,
  140. SDL_Texture * texture,
  141. const SDL_Rect * srcrect,
  142. const SDL_Rect * dstrect);
  143. typedef int SDLCALL tSDL_RenderCopyEx(SDL_Renderer * renderer,
  144. SDL_Texture * texture,
  145. const SDL_Rect * srcrect,
  146. const SDL_Rect * dstrect,
  147. const double angle,
  148. const SDL_Point *center,
  149. const SDL_RendererFlip flip);
  150. typedef int SDLCALL tSDL_RenderReadPixels(SDL_Renderer * renderer,
  151. const SDL_Rect * rect,
  152. Uint32 format,
  153. void *pixels, int pitch);
  154. typedef void SDLCALL tSDL_RenderPresent(SDL_Renderer * renderer);
  155. typedef void SDLCALL tSDL_DestroyTexture(SDL_Texture * texture);
  156. typedef void SDLCALL tSDL_DestroyRenderer(SDL_Renderer * renderer);
  157. typedef int SDLCALL tSDL_GL_BindTexture(SDL_Texture *texture, float *texw, float *texh);
  158. typedef int SDLCALL tSDL_GL_UnbindTexture(SDL_Texture *texture);
  159. extern tSDL_GetNumRenderDrivers *SDL_GetNumRenderDrivers;
  160. extern tSDL_GetRenderDriverInfo *SDL_GetRenderDriverInfo;
  161. extern tSDL_CreateWindowAndRenderer *SDL_CreateWindowAndRenderer;
  162. extern tSDL_CreateRenderer *SDL_CreateRenderer;
  163. extern tSDL_CreateSoftwareRenderer *SDL_CreateSoftwareRenderer;
  164. extern tSDL_GetRenderer *SDL_GetRenderer;
  165. extern tSDL_GetRendererInfo *SDL_GetRendererInfo;
  166. extern tSDL_GetRendererOutputSize *SDL_GetRendererOutputSize;
  167. extern tSDL_CreateTexture *SDL_CreateTexture;
  168. extern tSDL_CreateTextureFromSurface *SDL_CreateTextureFromSurface;
  169. extern tSDL_QueryTexture *SDL_QueryTexture;
  170. extern tSDL_SetTextureColorMod *SDL_SetTextureColorMod;
  171. extern tSDL_GetTextureColorMod *SDL_GetTextureColorMod;
  172. extern tSDL_SetTextureAlphaMod *SDL_SetTextureAlphaMod;
  173. extern tSDL_GetTextureAlphaMod *SDL_GetTextureAlphaMod;
  174. extern tSDL_SetTextureBlendMode *SDL_SetTextureBlendMode;
  175. extern tSDL_GetTextureBlendMode *SDL_GetTextureBlendMode;
  176. extern tSDL_UpdateTexture *SDL_UpdateTexture;
  177. extern tSDL_LockTexture *SDL_LockTexture;
  178. extern tSDL_UnlockTexture *SDL_UnlockTexture;
  179. extern tSDL_RenderTargetSupported *SDL_RenderTargetSupported;
  180. extern tSDL_SetRenderTarget *SDL_SetRenderTarget;
  181. extern tSDL_GetRenderTarget *SDL_GetRenderTarget;
  182. extern tSDL_RenderSetLogicalSize *SDL_RenderSetLogicalSize;
  183. extern tSDL_RenderGetLogicalSize *SDL_RenderGetLogicalSize;
  184. extern tSDL_RenderSetViewport *SDL_RenderSetViewport;
  185. extern tSDL_RenderGetViewport *SDL_RenderGetViewport;
  186. extern tSDL_RenderSetClipRect *SDL_RenderSetClipRect;
  187. extern tSDL_RenderGetClipRect *SDL_RenderGetClipRect;
  188. extern tSDL_RenderSetScale *SDL_RenderSetScale;
  189. extern tSDL_RenderGetScale *SDL_RenderGetScale;
  190. extern tSDL_SetRenderDrawBlendMode *SDL_SetRenderDrawBlendMode;
  191. extern tSDL_GetRenderDrawBlendMode *SDL_GetRenderDrawBlendMode;
  192. extern tSDL_RenderClear *SDL_RenderClear;
  193. extern tSDL_RenderDrawPoint *SDL_RenderDrawPoint;
  194. extern tSDL_RenderDrawPoints *SDL_RenderDrawPoints;
  195. extern tSDL_RenderDrawLine *SDL_RenderDrawLine;
  196. extern tSDL_RenderDrawLines *SDL_RenderDrawLines;
  197. extern tSDL_RenderDrawRect *SDL_RenderDrawRect;
  198. extern tSDL_RenderDrawRects *SDL_RenderDrawRects;
  199. extern tSDL_RenderFillRect *SDL_RenderFillRect;
  200. extern tSDL_RenderFillRects *SDL_RenderFillRects;
  201. extern tSDL_RenderCopy *SDL_RenderCopy;
  202. extern tSDL_RenderCopyEx *SDL_RenderCopyEx;
  203. extern tSDL_RenderReadPixels *SDL_RenderReadPixels;
  204. extern tSDL_RenderPresent *SDL_RenderPresent;
  205. extern tSDL_DestroyTexture *SDL_DestroyTexture;
  206. extern tSDL_DestroyRenderer *SDL_DestroyRenderer;
  207. extern tSDL_GL_BindTexture *SDL_GL_BindTexture;
  208. extern tSDL_GL_UnbindTexture *SDL_GL_UnbindTexture;
  209. #ifdef __cplusplus
  210. }
  211. #endif
  212. #include "close_code.h"
  213. #endif