PageRenderTime 6ms CodeModel.GetById 1ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/opengles/src/OGLES.h

http://ftk.googlecode.com/
C++ Header | 181 lines | 105 code | 32 blank | 44 comment | 3 complexity | c1b2e2c9c68d86614dbe99e003763a4a MD5 | raw file
  1#ifndef EGL_OGLES_H
  2#define EGL_OGLES_H 1
  3
  4// ==========================================================================
  5//
  6// OGLES.h		Base include file for 3D Rendering Library
  7//
  8// --------------------------------------------------------------------------
  9//
 10// 10-02-2003	Hans-Martin Will	initial version
 11// 12-17-2003	Hans-Martin Will	added configuration information
 12//
 13// --------------------------------------------------------------------------
 14//
 15// Copyright (c) 2004, Hans-Martin Will. All rights reserved.
 16// 
 17// Redistribution and use in source and binary forms, with or without 
 18// modification, are permitted provided that the following conditions are 
 19// met:
 20// 
 21//	 *  Redistributions of source code must retain the above copyright
 22// 		notice, this list of conditions and the following disclaimer. 
 23//   *	Redistributions in binary form must reproduce the above copyright
 24// 		notice, this list of conditions and the following disclaimer in the 
 25// 		documentation and/or other materials provided with the distribution. 
 26// 
 27// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 28// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
 29// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
 30// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
 31// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 
 32// OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
 33// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 34// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
 35// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
 36// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 
 37// THE POSSIBILITY OF SUCH DAMAGE.
 38//
 39// ==========================================================================
 40
 41
 42#ifdef EGL_ON_WINCE
 43	#ifndef STATIC_GLES
 44		#	ifdef OGLES_EXPORTS
 45		#		define OGLES_API __declspec(dllexport)
 46		#	else
 47		#		define OGLES_API __declspec(dllimport)
 48		#	endif
 49	#else
 50		#define OGLES_API 
 51	#endif
 52#endif
 53
 54#ifdef EGL_ON_SYMBIAN
 55#   define EGL_USE_TOP_DOWN_SURFACE
 56#	ifdef OGLES_EXPORTS
 57#		define OGLES_API EXPORT_C
 58#	else
 59#		define OGLES_API IMPORT_C
 60#	endif
 61#endif
 62
 63#ifdef EGL_ON_LINUX
 64#  define OGLES_API
 65#  define APIENTRY
 66#endif
 67
 68#if (defined(ARM) || defined(_ARM_) || defined(__MARM__)) && !defined(EGL_NO_COMPILE)
 69#	define EGL_USE_JIT	1
 70#else
 71#	define EGL_USE_JIT  0
 72#endif
 73
 74
 75#ifndef EGL_RELEASE
 76#	define EGL_RELEASE				"x.yy"
 77#endif
 78
 79#define EGL_CONFIG_VENDOR			"Hans-Martin Will"
 80#define EGL_CONFIG_VERSION			"OpenGL ES-CM 1.1"
 81#define EGL_CONFIG_EXTENSIONS		"GL_OES_fixed_point "\
 82									"GL_OES_single_precision "\
 83									"GL_OES_read_format "\
 84									"GL_OES_query_matrix "\
 85									"GL_OES_matrix_palette "\
 86									"GL_OES_point_size_array "\
 87									"GL_OES_point_sprite "\
 88									"GL_OES_compressed_paletted_texture"
 89
 90#ifdef EGL_USE_GPP
 91#	define EGL_CONFIG_RENDERER		"Software GPP"
 92#else
 93#	define EGL_CONFIG_RENDERER		"Software"
 94#endif
 95
 96#if EGL_USE_JIT
 97#	define	EGL_JIT_VERSION			" JIT"
 98#else
 99#	define	EGL_JIT_VERSION			" No JIT"
100#endif
101
102#define EGL_VERSION_NUMBER			EGL_RELEASE " " EGL_CONFIG_RENDERER EGL_JIT_VERSION
103
104#define EGL_NUM_TEXTURE_UNITS		2
105
106#define EGL_MIPMAP_PER_TEXEL		1
107
108// --------------------------------------------------------------------------
109// type definitions
110// --------------------------------------------------------------------------
111
112#ifndef EGL_USE_GPP		// define only if not including Intel's GPP library
113
114#	ifdef EGL_ON_SYMBIAN
115	    typedef TInt8	 I8;
116        typedef TUint8  U8;
117        typedef TInt16  I16;
118        typedef TUint16 U16;
119        typedef TInt    I32;
120        typedef TUint   U32;
121#	else
122	    typedef signed char 		I8;
123	    typedef unsigned char 		U8;
124	    typedef short 				I16;
125	    typedef unsigned short 		U16;
126	    typedef int 				I32;
127	    typedef unsigned int 		U32;
128#	endif
129#endif
130
131#ifdef EGL_XSCALE
132#define EGL_USE_CLZ
133#endif
134
135#ifdef EGL_ON_WINCE
136typedef unsigned __int64	U64;
137typedef __int64				I64;
138#endif
139
140#ifdef EGL_ON_LINUX
141typedef unsigned long long U64;
142typedef long long          I64;
143#define INVALID_HANDLE_VALUE NULL
144#endif
145
146#ifdef EGL_ON_SYMBIAN
147
148typedef TInt64X	U64;
149typedef TInt64X	I64;
150
151
152namespace EGL {
153	class Context;
154    class Config;
155
156	struct TlsInfo {
157        TlsInfo();
158        ~TlsInfo();
159		Context * m_Context;
160        Config* m_AllConfigurations;
161		I32 m_LastError;
162	};
163}
164
165
166#endif
167
168// --------------------------------------------------------------------------
169// Memory helper macros
170// --------------------------------------------------------------------------
171
172// number of elements of an array
173#define elementsof(a) (sizeof(a) / sizeof(*(a)))
174
175// offset in bytes of a structure member from the base address
176#ifndef offsetof
177#define offsetof(s,m)   (size_t)&(((s *)0)->m)
178#endif
179
180
181#endif // ndef EGL_OGLES_H