/opengles/src/OGLES.h

http://ftk.googlecode.com/ · C Header · 181 lines · 105 code · 32 blank · 44 comment · 3 complexity · c1b2e2c9c68d86614dbe99e003763a4a MD5 · raw file

  1. #ifndef EGL_OGLES_H
  2. #define EGL_OGLES_H 1
  3. // ==========================================================================
  4. //
  5. // OGLES.h Base include file for 3D Rendering Library
  6. //
  7. // --------------------------------------------------------------------------
  8. //
  9. // 10-02-2003 Hans-Martin Will initial version
  10. // 12-17-2003 Hans-Martin Will added configuration information
  11. //
  12. // --------------------------------------------------------------------------
  13. //
  14. // Copyright (c) 2004, Hans-Martin Will. All rights reserved.
  15. //
  16. // Redistribution and use in source and binary forms, with or without
  17. // modification, are permitted provided that the following conditions are
  18. // met:
  19. //
  20. // * Redistributions of source code must retain the above copyright
  21. // notice, this list of conditions and the following disclaimer.
  22. // * Redistributions in binary form must reproduce the above copyright
  23. // notice, this list of conditions and the following disclaimer in the
  24. // documentation and/or other materials provided with the distribution.
  25. //
  26. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  27. // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  28. // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  29. // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  30. // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
  31. // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  32. // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  33. // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  34. // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  35. // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  36. // THE POSSIBILITY OF SUCH DAMAGE.
  37. //
  38. // ==========================================================================
  39. #ifdef EGL_ON_WINCE
  40. #ifndef STATIC_GLES
  41. # ifdef OGLES_EXPORTS
  42. # define OGLES_API __declspec(dllexport)
  43. # else
  44. # define OGLES_API __declspec(dllimport)
  45. # endif
  46. #else
  47. #define OGLES_API
  48. #endif
  49. #endif
  50. #ifdef EGL_ON_SYMBIAN
  51. # define EGL_USE_TOP_DOWN_SURFACE
  52. # ifdef OGLES_EXPORTS
  53. # define OGLES_API EXPORT_C
  54. # else
  55. # define OGLES_API IMPORT_C
  56. # endif
  57. #endif
  58. #ifdef EGL_ON_LINUX
  59. # define OGLES_API
  60. # define APIENTRY
  61. #endif
  62. #if (defined(ARM) || defined(_ARM_) || defined(__MARM__)) && !defined(EGL_NO_COMPILE)
  63. # define EGL_USE_JIT 1
  64. #else
  65. # define EGL_USE_JIT 0
  66. #endif
  67. #ifndef EGL_RELEASE
  68. # define EGL_RELEASE "x.yy"
  69. #endif
  70. #define EGL_CONFIG_VENDOR "Hans-Martin Will"
  71. #define EGL_CONFIG_VERSION "OpenGL ES-CM 1.1"
  72. #define EGL_CONFIG_EXTENSIONS "GL_OES_fixed_point "\
  73. "GL_OES_single_precision "\
  74. "GL_OES_read_format "\
  75. "GL_OES_query_matrix "\
  76. "GL_OES_matrix_palette "\
  77. "GL_OES_point_size_array "\
  78. "GL_OES_point_sprite "\
  79. "GL_OES_compressed_paletted_texture"
  80. #ifdef EGL_USE_GPP
  81. # define EGL_CONFIG_RENDERER "Software GPP"
  82. #else
  83. # define EGL_CONFIG_RENDERER "Software"
  84. #endif
  85. #if EGL_USE_JIT
  86. # define EGL_JIT_VERSION " JIT"
  87. #else
  88. # define EGL_JIT_VERSION " No JIT"
  89. #endif
  90. #define EGL_VERSION_NUMBER EGL_RELEASE " " EGL_CONFIG_RENDERER EGL_JIT_VERSION
  91. #define EGL_NUM_TEXTURE_UNITS 2
  92. #define EGL_MIPMAP_PER_TEXEL 1
  93. // --------------------------------------------------------------------------
  94. // type definitions
  95. // --------------------------------------------------------------------------
  96. #ifndef EGL_USE_GPP // define only if not including Intel's GPP library
  97. # ifdef EGL_ON_SYMBIAN
  98. typedef TInt8 I8;
  99. typedef TUint8 U8;
  100. typedef TInt16 I16;
  101. typedef TUint16 U16;
  102. typedef TInt I32;
  103. typedef TUint U32;
  104. # else
  105. typedef signed char I8;
  106. typedef unsigned char U8;
  107. typedef short I16;
  108. typedef unsigned short U16;
  109. typedef int I32;
  110. typedef unsigned int U32;
  111. # endif
  112. #endif
  113. #ifdef EGL_XSCALE
  114. #define EGL_USE_CLZ
  115. #endif
  116. #ifdef EGL_ON_WINCE
  117. typedef unsigned __int64 U64;
  118. typedef __int64 I64;
  119. #endif
  120. #ifdef EGL_ON_LINUX
  121. typedef unsigned long long U64;
  122. typedef long long I64;
  123. #define INVALID_HANDLE_VALUE NULL
  124. #endif
  125. #ifdef EGL_ON_SYMBIAN
  126. typedef TInt64X U64;
  127. typedef TInt64X I64;
  128. namespace EGL {
  129. class Context;
  130. class Config;
  131. struct TlsInfo {
  132. TlsInfo();
  133. ~TlsInfo();
  134. Context * m_Context;
  135. Config* m_AllConfigurations;
  136. I32 m_LastError;
  137. };
  138. }
  139. #endif
  140. // --------------------------------------------------------------------------
  141. // Memory helper macros
  142. // --------------------------------------------------------------------------
  143. // number of elements of an array
  144. #define elementsof(a) (sizeof(a) / sizeof(*(a)))
  145. // offset in bytes of a structure member from the base address
  146. #ifndef offsetof
  147. #define offsetof(s,m) (size_t)&(((s *)0)->m)
  148. #endif
  149. #endif // ndef EGL_OGLES_H