/*****************************************************************************
 * $Id: eng_opengl.hh,v 1.35 2006/10/24 02:05:24 devel Exp $
 * @file
 * @author	Jim E. Brooks  http://www.jimbrooks.org
 * @brief	OpenGL-specific functions.
 *//*
 * LEGAL:	COPYRIGHT (C) 2004 JIM E. BROOKS
 *          THIS SOURCE CODE IS RELEASED UNDER THE TERMS
 *          OF THE GNU GENERAL PUBLIC LICENSE (GPL).
 *****************************************************************************/

#if COMPILING_ENGINE
#if GFXSYS_OPENGL
#ifndef ENG_OPENGL_HH
#define ENG_OPENGL_HH 1

// OpenGL matrix is always 4x4.
#define OPENGL_MATRIX_ELEMS     16

//------------------------------------------------------------------------------

void
OpenglInit( int* pargc, char** argv, const GfxsysParms* parms );

void
OpenglRun( void );

void
OpenglReshape( int w, int h );

void
OpenglSetViewportGeom( const Geom<int>& geom );

void
OpenglDisplayPreFrame( void );

void
OpenglDisplayPostFrame( void );

void
OpenglProject( int pt[2]/*OUT*/, const EyeVertex& v );

class VertexArray;
class DrawParm;
void
OpenglDrawVertexArray( VertexArray* const va, const EyeVertex* const ev, const DrawParm& drawParm );

void
OpenglSetFrustum( const fp frustumFar );

//------------------------------------------------------------------------------
#if ENG_OPENGL_CC

static void
OpenglInit2( void );

static void
OpenglDisplayCallback( void );

static void
OpenglTimer( int unused );

static void
OpenglMouseButtonHandler( int button, int state, int x, int y );

static void
OpenglMouseMotionPassiveHandler( int x, int y );

static void
OpenglMouseMotionHandler( int x, int y );

static void
PrepOpenglDrawVertexArray( void );

static void
OpenglResetModelViewMatrix( void );

#endif // ENG_OPENGL_CC
//------------------------------------------------------------------------------

#endif // ENG_OPENGL_HH
#endif // GFXSYS_OPENGL
#endif // COMPILING_ENGINE
