Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

121 lines
5.0 KiB

  1. /*
  2. ** Copyright 1995-2095, Silicon Graphics, Inc.
  3. ** All Rights Reserved.
  4. **
  5. ** This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6. ** the contents of this file may not be disclosed to third parties, copied or
  7. ** duplicated in any form, in whole or in part, without the prior written
  8. ** permission of Silicon Graphics, Inc.
  9. **
  10. ** RESTRICTED RIGHTS LEGEND:
  11. ** Use, duplication or disclosure by the Government is subject to restrictions
  12. ** as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13. ** and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14. ** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15. ** rights reserved under the Copyright Laws of the United States.
  16. */
  17. #include "glslib.h"
  18. void __glsGenPixelSetup_pack(__GLScontext *ctx) {
  19. __GLS_BEGIN_CAPTURE_EXEC(ctx, GLS_OP_glPixelStorei);
  20. __glsPixelSetup_pack();
  21. __GLS_END_CAPTURE_EXEC(ctx, GLS_OP_glPixelStorei);
  22. }
  23. void __glsGenPixelSetup_unpack(__GLScontext *ctx) {
  24. __GLS_BEGIN_CAPTURE_EXEC(ctx, GLS_OP_glPixelStorei);
  25. __glsPixelSetup_unpack();
  26. __GLS_END_CAPTURE_EXEC(ctx, GLS_OP_glPixelStorei);
  27. }
  28. void __glsPixelSetup_pack(void) {
  29. glPixelStorei(GL_PACK_ALIGNMENT, 1);
  30. glPixelStorei(GL_PACK_LSB_FIRST, GL_FALSE);
  31. glPixelStorei(GL_PACK_ROW_LENGTH, 0);
  32. glPixelStorei(GL_PACK_SKIP_ROWS, 0);
  33. glPixelStorei(GL_PACK_SKIP_PIXELS, 0);
  34. glPixelStorei(GL_PACK_SWAP_BYTES, GL_FALSE);
  35. #if __GL_EXT_texture3D
  36. glPixelStorei(GL_PACK_IMAGE_HEIGHT_EXT, 0);
  37. glPixelStorei(GL_PACK_SKIP_IMAGES_EXT, 0);
  38. #endif /* __GL_EXT_texture3D */
  39. #if __GL_SGIS_texture4D
  40. glPixelStorei(GL_PACK_IMAGE_DEPTH_SGIS, 0);
  41. glPixelStorei(GL_PACK_SKIP_VOLUMES_SGIS, 0);
  42. #endif /* __GL_SGIS_texture4D */
  43. }
  44. void __glsPixelSetup_unpack(void) {
  45. glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
  46. glPixelStorei(GL_UNPACK_LSB_FIRST, GL_FALSE);
  47. glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
  48. glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
  49. glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
  50. glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE);
  51. #if __GL_EXT_texture3D
  52. glPixelStorei(GL_UNPACK_IMAGE_HEIGHT_EXT, 0);
  53. glPixelStorei(GL_UNPACK_SKIP_IMAGES_EXT, 0);
  54. #endif /* __GL_EXT_texture3D */
  55. #if __GL_SGIS_texture4D
  56. glPixelStorei(GL_UNPACK_IMAGE_DEPTH_SGIS, 0);
  57. glPixelStorei(GL_UNPACK_SKIP_VOLUMES_SGIS, 0);
  58. #endif /* __GL_SGIS_texture4D */
  59. }
  60. static void __glsPixelStoreConfig_init(__GLSpixelStoreConfig *outConfig) {
  61. outConfig->alignment = 1;
  62. outConfig->lsbFirst = GL_FALSE;
  63. outConfig->rowLength = 0;
  64. outConfig->skipRows = 0;
  65. outConfig->skipPixels = 0;
  66. outConfig->swapBytes = GL_FALSE;
  67. #if __GL_EXT_texture3D
  68. outConfig->imageHeight = 0;
  69. outConfig->skipImages = 0;
  70. #endif /* __GL_EXT_texture3D */
  71. #if __GL_SGIS_texture4D
  72. outConfig->imageDepth = 0;
  73. outConfig->skipVolumes = 0;
  74. #endif /* __GL_SGIS_texture4D */
  75. }
  76. void __glsPixelStoreConfig_get_pack(__GLSpixelStoreConfig *outConfig) {
  77. __glsPixelStoreConfig_init(outConfig);
  78. __GLS_BEGIN_CAPTURE_EXEC(__GLS_CONTEXT, GLS_OP_glGetIntegerv);
  79. glGetIntegerv(GL_PACK_ALIGNMENT, &outConfig->alignment);
  80. glGetIntegerv(GL_PACK_LSB_FIRST, &outConfig->lsbFirst);
  81. glGetIntegerv(GL_PACK_ROW_LENGTH, &outConfig->rowLength);
  82. glGetIntegerv(GL_PACK_SKIP_ROWS, &outConfig->skipRows);
  83. glGetIntegerv(GL_PACK_SKIP_PIXELS, &outConfig->skipPixels);
  84. glGetIntegerv(GL_PACK_SWAP_BYTES, &outConfig->swapBytes);
  85. #if __GL_EXT_texture3D
  86. glGetIntegerv(GL_PACK_IMAGE_HEIGHT_EXT, &outConfig->imageHeight);
  87. glGetIntegerv(GL_PACK_SKIP_IMAGES_EXT, &outConfig->skipImages);
  88. #endif /* __GL_EXT_texture3D */
  89. #if __GL_SGIS_texture4D
  90. glGetIntegerv(GL_PACK_IMAGE_DEPTH_SGIS, &outConfig->imageDepth);
  91. glGetIntegerv(GL_PACK_SKIP_VOLUMES_SGIS, &outConfig->skipVolumes);
  92. #endif /* __GL_SGIS_texture4D */
  93. __GLS_END_CAPTURE_EXEC(__GLS_CONTEXT, GLS_OP_glGetIntegerv);
  94. }
  95. void __glsPixelStoreConfig_get_unpack(__GLSpixelStoreConfig *outConfig) {
  96. __glsPixelStoreConfig_init(outConfig);
  97. __GLS_BEGIN_CAPTURE_EXEC(__GLS_CONTEXT, GLS_OP_glGetIntegerv);
  98. glGetIntegerv(GL_UNPACK_ALIGNMENT, &outConfig->alignment);
  99. glGetIntegerv(GL_UNPACK_LSB_FIRST, &outConfig->lsbFirst);
  100. glGetIntegerv(GL_UNPACK_ROW_LENGTH, &outConfig->rowLength);
  101. glGetIntegerv(GL_UNPACK_SKIP_ROWS, &outConfig->skipRows);
  102. glGetIntegerv(GL_UNPACK_SKIP_PIXELS, &outConfig->skipPixels);
  103. glGetIntegerv(GL_UNPACK_SWAP_BYTES, &outConfig->swapBytes);
  104. #if __GL_EXT_texture3D
  105. glGetIntegerv(GL_UNPACK_IMAGE_HEIGHT_EXT, &outConfig->imageHeight);
  106. glGetIntegerv(GL_UNPACK_SKIP_IMAGES_EXT, &outConfig->skipImages);
  107. #endif /* __GL_EXT_texture3D */
  108. #if __GL_SGIS_texture4D
  109. glGetIntegerv(GL_UNPACK_IMAGE_DEPTH_SGIS, &outConfig->imageDepth);
  110. glGetIntegerv(GL_UNPACK_SKIP_VOLUMES_SGIS, &outConfig->skipVolumes);
  111. #endif /* __GL_SGIS_texture4D */
  112. __GLS_END_CAPTURE_EXEC(__GLS_CONTEXT, GLS_OP_glGetIntegerv);
  113. }