Clone of mesa.
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.

wmesa.h 5.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. /* $Id: wmesa.h,v 1.2 2002/04/23 18:23:32 kschultz Exp $ */
  2. /*
  3. * Mesa 3-D graphics library
  4. * Version: 3.0
  5. * Copyright (C) 1995-1998 Brian Paul
  6. *
  7. * This library is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Library General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2 of the License, or (at your option) any later version.
  11. *
  12. * This library is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Library General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Library General Public
  18. * License along with this library; if not, write to the Free
  19. * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. *
  21. */
  22. /*
  23. * $Log: wmesa.h,v $
  24. * Revision 1.2 2002/04/23 18:23:32 kschultz
  25. * Fix up alpha buffer handling for Windows.
  26. * - add two new Pixel Format Descriptors that do not have alpha bits to
  27. * mirror the two that do.
  28. * - add logic to wglChoosePixelFormat to match PFD's with respect to alpha.
  29. * - Create/clear software alpha buffer as required.
  30. * Now a wgl or GLUT program can control the creation of a software alpha
  31. * buffer via the PFD or GLUT parms, respectively.
  32. *
  33. * Revision 1.1.1.1 1999/08/19 00:55:40 jtg
  34. * Imported sources
  35. *
  36. * Revision 3.2 1999/01/03 02:54:45 brianp
  37. * updated per Ted Jump
  38. *
  39. * Revision 3.1 1998/12/01 02:34:27 brianp
  40. * applied Mark Kilgard's patches from November 30, 1998
  41. *
  42. * Revision 3.0 1998/02/20 05:06:59 brianp
  43. * initial rev
  44. *
  45. */
  46. /*
  47. * Windows driver by: Mark E. Peterson (markp@ic.mankato.mn.us)
  48. * Updated by Li Wei (liwei@aiar.xjtu.edu.cn)
  49. *
  50. *
  51. ***************************************************************
  52. * WMesa *
  53. * version 2.3 *
  54. * *
  55. * By *
  56. * Li Wei *
  57. * Institute of Artificial Intelligence & Robotics *
  58. * Xi'an Jiaotong University *
  59. * Email: liwei@aiar.xjtu.edu.cn *
  60. * Web page: http://sun.aiar.xjtu.edu.cn *
  61. * *
  62. * July 7th, 1997 *
  63. ***************************************************************
  64. */
  65. #ifndef WMESA_H
  66. #define WMESA_H
  67. #ifdef __cplusplus
  68. extern "C" {
  69. #endif
  70. #include "gl\gl.h"
  71. #pragma warning (disable:4273)
  72. #pragma warning( disable : 4244 ) /* '=' : conversion from 'const double ' to 'float ', possible loss of data */
  73. #pragma warning( disable : 4018 ) /* '<' : signed/unsigned mismatch */
  74. #pragma warning( disable : 4305 ) /* '=' : truncation from 'const double ' to 'float ' */
  75. #pragma warning( disable : 4013 ) /* 'function' undefined; assuming extern returning int */
  76. #pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */
  77. #pragma warning( disable : 4273 ) /* 'identifier' : inconsistent DLL linkage. dllexport assumed */
  78. #if (MESA_WARNQUIET>1)
  79. # pragma warning( disable : 4146 ) /* unary minus operator applied to unsigned type, result still unsigned */
  80. #endif
  81. /*
  82. * This is the WMesa context 'handle':
  83. */
  84. typedef struct wmesa_context *WMesaContext;
  85. /*
  86. * Create a new WMesaContext for rendering into a window. You must
  87. * have already created the window of correct visual type and with an
  88. * appropriate colormap.
  89. *
  90. * Input:
  91. * hWnd - Window handle
  92. * Pal - Palette to use
  93. * rgb_flag - GL_TRUE = RGB mode,
  94. * GL_FALSE = color index mode
  95. * db_flag - GL_TRUE = double-buffered,
  96. * GL_FALSE = single buffered
  97. * alpha_flag - GL_TRUE = create software alpha buffer,
  98. * GL_FALSE = no software alpha buffer
  99. *
  100. * Note: Indexed mode requires double buffering under Windows.
  101. *
  102. * Return: a WMesa_context or NULL if error.
  103. */
  104. extern WMesaContext WMesaCreateContext(HWND hWnd,HPALETTE* pPal,
  105. GLboolean rgb_flag,
  106. GLboolean db_flag,
  107. GLboolean alpha_flag);
  108. /*
  109. * Destroy a rendering context as returned by WMesaCreateContext()
  110. */
  111. /*extern void WMesaDestroyContext( WMesaContext ctx );*/
  112. extern void WMesaDestroyContext( void );
  113. /*
  114. * Make the specified context the current one.
  115. */
  116. extern void WMesaMakeCurrent( WMesaContext ctx );
  117. /*
  118. * Return a handle to the current context.
  119. */
  120. extern WMesaContext WMesaGetCurrentContext( void );
  121. /*
  122. * Swap the front and back buffers for the current context. No action
  123. * taken if the context is not double buffered.
  124. */
  125. extern void WMesaSwapBuffers(void);
  126. /*
  127. * In indexed color mode we need to know when the palette changes.
  128. */
  129. extern void WMesaPaletteChange(HPALETTE Pal);
  130. extern void WMesaMove(void);
  131. #ifdef __cplusplus
  132. }
  133. #endif
  134. #endif