/*****************************************************************************
 * $Id: gfx_defs.hh,v 1.15 2005/10/23 20:47:23 devel Exp $
 * @file
 * @author	Jim E. Brooks  http://www.jimbrooks.org
 * @brief	Definitions, constants.
 *//*
 * LEGAL:	COPYRIGHT (C) 2004 JIM E. BROOKS
 *          THIS SOURCE CODE IS RELEASED UNDER THE TERMS
 *          OF THE GNU GENERAL PUBLIC LICENSE (GPL).
 *****************************************************************************/

#ifndef GFX_DEFS_HH
#define GFX_DEFS_HH 1

#include "gfx_os.hh"

namespace gfx {

/////////////////////////////////
// definitions, constants
#undef  FALSE
#undef  TRUE
#define FALSE 0
#define TRUE  1
#define CHAR_LF	'\n'
#define CHAR_CR	'\r'

/////////////////////////////////
// enums
enum { XX, YY, ZZ };	// for searchability on any indexed 3D struct rather than [0..2]
enum { AXIS_X, AXIS_Y, AXIS_Z };

///////////////////////
// @def Numeric limits.
// *_LARGE are the largest positive values.
// *_SMALL are the smallest negative values.
// Defined by limits.h: INT_MIN, INT_MAX, UINT_MAX
// Defined by float.h: FLT_MAX, FLT_MIN
#ifdef INT_MIN
#	define INT_SMALL	(INT_MIN)
#else
#	define INT_SMALL	(-0x80000000)	// minus sign for 64-bit arch
#endif
#ifdef INT_MAX
#	define INT_LARGE	(INT_MAX)
#else
#	define INT_LARGE	(0x7fffffff)
#endif
// NOTE: Use FEQ_FLOAT_SMALL(),FEQ_FLOAT_LARGE() to test equality: ==/!= will fail!
#define FLOAT_SMALL (-9999999999.0)		// FLOAT_SMALL is supposed to be negative
#define FLOAT_LARGE ( 9999999999.0)		// so it cannot be based on FLT_MIN which is zero.

/// @def ILLEGAL_PTR
/// ILLEGAL_PTR is a non-zero value for initializing/asserting pointers
/// that normally can hold either a non-NULL or NULL address.
#define ILLEGAL_PTR ((void*)13) // an unlucky address in the faulty zero page

// DEBUG_FLAG is guaranteed to be 0 or 1 (DEBUG may be undefined).
#ifndef DEBUG_FLAG
#	if DEBUG
#		define DEBUG_FLAG 1
#	else
#		define DEBUG_FLAG 0
#	endif
#endif

// -- deprecated --
const uint GFX_MAX_STR_LEN = 1024;

} // namespace gfx

#endif // GFX_DEFS_HH
