/src/Core/objects/PixelFormat.xs

http://github.com/PerlGameDev/SDL · Unknown · 178 lines · 152 code · 26 blank · 0 comment · 0 complexity · 33c89f6036b941df9ee06a1696b53bf0 MD5 · raw file

  1. #include "EXTERN.h"
  2. #include "perl.h"
  3. #include "XSUB.h"
  4. #include "ppport.h"
  5. #include "helper.h"
  6. #ifndef aTHX_
  7. #define aTHX_
  8. #endif
  9. #include <SDL.h>
  10. MODULE = SDL::PixelFormat PACKAGE = SDL::PixelFormat PREFIX = pixelformat_
  11. =for documentation
  12. SDL_PixelFormat -- Stores surface format information
  13. typedef struct SDL_PixelFormat {
  14. SDL_Palette *palette;
  15. Uint8 BitsPerPixel;
  16. Uint8 BytesPerPixel;
  17. Uint8 Rloss, Gloss, Bloss, Aloss;
  18. Uint8 Rshift, Gshift, Bshift, Ashift;
  19. Uint32 Rmask, Gmask, Bmask, Amask;
  20. Uint32 colorkey;
  21. Uint8 alpha;
  22. } SDL_PixelFormat;
  23. =cut
  24. SV *
  25. pixelformat_palette( pixelformat )
  26. SDL_PixelFormat *pixelformat
  27. PREINIT:
  28. char* CLASS = "SDL::Palette";
  29. CODE:
  30. if(pixelformat->palette)
  31. RETVAL = cpy2bag( pixelformat->palette, sizeof(SDL_Palette *), sizeof(SDL_Palette), "SDL::Palette" );
  32. else
  33. XSRETURN_UNDEF;
  34. OUTPUT:
  35. RETVAL
  36. Uint8
  37. pixelformat_BitsPerPixel( pixelformat )
  38. SDL_PixelFormat *pixelformat
  39. CODE:
  40. RETVAL = pixelformat->BitsPerPixel;
  41. OUTPUT:
  42. RETVAL
  43. Uint8
  44. pixelformat_BytesPerPixel( pixelformat )
  45. SDL_PixelFormat *pixelformat
  46. CODE:
  47. RETVAL = pixelformat->BytesPerPixel;
  48. OUTPUT:
  49. RETVAL
  50. Uint8
  51. pixelformat_Rloss( pixelformat )
  52. SDL_PixelFormat *pixelformat
  53. CODE:
  54. RETVAL = pixelformat->Rloss;
  55. OUTPUT:
  56. RETVAL
  57. Uint8
  58. pixelformat_Bloss( pixelformat )
  59. SDL_PixelFormat *pixelformat
  60. CODE:
  61. RETVAL = pixelformat->Bloss;
  62. OUTPUT:
  63. RETVAL
  64. Uint8
  65. pixelformat_Gloss( pixelformat )
  66. SDL_PixelFormat *pixelformat
  67. CODE:
  68. RETVAL = pixelformat->Gloss;
  69. OUTPUT:
  70. RETVAL
  71. Uint8
  72. pixelformat_Aloss( pixelformat )
  73. SDL_PixelFormat *pixelformat
  74. CODE:
  75. RETVAL = pixelformat->Aloss;
  76. OUTPUT:
  77. RETVAL
  78. Uint8
  79. pixelformat_Rshift( pixelformat )
  80. SDL_PixelFormat *pixelformat
  81. CODE:
  82. RETVAL = pixelformat->Rshift;
  83. OUTPUT:
  84. RETVAL
  85. Uint8
  86. pixelformat_Bshift( pixelformat )
  87. SDL_PixelFormat *pixelformat
  88. CODE:
  89. RETVAL = pixelformat->Bshift;
  90. OUTPUT:
  91. RETVAL
  92. Uint8
  93. pixelformat_Gshift( pixelformat )
  94. SDL_PixelFormat *pixelformat
  95. CODE:
  96. RETVAL = pixelformat->Gshift;
  97. OUTPUT:
  98. RETVAL
  99. Uint8
  100. pixelformat_Ashift( pixelformat )
  101. SDL_PixelFormat *pixelformat
  102. CODE:
  103. RETVAL = pixelformat->Ashift;
  104. OUTPUT:
  105. RETVAL
  106. Uint32
  107. pixelformat_Rmask( pixelformat )
  108. SDL_PixelFormat *pixelformat
  109. CODE:
  110. RETVAL = pixelformat->Rmask;
  111. OUTPUT:
  112. RETVAL
  113. Uint32
  114. pixelformat_Bmask( pixelformat )
  115. SDL_PixelFormat *pixelformat
  116. CODE:
  117. RETVAL = pixelformat->Bmask;
  118. OUTPUT:
  119. RETVAL
  120. Uint32
  121. pixelformat_Gmask( pixelformat )
  122. SDL_PixelFormat *pixelformat
  123. CODE:
  124. RETVAL = pixelformat->Gmask;
  125. OUTPUT:
  126. RETVAL
  127. Uint32
  128. pixelformat_Amask( pixelformat )
  129. SDL_PixelFormat *pixelformat
  130. CODE:
  131. RETVAL = pixelformat->Amask;
  132. OUTPUT:
  133. RETVAL
  134. Uint32
  135. pixelformat_colorkey( pixelformat )
  136. SDL_PixelFormat *pixelformat
  137. CODE:
  138. RETVAL = pixelformat->colorkey;
  139. OUTPUT:
  140. RETVAL
  141. Uint8
  142. pixelformat_alpha( pixelformat )
  143. SDL_PixelFormat *pixelformat
  144. CODE:
  145. RETVAL = pixelformat->alpha;
  146. OUTPUT:
  147. RETVAL
  148. void
  149. pixelformat_DESTROY ( bag )
  150. SV *bag
  151. CODE:
  152. objDESTROY(bag, safefree);