Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

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