/*****************************************************************************
 * $Id: gfx.hh,v 1.64 2006/11/02 02:26:17 devel Exp $
 * @file
 * @author	Jim E. Brooks  http://www.jimbrooks.org
 * @brief	Main header file.
 *//*
 * LEGAL:	COPYRIGHT (C) 2004 JIM E. BROOKS
 *          THIS SOURCE CODE IS RELEASED UNDER THE TERMS
 *          OF THE GNU GENERAL PUBLIC LICENSE (GPL).
 *****************************************************************************/

#ifndef GFX_HH
#define GFX_HH 1

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

// Include graphics system header files.
#if GFXSYS_OPENGL
#   ifndef GL_GLEXT_PROTOTYPES
#       define GL_GLEXT_PROTOTYPES 1  // Kludge?  Or does OpenGL require apps to define it?
#   endif
#	ifdef __APPLE_CC__
#		include <GLUT/glut.h>
#   else
#		include <GL/glut.h>
#   endif
// No new OpenGL extensions are actually used, rather,
// standard features in recent OpenGL were once extensions.
#include <GL/gl.h>
#include <GL/glext.h>
#endif

// STATS and DEBUG are tied together (debug and stats code reside at eng_debug).
#ifndef STATS
#if DEBUG
#define STATS 1
#else
#define STATS 0
#endif
#endif

// Whether to use zlib/gzip compression.
#ifndef GFX_ZLIB
#define GFX_ZLIB 1
#endif

// These header files are usually needed.
#include "gfx_assert.hh"
#include "gfx_cc.hh"
#include "gfx_os.hh"
#include "gfx_defs.hh"
#include "gfx_funcs.hh"
#include "gfx_typesig_defs.hh"
#include "gfx_typesig.hh"
#include "gfx_types.hh"
#include "gfx_safe_ptr.hh"
#include "gfx_funcs2.hh"
#if DEBUG
#include "gfx_debug.hh"
#endif

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

namespace gfx {

extern bool gExitingGfx;

bool
GFX_INIT( const string& appname );

void
GFX_CLEANUP( void );

void
GFX_SET_APPNAME( const string& appname );

string
GFX_GET_APPNAME( void );

#if GFX_CC

static void
GfxOpenStreams( void );

static void
GfxCloseStreams( void );

#endif // GFX_CC

// Streams for printing to console.
extern ostream* gStreamOut;
extern ostream* gStreamError;
extern ostream* gStreamDebug;

} // namespace gfx

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

#endif // GFX_HH
 
// For public release (release_palomino.sh)
#ifndef PUBLIC_RELEASE
#define PUBLIC_RELEASE 1
#endif
