CGL.H 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. #ifndef __CGL__
  2. #define __CGL__
  3. /*********************************************************************
  4. cgl.h
  5. Copyright (c) Creative Technology Ltd. 1994-1995. All Rights Reserved.
  6. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  7. KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  8. IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  9. PURPOSE.
  10. *********************************************************************/
  11. /*
  12. * @@ SOURCE DOCUMENTATION
  13. *
  14. * TITLE : cgl.h
  15. *
  16. * VERSION : 0.01
  17. *
  18. * DATE : 1 December 1994
  19. *
  20. * AUTHOR : Philip Teo
  21. * Toh Chin Kok
  22. * Burak Alp
  23. *
  24. * BRIEF : This file includes the function prototypes of all
  25. * the graphic library supported
  26. *
  27. * @@ LOG CHANGE
  28. * DATE VERSION REV DESCRIPTION
  29. * 13 Feb 95 1.0 Philip Teo First library version
  30. * 11 Mar 95 1.1 Philip Teo Second library version
  31. * 11 Apr 95 1.2 Philip Teo Third library fixed point version
  32. */
  33. #if (defined(__WATCOMC__) || defined(__SC__))
  34. #define __32BIT_COMPILER__
  35. #elif defined(WIN32)
  36. #define __W32BIT_COMPILER__
  37. #endif
  38. #include "cgltype.h"
  39. #include "cglerr.h"
  40. #include "cgldef.h"
  41. #ifdef WIN32
  42. #include "cglwin.h"
  43. #endif
  44. #ifdef __cplusplus
  45. extern "C" {
  46. #endif
  47. /////////////////////////////
  48. // Prototypes declaration //
  49. /////////////////////////////
  50. ////////////////////////////////////////////////////////////////////
  51. // Primitive Operation Function //
  52. ////////////////////////////////////////////////////////////////////
  53. // //
  54. // cglSendStream - Function to perform block operation for //
  55. // render, copy, upload and download //
  56. // cglGetPixel - Function to get pixel color //
  57. // cglPutPixel - Function to put pixel color //
  58. // //
  59. // //
  60. ////////////////////////////////////////////////////////////////////
  61. extern CGL_INT16 CGL_API(cglSendStream)(CGL_PTR, CGL_UINT16);
  62. extern CGL_INT16 CGL_API(cglGetPixel)(CGL_TYPE, CGL_TYPE, CGL_COLOR_PST);
  63. extern CGL_INT16 CGL_API(cglPutPixel)(CGL_TYPE, CGL_TYPE ,CGL_COLOR_PST);
  64. ////////////////////////////////////////////////////////////////////
  65. // Screen/Window Functions //
  66. ////////////////////////////////////////////////////////////////////
  67. // //
  68. // cglInitScreen - Initialise screen device & configuration //
  69. // cglQueryScreen - Query for valid screen configuration //
  70. // cglClearScreen - Clear thes screen //
  71. // cglCloseScreen - Close the screen device //
  72. // cglSetWindowClip - Set the clipping window within the screen //
  73. // cglInitPan - Initialise pan mode //
  74. // cglSetPanPos - Set panning position //
  75. // //
  76. ////////////////////////////////////////////////////////////////////
  77. extern CGL_INT16 CGL_API(cglInitScreen)(CGL_SCREEN_PST);
  78. extern CGL_INT16 CGL_API(cglQueryScreen)(CGL_SCREEN_PST);
  79. extern CGL_INT16 CGL_API(cglClearScreen)(void);
  80. extern CGL_INT16 CGL_API(cglCloseScreen)(void);
  81. extern CGL_INT16 CGL_API(cglSetWindowClip)(CGL_RECT_PST);
  82. extern CGL_INT16 CGL_API(cglInitPan)(CGL_UINT16 *);
  83. extern CGL_INT16 CGL_API(cglPanPos)(CGL_UINT16, CGL_UINT16);
  84. ////////////////////////////////////////////////////////////////////
  85. // Primitive Property Functions //
  86. ////////////////////////////////////////////////////////////////////
  87. // //
  88. // cglSetLineStyle - Set the line style pattern for line //
  89. // primitive //
  90. // cglSetFillPattern - Set the fill area pattern for area //
  91. // primitive //
  92. // cglSetStipplePattern - Set the stipple pattern for area //
  93. // primitive //
  94. // cglSetDepthMode - Set the depth comparision mode for //
  95. // depth test. //
  96. // cglSetStencilMode - Set the stencil comparision and //
  97. // update methods for stencil test. //
  98. // cglSetLogicalOpsMode - Set the comparision mode for logical //
  99. // operation for frame buffer //
  100. // cglSetDitherMode - Enable or disable dither function //
  101. // //
  102. ////////////////////////////////////////////////////////////////////
  103. extern CGL_INT16 CGL_API(cglSetLineStyle)(CGL_PTR, CGL_UINT32);
  104. extern CGL_INT16 CGL_API(cglSetFillPattern)(CGL_PTR, CGL_UINT32);
  105. extern CGL_INT16 CGL_API(cglSetStipplePattern)(CGL_UINT8 *);
  106. extern CGL_INT16 CGL_API(cglSetDepthMode)(CGL_UINT16);
  107. extern CGL_INT16 CGL_API(cglSetStencilMode)(CGL_UINT16,CGL_UINT16,
  108. CGL_UINT16,CGL_UINT16);
  109. extern CGL_INT16 CGL_API(cglSetLogicalOpsMode)(CGL_UINT16);
  110. extern CGL_INT16 CGL_API(cglSetDepthCueColor)(CGL_COLOR_PST);
  111. extern CGL_INT16 CGL_API(cglSetDitherMode)(CGL_UINT16);
  112. ///////////////////////////////////////////////////////////////////
  113. // Texture Mangement Function //
  114. ///////////////////////////////////////////////////////////////////
  115. // //
  116. // cglLoadTextureMap - Load the texture into free memory //
  117. // space. //
  118. // //
  119. ///////////////////////////////////////////////////////////////////
  120. extern CGL_INT16 CGL_API(cglLoadTextureMap)(CGL_TEXTURELD_PST);
  121. //////////////////////////////////////////////////////////////////
  122. // Buffer Management Function //
  123. //////////////////////////////////////////////////////////////////
  124. // //
  125. // cglSelectRenderBuffer - select render to front/back buffer //
  126. // //
  127. // cglCopyDisplayBuffer - copy front/back buffer //
  128. // //
  129. // cglSetConstant - Set the constant value for clear //
  130. // buffers. //
  131. // cglClearBuffer - Clear multiple buffers to constant //
  132. // value respectively //
  133. // //
  134. // cglSwapBuffer - Swap buffers for double buffering //
  135. // //
  136. //////////////////////////////////////////////////////////////////
  137. extern CGL_INT16 CGL_API(cglSelectRenderBuffer)(CGL_UINT16);
  138. extern CGL_INT16 CGL_API(cglCopyDisplayBuffer)(CGL_UINT16);
  139. extern CGL_INT16 CGL_API(cglLockBuffer)(CGL_UINT16,CGL_FPTR *);
  140. extern CGL_INT16 CGL_API(cglClearBuffer)(CGL_UINT32,CGL_RECT_PST);
  141. extern CGL_INT16 CGL_API(cglSetConstant)(CGL_COLOR_PST,CGL_UINT32,CGL_UINT32);
  142. extern CGL_INT16 CGL_API(cglSwapBuffer)(void);
  143. //////////////////////////////////////////////////////////////////
  144. // Color Management Function //
  145. //////////////////////////////////////////////////////////////////
  146. // //
  147. // cglUpLoad - Retrieve data to host buffer //
  148. // cglDownLoad - Send data from host buffer //
  149. // cglSetPalette - Set the color palette table //
  150. // cglGetPalette - Retrieve color data from palette table //
  151. // //
  152. //////////////////////////////////////////////////////////////////
  153. extern CGL_INT16 CGL_API(cglUpLoad)(CGL_UPDN_PST);
  154. extern CGL_INT16 CGL_API(cglDownLoad)(CGL_UPDN_PST);
  155. extern CGL_INT16 CGL_API(cglSetPalette)(CGL_PTR, CGL_UINT16, CGL_UINT16);
  156. extern CGL_INT16 CGL_API(cglGetPalette)(CGL_PTR, CGL_UINT16, CGL_UINT16);
  157. //////////////////////////////////////////////////////////////////
  158. // Querey Control Function //
  159. //////////////////////////////////////////////////////////////////
  160. // //
  161. // cglSetPickRegion - Set the condition and region of //
  162. // interest to pick //
  163. // cglSetExtentRegion - Set the extent condition //
  164. // cglGetPickResult - Get the result of picking //
  165. // cglGetExtentRegion - Get the extented region //
  166. // cglGetConfig - Get the version of software and //
  167. // hardware supported information //
  168. // cglSetCursor - Set cursor on/off,color and pattern //
  169. // cglSetCursorPos - Set cursor position //
  170. //////////////////////////////////////////////////////////////////
  171. extern CGL_INT16 CGL_API(cglSetPickRegion)(CGL_PICK_PST);
  172. extern CGL_INT16 CGL_API(cglGetPickResult)(CGL_UINT8P);
  173. extern CGL_INT16 CGL_API(cglSetExtent)(CGL_EXTENT_PST);
  174. extern CGL_INT16 CGL_API(cglGetExtentResult)(CGL_RECT_PST);
  175. extern CGL_INT16 CGL_API(cglGetConfig)(CGL_GPCONFIG_PST);
  176. extern CGL_INT16 CGL_API(cglSetCursor)(CGL_UINT8, CGL_COLOR_PST, CGL_UINT8 *);
  177. extern CGL_INT16 CGL_API(cglSetCursorPos)(CGL_UINT16,CGL_UINT16);
  178. extern CGL_INT16 CGL_API(cglSetupInterrupt)(CGL_UINT32, CGL_ISRPROC, CGL_PTR);
  179. extern CGL_INT16 CGL_API(cglReleaseInterrupt)(CGL_UINT32);
  180. //-- For Dynmaic Library
  181. #ifdef CGLCDL
  182. extern CGL_INT16 cglStub();
  183. int cglLoad(char *path);
  184. int cglUnload(void);
  185. #endif
  186. #ifdef __cplusplus
  187. }
  188. #endif
  189. #endif // __CGL_