b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync/*
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * Mesa 3-D graphics library
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * Version: 3.0
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * Copyright (C) 1995-1998 Brian Paul
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync *
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * This library is free software; you can redistribute it and/or
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * modify it under the terms of the GNU Library General Public
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * License as published by the Free Software Foundation; either
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * version 2 of the License, or (at your option) any later version.
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync *
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * This library is distributed in the hope that it will be useful,
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * but WITHOUT ANY WARRANTY; without even the implied warranty of
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * Library General Public License for more details.
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync *
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * You should have received a copy of the GNU Library General Public
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * License along with this library; if not, write to the Free
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync *
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync */
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync/*
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * Windows driver by: Mark E. Peterson (markp@ic.mankato.mn.us)
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * Updated by Li Wei (liwei@aiar.xjtu.edu.cn)
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync *
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync *
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync ***************************************************************
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * WMesa *
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * version 2.3 *
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * *
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * By *
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * Li Wei *
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * Institute of Artificial Intelligence & Robotics *
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * Xi'an Jiaotong University *
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * Email: liwei@aiar.xjtu.edu.cn *
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * Web page: http://sun.aiar.xjtu.edu.cn *
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * *
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * July 7th, 1997 *
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync ***************************************************************
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync */
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync#ifndef WMESA_H
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync#define WMESA_H
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync#ifdef __cplusplus
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsyncextern "C" {
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync#endif
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync#include "GL/gl.h"
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync#if defined(_MSV_VER) && !defined(__GNUC__)
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync# pragma warning (disable:4273)
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync# pragma warning( disable : 4244 ) /* '=' : conversion from 'const double ' to 'float ', possible loss of data */
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync# pragma warning( disable : 4018 ) /* '<' : signed/unsigned mismatch */
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync# pragma warning( disable : 4305 ) /* '=' : truncation from 'const double ' to 'float ' */
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync# pragma warning( disable : 4013 ) /* 'function' undefined; assuming extern returning int */
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync# pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync# pragma warning( disable : 4273 ) /* 'identifier' : inconsistent DLL linkage. dllexport assumed */
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync# if (MESA_WARNQUIET>1)
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync# pragma warning( disable : 4146 ) /* unary minus operator applied to unsigned type, result still unsigned */
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync# endif
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync#endif
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync/*
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * This is the WMesa context 'handle':
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync */
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsynctypedef struct wmesa_context *WMesaContext;
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync/*
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * Create a new WMesaContext for rendering into a window. You must
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * have already created the window of correct visual type and with an
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * appropriate colormap.
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync *
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * Input:
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * hDC - Windows device or memory context
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * Pal - Palette to use
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * rgb_flag - GL_TRUE = RGB mode,
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * GL_FALSE = color index mode
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * db_flag - GL_TRUE = double-buffered,
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * GL_FALSE = single buffered
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * alpha_flag - GL_TRUE = create software alpha buffer,
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * GL_FALSE = no software alpha buffer
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync *
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * Note: Indexed mode requires double buffering under Windows.
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync *
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * Return: a WMesa_context or NULL if error.
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync */
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsyncextern WMesaContext WMesaCreateContext(HDC hDC,HPALETTE* pPal,
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync GLboolean rgb_flag,
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync GLboolean db_flag,
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync GLboolean alpha_flag);
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync/*
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * Destroy a rendering context as returned by WMesaCreateContext()
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync */
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsyncextern void WMesaDestroyContext( WMesaContext ctx );
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync/*
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * Make the specified context the current one.
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync */
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsyncextern void WMesaMakeCurrent( WMesaContext ctx, HDC hdc );
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync/*
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * Return a handle to the current context.
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync */
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsyncextern WMesaContext WMesaGetCurrentContext( void );
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync/*
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * Swap the front and back buffers for the current context. No action
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * taken if the context is not double buffered.
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync */
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsyncextern void WMesaSwapBuffers(HDC hdc);
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync/*
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync * In indexed color mode we need to know when the palette changes.
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync */
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsyncextern void WMesaPaletteChange(HPALETTE Pal);
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsyncextern void WMesaMove(void);
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsyncvoid WMesaShareLists(WMesaContext ctx_to_share, WMesaContext ctx);
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync#ifdef __cplusplus
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync}
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync#endif
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync#endif
b6251cd7c3ee1990339b293f31a18bccb5602ef8vboxsync