home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / coders / mesa-1.2.8 / include / gl / wmesa.h < prev    next >
C/C++ Source or Header  |  1996-05-27  |  3KB  |  116 lines

  1. /* $Id: wmesa.h,v 1.1 1995/10/17 21:51:43 brianp Exp $ */
  2.  
  3. /*
  4.  * Mesa 3-D graphics library
  5.  * Version:  1.2
  6.  * Copyright (C) 1995  Brian Paul  (brianp@ssec.wisc.edu)
  7.  *
  8.  * This library is free software; you can redistribute it and/or
  9.  * modify it under the terms of the GNU Library General Public
  10.  * License as published by the Free Software Foundation; either
  11.  * version 2 of the License, or (at your option) any later version.
  12.  *
  13.  * This library is distributed in the hope that it will be useful,
  14.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  16.  * Library General Public License for more details.
  17.  *
  18.  * You should have received a copy of the GNU Library General Public
  19.  * License along with this library; if not, write to the Free
  20.  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  *
  22.  * Windows driver by: Mark E. Peterson (markp@ic.mankato.mn.us)
  23.  *
  24.  */
  25.  
  26.  
  27. /*
  28. $Log: wmesa.h,v $
  29.  * Revision 1.1  1995/10/17  21:51:43  brianp
  30.  * Initial revision
  31.  *
  32.  */
  33.  
  34.  
  35.  
  36. #ifndef WMESA_H
  37. #define WMESA_H
  38.  
  39.  
  40. #ifdef __cplusplus
  41. extern "C" {
  42. #endif
  43.  
  44.  
  45. #include <windows.h>
  46. #include "gl\gl.h"
  47.  
  48.  
  49. /*
  50.  * This is the WMesa context 'handle':
  51.  */
  52. typedef struct wmesa_context *WMesaContext;
  53.  
  54.  
  55.  
  56. /*
  57.  * Create a new WMesaContext for rendering into a window.  You must
  58.  * have already created the window of correct visual type and with an
  59.  * appropriate colormap.
  60.  *
  61.  * Input:
  62.  *         hWnd - Window handle
  63.  *         Pal  - Palette to use
  64.  *         rgb_flag - GL_TRUE = RGB mode,
  65.  *                    GL_FALSE = color index mode
  66.  *         db_flag - GL_TRUE = double-buffered,
  67.  *                   GL_FALSE = single buffered
  68.  *
  69.  * Note: Indexed mode requires double buffering under Windows.
  70.  *
  71.  * Return:  a WMesa_context or NULL if error.
  72.  */
  73. extern WMesaContext WMesaCreateContext(HWND hWnd,HPALETTE Pal,
  74.                                        GLboolean rgb_flag,GLboolean db_flag);
  75.  
  76.  
  77. /*
  78.  * Destroy a rendering context as returned by WMesaCreateContext()
  79.  */
  80. extern void WMesaDestroyContext( WMesaContext ctx );
  81.  
  82.  
  83. /*
  84.  * Make the specified context the current one.
  85.  */
  86. extern void WMesaMakeCurrent( WMesaContext ctx );
  87.  
  88.  
  89. /*
  90.  * Return a handle to the current context.
  91.  */
  92. extern WMesaContext WMesaGetCurrentContext( void );
  93.  
  94.  
  95. /*
  96.  * Swap the front and back buffers for the current context.  No action
  97.  * taken if the context is not double buffered.
  98.  */
  99. extern void WMesaSwapBuffers(void);
  100.  
  101.  
  102. /*
  103.  * In indexed color mode we need to know when the palette changes.
  104.  */
  105. extern void WMesaPaletteChange(HPALETTE Pal);
  106.  
  107.  
  108.  
  109. #ifdef __cplusplus
  110. }
  111. #endif
  112.  
  113.  
  114. #endif
  115.  
  116.