From 371bd98d1179a5c489919e0b5576bece0ad3dc22 Mon Sep 17 00:00:00 2001 From: jhasse Date: Fri, 7 Aug 2009 20:21:46 +0000 Subject: [PATCH] Adding experimental support for the GP2X Wiz handheld. Many things are still missing. git-svn-id: file:///private-backup/var/svn/jngl@93 8b392cba-0c28-4fbc-ad53-5d9c93102ef3 --- SConstruct | 25 +- draw.hpp | 4 +- freetype.cpp | 2 +- main.cpp | 12 +- opengl.hpp | 22 +- texture.cpp | 14 +- window.hpp | 31 +- wiz/GL/egl.h | 256 ++++++++++++++ wiz/GL/egltypes.h | 51 +++ wiz/GL/gl.h | 862 ++++++++++++++++++++++++++++++++++++++++++++++ wiz/GL/glext.h | 77 +++++ wiz/GL/libogl.h | 54 +++ wiz/GL/nanogl.h | 37 ++ wiz/GL/wizGLES.h | 46 +++ 14 files changed, 1463 insertions(+), 30 deletions(-) create mode 100755 wiz/GL/egl.h create mode 100755 wiz/GL/egltypes.h create mode 100755 wiz/GL/gl.h create mode 100755 wiz/GL/glext.h create mode 100755 wiz/GL/libogl.h create mode 100644 wiz/GL/nanogl.h create mode 100755 wiz/GL/wizGLES.h diff --git a/SConstruct b/SConstruct index a3bc2e497..b5afe22af 100644 --- a/SConstruct +++ b/SConstruct @@ -23,19 +23,21 @@ debug = ARGUMENTS.get('debug', 0) profile = ARGUMENTS.get('profile', 0) autopackage = ARGUMENTS.get('autopackage', 0) installer = ARGUMENTS.get('installer', 0) -opengles = ARGUMENTS.get('opengles', 0) python = int(ARGUMENTS.get('python', 0)) m32 = ARGUMENTS.get('m32', 0) +wiz = ARGUMENTS.get('wiz', 0) if int(debug): env.Append(CCFLAGS = '-g -Wall') else: env.Append(CCFLAGS = '-O2 -DNDEBUG') if int(profile): env.Append(CCFLAGS = '-pg', _LIBFLAGS = ' -pg') -if int(opengles): - env.Append(CCFLAGS = '-DOPENGLES') if int(m32): env.Append(CCFLAGS = '-m32', LINKFLAGS = ' -m32') +if int(wiz): + env['CXX'] = "/toolchain/bin/arm-openwiz-linux-gnu-g++" + env['CC'] = "/toolchain/bin/arm-openwiz-linux-gnu-gcc" + env.Append(CPPPATH=["/toolchain/include", "wiz"], LIBPATH=["/toolchain/lib", "wiz"]) source_files = Split(""" finally.cpp @@ -69,10 +71,19 @@ if env['PLATFORM'] == 'win32': # Windows LINKFLAGS=linkflags) if env['PLATFORM'] == 'posix': # Linux - env.ParseConfig('pkg-config --cflags --libs freetype2 fontconfig glib-2.0') - lib = env.Library(target="jngl", source=source_files + Glob('linux/*.cpp')) + if int(wiz): + env.Append(CCFLAGS = '-DWIZ -DOPENGLES') + source_files += Glob('wiz/*.cpp') + else: + source_files += Glob('linux/*.cpp') + env.ParseConfig('pkg-config --cflags --libs fontconfig glib-2.0') + env.ParseConfig('pkg-config --cflags --libs freetype2') + lib = env.Library(target="jngl", source=source_files) env.Append(LIBPATH=".", CPPPATH='.') - env.ParseConfig("pkg-config --cflags --libs jngl.pc") + if wiz: + env.Append(LIBS=Split("jpeg jngl nanoGL wizGLES opengles_lite z png dl")) + else: + env.ParseConfig("pkg-config --cflags --libs jngl.pc") env.Program("test.cpp") if int(autopackage): @@ -92,4 +103,4 @@ if int(installer): t = Command('jngl Library ' + version + '.exe', lib, '"' + os.path.expandvars("%programfiles%") + '\NSIS\makensis.exe " ' + nsiFile) if python: Depends(t, 'python/jngl.dll') - Clean(t, 'installer/JNGL ' + version + ' (' + name + ').exe') \ No newline at end of file + Clean(t, 'installer/JNGL ' + version + ' (' + name + ').exe') diff --git a/draw.hpp b/draw.hpp index 6b1d50a7a..733e9c115 100644 --- a/draw.hpp +++ b/draw.hpp @@ -34,7 +34,7 @@ namespace draw opengl::Translate(xposition, yposition); T rect[] = { 0, 0, width, 0, width, height, 0, height }; glVertexPointer(2, opengl::Type::constant, 0, rect); - glDrawArrays(GL_QUADS, 0, 4); + glDrawArrays(GL_TRIANGLE_FAN, 0, 4); glPopMatrix(); } @@ -62,7 +62,7 @@ namespace draw ++count; } glVertexPointer(2, opengl::Type::constant, 0, &vertexes[0]); - glDrawArrays(GL_POLYGON, 0, count); + glDrawArrays(GL_TRIANGLE_FAN, 0, count); glPopMatrix(); } diff --git a/freetype.cpp b/freetype.cpp index 26aca8b5e..57ab47a4e 100644 --- a/freetype.cpp +++ b/freetype.cpp @@ -123,7 +123,7 @@ namespace jngl glBindTexture(GL_TEXTURE_2D, texture_); glVertexPointer(2, GL_INT, 0, &vertexes_[0]); glTexCoordPointer(2, GL_FLOAT, 0, &texCoords_[0]); - glDrawArrays(GL_QUADS, 0, 4); + glDrawArrays(GL_TRIANGLE_FAN, 0, 4); glDisableClientState(GL_TEXTURE_COORD_ARRAY); glDisable(GL_TEXTURE_2D); diff --git a/main.cpp b/main.cpp index d63c66d5b..31ce1e24f 100644 --- a/main.cpp +++ b/main.cpp @@ -247,22 +247,26 @@ namespace jngl void Rotate(const double degree) { +#ifdef GL_DOUBLE glRotated(degree, 0, 0, 1); +#else + glRotatef(degree, 0, 0, 1); +#endif } void Translate(const double x, const double y) { - glTranslated(x, y, 0); + opengl::Translate(x, y); } void Scale(const double factor) { - glScaled(factor, factor, 0); + opengl::Scale(factor, factor); } void Scale(const double xfactor, const double yfactor) { - glScaled(xfactor, yfactor, 0); + opengl::Scale(xfactor, yfactor); } void PushMatrix() @@ -327,6 +331,7 @@ namespace jngl void SetAntiAliasing(bool enabled) { +#ifdef GL_MULTISAMPLE_ARB if(!pWindow->IsMultisampleSupported()) { antiAliasingEnabled = false; @@ -341,6 +346,7 @@ namespace jngl glDisable(GL_MULTISAMPLE_ARB); } antiAliasingEnabled = enabled; +#endif } bool GetAntiAliasing() diff --git a/opengl.hpp b/opengl.hpp index de4e0470a..2471a4862 100644 --- a/opengl.hpp +++ b/opengl.hpp @@ -19,9 +19,10 @@ along with JNGL. If not, see . #pragma once -#ifdef OPENGLES - #include - #include +#ifdef WIZ + #include + #include + #include #else #ifndef linux #include @@ -31,15 +32,24 @@ along with JNGL. If not, see . #include +#ifndef GL_BGR +#define GL_BGR 0x80e0 +#endif + namespace opengl { inline void Translate(float x, float y) { glTranslatef(x, y, 0); } + inline void Scale(float x, float y) { glScalef(x, y, 0); } #ifdef GL_DOUBLE template inline void Translate(T x, U y) { glTranslated(static_cast(x), static_cast(y), 0); } + template + inline void Scale(T x, U y) { glScaled(static_cast(x), static_cast(y), 0); } #else template inline void Translate(T x, U y) { Translate(static_cast(x), static_cast(y)); } + template + inline void Scale(T x, U y) { Scale(static_cast(x), static_cast(y)); } #endif #ifdef GL_FIXED inline void Translate(int x, int y) { glTranslatex(x, y, 0); } @@ -73,6 +83,12 @@ namespace opengl #endif }; +#ifdef GL_DOUBLE + typedef GLdouble CoordType; +#else + typedef GLfloat CoordType; +#endif + // This function gets the first power of 2 >= the int that we pass it. int NextPowerOf2(int); } diff --git a/texture.cpp b/texture.cpp index fccd38a73..105f44447 100644 --- a/texture.cpp +++ b/texture.cpp @@ -43,7 +43,9 @@ along with JNGL. If not, see . #define XMD_H #define HAVE_BOOLEAN #endif +extern "C" { #include +} namespace jngl { @@ -109,8 +111,8 @@ namespace jngl glBindTexture(GL_TEXTURE_2D, texture_); glVertexPointer(2, GL_INT, 0, &vertexes_[0]); - glTexCoordPointer(2, GL_DOUBLE, 0, &texCoords_[0]); - glDrawArrays(GL_QUADS, 0, 4); + glTexCoordPointer(2, opengl::Type::constant, 0, &texCoords_[0]); + glDrawArrays(GL_TRIANGLE_FAN, 0, 4); glDisableClientState(GL_TEXTURE_COORD_ARRAY); glDisable(GL_TEXTURE_2D); @@ -149,8 +151,8 @@ namespace jngl glTexSubImage2D(GL_TEXTURE_2D, 0, 0, i, width, 1, format, GL_UNSIGNED_BYTE, &empty[0]); } - const GLdouble x = static_cast(imgWidth) / static_cast(width); - const GLdouble y = static_cast(imgHeight) / static_cast(height); + const opengl::CoordType x = static_cast(imgWidth) / static_cast(width); + const opengl::CoordType y = static_cast(imgHeight) / static_cast(height); GLfloat texCoords[] = { 0, 0, 0, y, x, y, x, 0 }; texCoords_.assign(&texCoords[0], &texCoords[8]); @@ -352,12 +354,12 @@ namespace jngl { glPushMatrix(); opengl::Translate(xposition, yposition); - glScaled(xfactor, yfactor, 0); + opengl::Scale(xfactor, yfactor); DrawTexture(); glPopMatrix(); } private: - std::vector texCoords_; + std::vector texCoords_; std::vector vertexes_; GLuint texture_; int width_, height_; diff --git a/window.hpp b/window.hpp index f4f99420a..3f4c3c2b0 100644 --- a/window.hpp +++ b/window.hpp @@ -31,10 +31,14 @@ along with JNGL. If not, see . #include #ifdef linux - #include - #include - #include - #include + #ifdef WIZ + + #else + #include + #include + #include + #include + #endif #else #include #endif @@ -74,12 +78,16 @@ namespace jngl void SetFont(const std::string&); void SetFontByName(const std::string&); bool IsMultisampleSupported() const; -#ifdef linux +#ifdef WIZ + +#else + #ifdef linux boost::shared_ptr pDisplay_; static void ReleaseXData(void*); -#else + #else static void ReleaseDC(HWND, HDC); static void ReleaseRC(HGLRC); + #endif #endif private: int GetKeyCode(jngl::key::KeyType key); @@ -96,12 +104,18 @@ namespace jngl // > boost::ptr_map > fonts_; -#ifdef linux +#ifdef WIZ + NativeWindowType nativeWindow_; + EGLDisplay display_; + EGLContext context_; + EGLSurface surface_; +#else + #ifdef linux ::Window window_; GLXContext context_; int screen_; XF86VidModeModeInfo oldMode_; -#else + #else boost::shared_ptr::type> pRenderingContext_; boost::shared_ptr::type> pWindowHandle_; boost::shared_ptr::type> pDeviceContext_; @@ -110,6 +124,7 @@ namespace jngl bool InitMultisample(HINSTANCE, PIXELFORMATDESCRIPTOR); void Init(const std::string& title, bool multisample); void DistinguishLeftRight(); + #endif #endif }; } diff --git a/wiz/GL/egl.h b/wiz/GL/egl.h new file mode 100755 index 000000000..639a4d9ec --- /dev/null +++ b/wiz/GL/egl.h @@ -0,0 +1,256 @@ +#ifndef __egl_h_ +#define __egl_h_ + +/* +** License Applicability. Except to the extent portions of this file are +** made subject to an alternative license as permitted in the SGI Free +** Software License B, Version 1.0 (the "License"), the contents of this +** file are subject only to the provisions of the License. You may not use +** this file except in compliance with the License. You may obtain a copy +** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 +** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: +** +** http://oss.sgi.com/projects/FreeB +** +** Note that, as provided in the License, the Software is distributed on an +** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS +** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND +** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A +** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. +** +** Original Code. The Original Code is: OpenGL Sample Implementation, +** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, +** Inc. The Original Code is Copyright (c) 1991-2004 Silicon Graphics, Inc. +** Copyright in any portions created by third parties is as indicated +** elsewhere herein. All Rights Reserved. +** +** Additional Notice Provisions: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. This software +** was created using the OpenGL(R) version 1.2.1 Sample Implementation +** published by SGI, but has not been independently verified as being +** compliant with the OpenGL(R) version 1.2.1 Specification. +*/ + +#include +#include + +/* +** egltypes.h is platform dependent. It defines: +** +** - EGL types and resources +** - Native types +** - EGL and native handle values +** +** EGL types and resources are to be typedef'ed with appropriate platform +** dependent resource handle types. EGLint must be an integer of at least +** 32-bit. +** +** NativeDisplayType, NativeWindowType and NativePixmapType are to be +** replaced with corresponding types of the native window system in egl.h. +** +** EGL and native handle values must match their types. +** +** Example egltypes.h: +*/ + +#if 0 + +#include +//#include + +/* +** Types and resources +*/ +typedef int EGLBoolean; +typedef int32_t EGLint; +typedef void *EGLDisplay; +typedef void *EGLConfig; +typedef void *EGLSurface; +typedef void *EGLContext; + +/* +** EGL and native handle values +*/ +#define EGL_DEFAULT_DISPLAY ((NativeDisplayType)0) +#define EGL_NO_CONTEXT ((EGLContext)0) +#define EGL_NO_DISPLAY ((EGLDisplay)0) +#define EGL_NO_SURFACE ((EGLSurface)0) + +#endif + +/* +** Versioning and extensions +*/ +#define EGL_VERSION_1_0 1 +#define EGL_VERSION_1_1 1 + +/* +** Boolean +*/ +#define EGL_FALSE 0 +#define EGL_TRUE 1 + +/* +** Errors +*/ +#define EGL_SUCCESS 0x3000 +#define EGL_NOT_INITIALIZED 0x3001 +#define EGL_BAD_ACCESS 0x3002 +#define EGL_BAD_ALLOC 0x3003 +#define EGL_BAD_ATTRIBUTE 0x3004 +#define EGL_BAD_CONFIG 0x3005 +#define EGL_BAD_CONTEXT 0x3006 +#define EGL_BAD_CURRENT_SURFACE 0x3007 +#define EGL_BAD_DISPLAY 0x3008 +#define EGL_BAD_MATCH 0x3009 +#define EGL_BAD_NATIVE_PIXMAP 0x300A +#define EGL_BAD_NATIVE_WINDOW 0x300B +#define EGL_BAD_PARAMETER 0x300C +#define EGL_BAD_SURFACE 0x300D +#define EGL_CONTEXT_LOST 0x300E +/* 0x300F - 0x301F reserved for additional errors. */ + +/* +** Config attributes +*/ +#define EGL_BUFFER_SIZE 0x3020 +#define EGL_ALPHA_SIZE 0x3021 +#define EGL_BLUE_SIZE 0x3022 +#define EGL_GREEN_SIZE 0x3023 +#define EGL_RED_SIZE 0x3024 +#define EGL_DEPTH_SIZE 0x3025 +#define EGL_STENCIL_SIZE 0x3026 +#define EGL_CONFIG_CAVEAT 0x3027 +#define EGL_CONFIG_ID 0x3028 +#define EGL_LEVEL 0x3029 +#define EGL_MAX_PBUFFER_HEIGHT 0x302A +#define EGL_MAX_PBUFFER_PIXELS 0x302B +#define EGL_MAX_PBUFFER_WIDTH 0x302C +#define EGL_NATIVE_RENDERABLE 0x302D +#define EGL_NATIVE_VISUAL_ID 0x302E +#define EGL_NATIVE_VISUAL_TYPE 0x302F +/*#define EGL_PRESERVED_RESOURCES 0x3030*/ +#define EGL_SAMPLES 0x3031 +#define EGL_SAMPLE_BUFFERS 0x3032 +#define EGL_SURFACE_TYPE 0x3033 +#define EGL_TRANSPARENT_TYPE 0x3034 +#define EGL_TRANSPARENT_BLUE_VALUE 0x3035 +#define EGL_TRANSPARENT_GREEN_VALUE 0x3036 +#define EGL_TRANSPARENT_RED_VALUE 0x3037 +#define EGL_NONE 0x3038 /* Also a config value */ +#define EGL_BIND_TO_TEXTURE_RGB 0x3039 +#define EGL_BIND_TO_TEXTURE_RGBA 0x303A +#define EGL_MIN_SWAP_INTERVAL 0x303B +#define EGL_MAX_SWAP_INTERVAL 0x303C + +/* +** Config values +*/ +#define EGL_DONT_CARE ((EGLint) -1) + +#define EGL_SLOW_CONFIG 0x3050 /* EGL_CONFIG_CAVEAT value */ +#define EGL_NON_CONFORMANT_CONFIG 0x3051 /* " */ +#define EGL_TRANSPARENT_RGB 0x3052 /* EGL_TRANSPARENT_TYPE value */ +#define EGL_NO_TEXTURE 0x305C /* EGL_TEXTURE_FORMAT/TARGET value */ +#define EGL_TEXTURE_RGB 0x305D /* EGL_TEXTURE_FORMAT value */ +#define EGL_TEXTURE_RGBA 0x305E /* " */ +#define EGL_TEXTURE_2D 0x305F /* EGL_TEXTURE_TARGET value */ + +/* +** Config attribute mask bits +*/ +#define EGL_PBUFFER_BIT 0x01 /* EGL_SURFACE_TYPE mask bit */ +#define EGL_PIXMAP_BIT 0x02 /* " */ +#define EGL_WINDOW_BIT 0x04 /* " */ + +/* +** String names +*/ +#define EGL_VENDOR 0x3053 /* eglQueryString target */ +#define EGL_VERSION 0x3054 /* " */ +#define EGL_EXTENSIONS 0x3055 /* " */ + +/* +** Surface attributes +*/ +#define EGL_HEIGHT 0x3056 +#define EGL_WIDTH 0x3057 +#define EGL_LARGEST_PBUFFER 0x3058 +#define EGL_TEXTURE_FORMAT 0x3080 /* For pbuffers bound as textures */ +#define EGL_TEXTURE_TARGET 0x3081 /* " */ +#define EGL_MIPMAP_TEXTURE 0x3082 /* " */ +#define EGL_MIPMAP_LEVEL 0x3083 /* " */ + +/* +** BindTexImage / ReleaseTexImage buffer target +*/ +#define EGL_BACK_BUFFER 0x3084 + +/* +** Current surfaces +*/ +#define EGL_DRAW 0x3059 +#define EGL_READ 0x305A + +/* +** Engines +*/ +#define EGL_CORE_NATIVE_ENGINE 0x305B + +/* 0x305C-0x3FFFF reserved for future use */ + +/* +** Functions +*/ +#ifdef __cplusplus +extern "C" { +#endif + +GLAPI EGLint GL_APIENTRY eglGetError (void); + +GLAPI EGLDisplay GL_APIENTRY eglGetDisplay (NativeDisplayType display); +GLAPI EGLBoolean GL_APIENTRY eglInitialize (EGLDisplay dpy, EGLint *major, EGLint *minor); +GLAPI EGLBoolean GL_APIENTRY eglTerminate (EGLDisplay dpy); +GLAPI const char * GL_APIENTRY eglQueryString (EGLDisplay dpy, EGLint name); +GLAPI void (* GL_APIENTRY eglGetProcAddress (const char *procname))(); + +GLAPI EGLBoolean GL_APIENTRY eglGetConfigs (EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config); +GLAPI EGLBoolean GL_APIENTRY eglChooseConfig (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config); +GLAPI EGLBoolean GL_APIENTRY eglGetConfigAttrib (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value); + +GLAPI EGLSurface GL_APIENTRY eglCreateWindowSurface (EGLDisplay dpy, EGLConfig config, NativeWindowType window, const EGLint *attrib_list); +GLAPI EGLSurface GL_APIENTRY eglCreatePixmapSurface (EGLDisplay dpy, EGLConfig config, NativePixmapType pixmap, const EGLint *attrib_list); +GLAPI EGLSurface GL_APIENTRY eglCreatePbufferSurface (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list); +GLAPI EGLBoolean GL_APIENTRY eglDestroySurface (EGLDisplay dpy, EGLSurface surface); +GLAPI EGLBoolean GL_APIENTRY eglQuerySurface (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value); + +/* EGL 1.1 render-to-texture APIs */ +GLAPI EGLBoolean GL_APIENTRY eglSurfaceAttrib (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value); +GLAPI EGLBoolean GL_APIENTRY eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer); +GLAPI EGLBoolean GL_APIENTRY eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer); + +/* EGL 1.1 swap control API */ +GLAPI EGLBoolean GL_APIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval); + +GLAPI EGLContext GL_APIENTRY eglCreateContext (EGLDisplay dpy, EGLConfig config, EGLContext share_list, const EGLint *attrib_list); +GLAPI EGLBoolean GL_APIENTRY eglDestroyContext (EGLDisplay dpy, EGLContext ctx); +GLAPI EGLBoolean GL_APIENTRY eglMakeCurrent (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx); +GLAPI EGLContext GL_APIENTRY eglGetCurrentContext (void); +GLAPI EGLSurface GL_APIENTRY eglGetCurrentSurface (EGLint readdraw); +GLAPI EGLDisplay GL_APIENTRY eglGetCurrentDisplay (void); +GLAPI EGLBoolean GL_APIENTRY eglQueryContext (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value); + +GLAPI EGLBoolean GL_APIENTRY eglWaitGL (void); +GLAPI EGLBoolean GL_APIENTRY eglWaitNative (EGLint engine); +GLAPI EGLBoolean GL_APIENTRY eglSwapBuffers (EGLDisplay dpy, EGLSurface draw); +GLAPI EGLBoolean GL_APIENTRY eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, NativePixmapType target); + +#ifdef __cplusplus +} +#endif + +#endif /* ___egl_h_ */ diff --git a/wiz/GL/egltypes.h b/wiz/GL/egltypes.h new file mode 100755 index 000000000..f103ac55b --- /dev/null +++ b/wiz/GL/egltypes.h @@ -0,0 +1,51 @@ +//------------------------------------------------------------------------------ +// +// Copyright (C) 2003 MagicEyes Digital Co., Ltd All Rights Reserved +// MagicEyes Digital Co. Proprietary & Confidential +// +// MAGICEYES INFORMS THAT THIS CODE AND INFORMATION IS PROVIDED "AS IS" BASE +// AND WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING +// BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR +// FITNESS FOR A PARTICULAR PURPOSE. +// +// Module : +// File : egltypes.h +// Description: +// Author : Gamza(nik@mesdigital.com) +// Export : +// History : +// 2006/04/24 Gamza first implementation +//------------------------------------------------------------------------------ +#ifndef __egltypes_h__ +#define __egltypes_h__ + +#if defined(WIN32) || defined(UNDER_CE) +#pragma warning(push,3) +#include +#pragma warning(pop) +#endif + +typedef void *NativeDisplayType; +typedef void *NativeWindowType; +typedef void *NativePixmapType; + +/* +** Types and resources +*/ +typedef int EGLBoolean; +typedef int EGLint; +typedef void *EGLDisplay; +typedef void *EGLConfig; +typedef void *EGLSurface; +typedef void *EGLContext; + +/* +** EGL and native handle values +*/ +#define EGL_DEFAULT_DISPLAY ((NativeDisplayType)0) +#define EGL_NO_CONTEXT ((EGLContext)0) +#define EGL_NO_DISPLAY ((EGLDisplay)0) +#define EGL_NO_SURFACE ((EGLSurface)0) + +#endif // ___egltypes_h__ + diff --git a/wiz/GL/gl.h b/wiz/GL/gl.h new file mode 100755 index 000000000..e58949810 --- /dev/null +++ b/wiz/GL/gl.h @@ -0,0 +1,862 @@ +#ifndef __gl_h_ +#define __gl_h_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** License Applicability. Except to the extent portions of this file are +** made subject to an alternative license as permitted in the SGI Free +** Software License B, Version 1.0 (the "License"), the contents of this +** file are subject only to the provisions of the License. You may not use +** this file except in compliance with the License. You may obtain a copy +** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 +** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: +** +** http://oss.sgi.com/projects/FreeB +** +** Note that, as provided in the License, the Software is distributed on an +** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS +** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND +** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A +** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. +** +** Original Code. The Original Code is: OpenGL Sample Implementation, +** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, +** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. +** Copyright in any portions created by third parties is as indicated +** elsewhere herein. All Rights Reserved. +** +** Additional Notice Provisions: The application programming interfaces +** established by SGI in conjunction with the Original Code are The +** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released +** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version +** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X +** Window System(R) (Version 1.3), released October 19, 1998. This software +** was created using the OpenGL(R) version 1.2.1 Sample Implementation +** published by SGI, but has not been independently verified as being +** compliant with the OpenGL(R) version 1.2.1 Specification. +*/ + +#if defined(AEE_SIMULATOR) +#define __GL_EXPORTS +#endif + +#if defined(WIN32) || defined(UNDER_CE) +# ifdef __GL_EXPORTS +# define GL_API __declspec(dllexport) +# else +# define GL_API __declspec(dllimport) +# endif +#else +# ifdef __GL_EXPORTS +# define GL_API +# else +# define GL_API extern +# endif +#endif + +#define GL_APIENTRY + +#ifndef GLAPI +# define GLAPI GL_API +#endif + + +typedef unsigned int GLenum; +typedef unsigned char GLboolean; +typedef unsigned int GLbitfield; +typedef signed char GLbyte; +typedef short GLshort; +typedef int GLint; +typedef int GLsizei; +typedef unsigned char GLubyte; +typedef unsigned short GLushort; +typedef unsigned int GLuint; +typedef float GLfloat; +typedef float GLclampf; +typedef void GLvoid; +typedef int GLfixed; +typedef int GLclampx; + +typedef int GLintptr; +typedef int GLsizeiptr; + + +/*************************************************************/ + +/* OpenGL ES core versions */ +#define GL_OES_VERSION_1_0 1 +#define GL_OES_VERSION_1_1 1 + +/* Extensions */ +#define GL_OES_byte_coordinates 1 +#define GL_OES_compressed_paletted_texture 1 +#define GL_OES_draw_texture 1 +#define GL_OES_fixed_point 1 +#define GL_OES_matrix_get 1 +#define GL_OES_matrix_palette 1 +#define GL_OES_point_size_array 1 +#define GL_OES_point_sprite 1 +#define GL_OES_read_format 1 +#define GL_OES_single_precision 1 + +/* ClearBufferMask */ +#define GL_DEPTH_BUFFER_BIT 0x00000100 +#define GL_STENCIL_BUFFER_BIT 0x00000400 +#define GL_COLOR_BUFFER_BIT 0x00004000 + +/* Boolean */ +//#define GL_FALSE 0 +//#define GL_TRUE 1 + +/* BeginMode */ +#define GL_POINTS 0x0000 +#define GL_LINES 0x0001 +#define GL_LINE_LOOP 0x0002 +#define GL_LINE_STRIP 0x0003 +#define GL_TRIANGLES 0x0004 +#define GL_TRIANGLE_STRIP 0x0005 +#define GL_TRIANGLE_FAN 0x0006 + +/* AlphaFunction */ +#define GL_NEVER 0x0200 +#define GL_LESS 0x0201 +#define GL_EQUAL 0x0202 +#define GL_LEQUAL 0x0203 +#define GL_GREATER 0x0204 +#define GL_NOTEQUAL 0x0205 +#define GL_GEQUAL 0x0206 +#define GL_ALWAYS 0x0207 + +/* BlendingFactorDest */ +//#define GL_ZERO 0 +//#define GL_ONE 1 +#define GL_SRC_COLOR 0x0300 +#define GL_ONE_MINUS_SRC_COLOR 0x0301 +#define GL_SRC_ALPHA 0x0302 +#define GL_ONE_MINUS_SRC_ALPHA 0x0303 +#define GL_DST_ALPHA 0x0304 +#define GL_ONE_MINUS_DST_ALPHA 0x0305 + +/* BlendingFactorSrc */ +#define GL_ZERO 0x0 +#define GL_ONE 0x1 +#define GL_DST_COLOR 0x0306 +#define GL_ONE_MINUS_DST_COLOR 0x0307 +#define GL_SRC_ALPHA_SATURATE 0x0308 +#define GL_SRC_COLOR 0x0300 +#define GL_ONE_MINUS_SRC_COLOR 0x0301 +#define GL_SRC_ALPHA 0x0302 +#define GL_ONE_MINUS_SRC_ALPHA 0x0303 +#define GL_DST_ALPHA 0x0304 +#define GL_ONE_MINUS_DST_ALPHA 0x0305 + +/* ClipPlaneName */ +#define GL_CLIP_PLANE0 0x3000 +#define GL_CLIP_PLANE1 0x3001 +#define GL_CLIP_PLANE2 0x3002 +#define GL_CLIP_PLANE3 0x3003 +#define GL_CLIP_PLANE4 0x3004 +#define GL_CLIP_PLANE5 0x3005 + +/* ColorMaterialFace */ +/* GL_FRONT_AND_BACK */ + +/* ColorMaterialParameter */ +/* GL_AMBIENT_AND_DIFFUSE */ + +/* ColorPointerType */ +/* GL_UNSIGNED_BYTE */ +/* GL_FLOAT */ +/* GL_FIXED */ + +/* CullFaceMode */ +#define GL_FRONT 0x0404 +#define GL_BACK 0x0405 +#define GL_FRONT_AND_BACK 0x0408 + +/* DepthFunction */ +/* GL_NEVER */ +/* GL_LESS */ +/* GL_EQUAL */ +/* GL_LEQUAL */ +/* GL_GREATER */ +/* GL_NOTEQUAL */ +/* GL_GEQUAL */ +/* GL_ALWAYS */ + +/* EnableCap */ +#define GL_FOG 0x0B60 +#define GL_LIGHTING 0x0B50 +#define GL_TEXTURE_2D 0x0DE1 +#define GL_CULL_FACE 0x0B44 +#define GL_ALPHA_TEST 0x0BC0 +#define GL_BLEND 0x0BE2 +#define GL_COLOR_LOGIC_OP 0x0BF2 +#define GL_DITHER 0x0BD0 +#define GL_STENCIL_TEST 0x0B90 +#define GL_DEPTH_TEST 0x0B71 +/* GL_LIGHT0 */ +/* GL_LIGHT1 */ +/* GL_LIGHT2 */ +/* GL_LIGHT3 */ +/* GL_LIGHT4 */ +/* GL_LIGHT5 */ +/* GL_LIGHT6 */ +/* GL_LIGHT7 */ +#define GL_POINT_SMOOTH 0x0B10 +#define GL_LINE_SMOOTH 0x0B20 +#define GL_SCISSOR_TEST 0x0C11 +#define GL_COLOR_MATERIAL 0x0B57 +#define GL_NORMALIZE 0x0BA1 +#define GL_RESCALE_NORMAL 0x803A +#define GL_POLYGON_OFFSET_FILL 0x8037 +#define GL_VERTEX_ARRAY 0x8074 +#define GL_NORMAL_ARRAY 0x8075 +#define GL_COLOR_ARRAY 0x8076 +#define GL_TEXTURE_COORD_ARRAY 0x8078 +#define GL_MULTISAMPLE 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE 0x809F +#define GL_SAMPLE_COVERAGE 0x80A0 + +/* ErrorCode */ +#define GL_NO_ERROR 0 +#define GL_INVALID_ENUM 0x0500 +#define GL_INVALID_VALUE 0x0501 +#define GL_INVALID_OPERATION 0x0502 +#define GL_STACK_OVERFLOW 0x0503 +#define GL_STACK_UNDERFLOW 0x0504 +#define GL_OUT_OF_MEMORY 0x0505 + +/* FogMode */ +/* GL_LINEAR */ +#define GL_EXP 0x0800 +#define GL_EXP2 0x0801 + +/* FogParameter */ +#define GL_FOG_DENSITY 0x0B62 +#define GL_FOG_START 0x0B63 +#define GL_FOG_END 0x0B64 +#define GL_FOG_MODE 0x0B65 +#define GL_FOG_COLOR 0x0B66 + +/* FrontFaceDirection */ +#define GL_CW 0x0900 +#define GL_CCW 0x0901 + +/* GetPName */ +#define GL_CURRENT_COLOR 0x0B00 +#define GL_CURRENT_NORMAL 0x0B02 +#define GL_CURRENT_TEXTURE_COORDS 0x0B03 +#define GL_POINT_SIZE 0x0B11 +#define GL_POINT_SIZE_MIN 0x8126 +#define GL_POINT_SIZE_MAX 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION 0x8129 +#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 +#define GL_LINE_WIDTH 0x0B21 +#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E +#define GL_CULL_FACE_MODE 0x0B45 +#define GL_FRONT_FACE 0x0B46 +#define GL_SHADE_MODEL 0x0B54 +#define GL_DEPTH_RANGE 0x0B70 +#define GL_DEPTH_WRITEMASK 0x0B72 +#define GL_DEPTH_CLEAR_VALUE 0x0B73 +#define GL_DEPTH_FUNC 0x0B74 +#define GL_STENCIL_CLEAR_VALUE 0x0B91 +#define GL_STENCIL_FUNC 0x0B92 +#define GL_STENCIL_VALUE_MASK 0x0B93 +#define GL_STENCIL_FAIL 0x0B94 +#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 +#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 +#define GL_STENCIL_REF 0x0B97 +#define GL_STENCIL_WRITEMASK 0x0B98 +#define GL_MATRIX_MODE 0x0BA0 +#define GL_VIEWPORT 0x0BA2 +#define GL_MODELVIEW_STACK_DEPTH 0x0BA3 +#define GL_PROJECTION_STACK_DEPTH 0x0BA4 +#define GL_TEXTURE_STACK_DEPTH 0x0BA5 +#define GL_MODELVIEW_MATRIX 0x0BA6 +#define GL_PROJECTION_MATRIX 0x0BA7 +#define GL_TEXTURE_MATRIX 0x0BA8 +#define GL_ALPHA_TEST_FUNC 0x0BC1 +#define GL_ALPHA_TEST_REF 0x0BC2 +#define GL_BLEND_DST 0x0BE0 +#define GL_BLEND_SRC 0x0BE1 +#define GL_LOGIC_OP_MODE 0x0BF0 +#define GL_SCISSOR_BOX 0x0C10 +#define GL_SCISSOR_TEST 0x0C11 +#define GL_COLOR_CLEAR_VALUE 0x0C22 +#define GL_COLOR_WRITEMASK 0x0C23 +#define GL_UNPACK_ALIGNMENT 0x0CF5 +#define GL_PACK_ALIGNMENT 0x0D05 +#define GL_MAX_LIGHTS 0x0D31 +#define GL_MAX_CLIP_PLANES 0x0D32 +#define GL_MAX_TEXTURE_SIZE 0x0D33 +#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36 +#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38 +#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39 +#define GL_MAX_VIEWPORT_DIMS 0x0D3A +#define GL_MAX_ELEMENTS_VERTICES 0x80E8 +#define GL_MAX_ELEMENTS_INDICES 0x80E9 +#define GL_MAX_TEXTURE_UNITS 0x84E2 +#define GL_SUBPIXEL_BITS 0x0D50 +#define GL_RED_BITS 0x0D52 +#define GL_GREEN_BITS 0x0D53 +#define GL_BLUE_BITS 0x0D54 +#define GL_ALPHA_BITS 0x0D55 +#define GL_DEPTH_BITS 0x0D56 +#define GL_STENCIL_BITS 0x0D57 +#define GL_POLYGON_OFFSET_UNITS 0x2A00 +#define GL_POLYGON_OFFSET_FILL 0x8037 +#define GL_POLYGON_OFFSET_FACTOR 0x8038 +#define GL_TEXTURE_BINDING_2D 0x8069 +#define GL_VERTEX_ARRAY_SIZE 0x807A +#define GL_VERTEX_ARRAY_TYPE 0x807B +#define GL_VERTEX_ARRAY_STRIDE 0x807C +#define GL_NORMAL_ARRAY_TYPE 0x807E +#define GL_NORMAL_ARRAY_STRIDE 0x807F +#define GL_COLOR_ARRAY_SIZE 0x8081 +#define GL_COLOR_ARRAY_TYPE 0x8082 +#define GL_COLOR_ARRAY_STRIDE 0x8083 +#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A +#define GL_VERTEX_ARRAY_POINTER 0x808E +#define GL_NORMAL_ARRAY_POINTER 0x808F +#define GL_COLOR_ARRAY_POINTER 0x8090 +#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092 +#define GL_SAMPLE_BUFFERS 0x80A8 +#define GL_SAMPLES 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB + +/* GetTextureParameter */ +/* GL_TEXTURE_MAG_FILTER */ +/* GL_TEXTURE_MIN_FILTER */ +/* GL_TEXTURE_WRAP_S */ +/* GL_TEXTURE_WRAP_T */ + +#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 + +/* HintMode */ +#define GL_DONT_CARE 0x1100 +#define GL_FASTEST 0x1101 +#define GL_NICEST 0x1102 + +/* HintTarget */ +#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 +#define GL_POINT_SMOOTH_HINT 0x0C51 +#define GL_LINE_SMOOTH_HINT 0x0C52 +#define GL_POLYGON_SMOOTH_HINT 0x0C53 +#define GL_FOG_HINT 0x0C54 +#define GL_GENERATE_MIPMAP_HINT 0x8192 + +/* LightModelParameter */ +#define GL_LIGHT_MODEL_AMBIENT 0x0B53 +#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52 + +/* LightParameter */ +#define GL_AMBIENT 0x1200 +#define GL_DIFFUSE 0x1201 +#define GL_SPECULAR 0x1202 +#define GL_POSITION 0x1203 +#define GL_SPOT_DIRECTION 0x1204 +#define GL_SPOT_EXPONENT 0x1205 +#define GL_SPOT_CUTOFF 0x1206 +#define GL_CONSTANT_ATTENUATION 0x1207 +#define GL_LINEAR_ATTENUATION 0x1208 +#define GL_QUADRATIC_ATTENUATION 0x1209 + +/* DataType */ +#define GL_BYTE 0x1400 +#define GL_UNSIGNED_BYTE 0x1401 +#define GL_SHORT 0x1402 +#define GL_UNSIGNED_SHORT 0x1403 +#define GL_FLOAT 0x1406 +#define GL_FIXED 0x140C + +/* LogicOp */ +#define GL_CLEAR 0x1500 +#define GL_AND 0x1501 +#define GL_AND_REVERSE 0x1502 +#define GL_COPY 0x1503 +#define GL_AND_INVERTED 0x1504 +#define GL_NOOP 0x1505 +#define GL_XOR 0x1506 +#define GL_OR 0x1507 +#define GL_NOR 0x1508 +#define GL_EQUIV 0x1509 +#define GL_INVERT 0x150A +#define GL_OR_REVERSE 0x150B +#define GL_COPY_INVERTED 0x150C +#define GL_OR_INVERTED 0x150D +#define GL_NAND 0x150E +#define GL_SET 0x150F + +/* MaterialFace */ +/* GL_FRONT_AND_BACK */ + +/* MaterialParameter */ +#define GL_EMISSION 0x1600 +#define GL_SHININESS 0x1601 +#define GL_AMBIENT_AND_DIFFUSE 0x1602 +/* GL_AMBIENT */ +/* GL_DIFFUSE */ +/* GL_SPECULAR */ + +/* MatrixMode */ +#define GL_MODELVIEW 0x1700 +#define GL_PROJECTION 0x1701 +#define GL_TEXTURE 0x1702 + +/* NormalPointerType */ +/* GL_BYTE */ +/* GL_SHORT */ +/* GL_FLOAT */ +/* GL_FIXED */ + +/* PixelFormat */ +#define GL_ALPHA 0x1906 +#define GL_RGB 0x1907 +#define GL_RGBA 0x1908 +#define GL_LUMINANCE 0x1909 +#define GL_LUMINANCE_ALPHA 0x190A + +/* PixelStoreParameter */ +#define GL_UNPACK_ALIGNMENT 0x0CF5 +#define GL_PACK_ALIGNMENT 0x0D05 + +/* PixelType */ +/* GL_UNSIGNED_BYTE */ +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 + +/* ShadingModel */ +#define GL_FLAT 0x1D00 +#define GL_SMOOTH 0x1D01 + +/* StencilFunction */ +/* GL_NEVER */ +/* GL_LESS */ +/* GL_EQUAL */ +/* GL_LEQUAL */ +/* GL_GREATER */ +/* GL_NOTEQUAL */ +/* GL_GEQUAL */ +/* GL_ALWAYS */ + +/* StencilOp */ +/* GL_ZERO */ +#define GL_KEEP 0x1E00 +#define GL_REPLACE 0x1E01 +#define GL_INCR 0x1E02 +#define GL_DECR 0x1E03 +/* GL_INVERT */ + +/* StringName */ +#define GL_VENDOR 0x1F00 +#define GL_RENDERER 0x1F01 +#define GL_VERSION 0x1F02 +#define GL_EXTENSIONS 0x1F03 + +/* TexCoordPointerType */ +/* GL_SHORT */ +/* GL_FLOAT */ +/* GL_FIXED */ +/* GL_BYTE */ + +/* TextureEnvMode */ +#define GL_MODULATE 0x2100 +#define GL_DECAL 0x2101 +/* GL_BLEND */ +#define GL_ADD 0x0104 +/* GL_REPLACE */ + +/* TextureEnvParameter */ +#define GL_TEXTURE_ENV_MODE 0x2200 +#define GL_TEXTURE_ENV_COLOR 0x2201 + +/* TextureEnvTarget */ +#define GL_TEXTURE_ENV 0x2300 + +/* TextureMagFilter */ +#define GL_NEAREST 0x2600 +#define GL_LINEAR 0x2601 + +/* TextureMinFilter */ +/* GL_NEAREST */ +/* GL_LINEAR */ +#define GL_NEAREST_MIPMAP_NEAREST 0x2700 +#define GL_LINEAR_MIPMAP_NEAREST 0x2701 +#define GL_NEAREST_MIPMAP_LINEAR 0x2702 +#define GL_LINEAR_MIPMAP_LINEAR 0x2703 + +/* TextureParameterName */ +#define GL_TEXTURE_MAG_FILTER 0x2800 +#define GL_TEXTURE_MIN_FILTER 0x2801 +#define GL_TEXTURE_WRAP_S 0x2802 +#define GL_TEXTURE_WRAP_T 0x2803 +#define GL_GENERATE_MIPMAP 0x8191 + +/* TextureTarget */ +/* GL_TEXTURE_2D */ + +/* TextureUnit */ +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE1 0x84C1 +#define GL_TEXTURE2 0x84C2 +#define GL_TEXTURE3 0x84C3 +#define GL_TEXTURE4 0x84C4 +#define GL_TEXTURE5 0x84C5 +#define GL_TEXTURE6 0x84C6 +#define GL_TEXTURE7 0x84C7 +#define GL_TEXTURE8 0x84C8 +#define GL_TEXTURE9 0x84C9 +#define GL_TEXTURE10 0x84CA +#define GL_TEXTURE11 0x84CB +#define GL_TEXTURE12 0x84CC +#define GL_TEXTURE13 0x84CD +#define GL_TEXTURE14 0x84CE +#define GL_TEXTURE15 0x84CF +#define GL_TEXTURE16 0x84D0 +#define GL_TEXTURE17 0x84D1 +#define GL_TEXTURE18 0x84D2 +#define GL_TEXTURE19 0x84D3 +#define GL_TEXTURE20 0x84D4 +#define GL_TEXTURE21 0x84D5 +#define GL_TEXTURE22 0x84D6 +#define GL_TEXTURE23 0x84D7 +#define GL_TEXTURE24 0x84D8 +#define GL_TEXTURE25 0x84D9 +#define GL_TEXTURE26 0x84DA +#define GL_TEXTURE27 0x84DB +#define GL_TEXTURE28 0x84DC +#define GL_TEXTURE29 0x84DD +#define GL_TEXTURE30 0x84DE +#define GL_TEXTURE31 0x84DF +#define GL_ACTIVE_TEXTURE 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 + +/* TextureWrapMode */ +#define GL_REPEAT 0x2901 +#define GL_CLAMP_TO_EDGE 0x812F + +/* PixelInternalFormat */ +#define GL_PALETTE4_RGB8_OES 0x8B90 +#define GL_PALETTE4_RGBA8_OES 0x8B91 +#define GL_PALETTE4_R5_G6_B5_OES 0x8B92 +#define GL_PALETTE4_RGBA4_OES 0x8B93 +#define GL_PALETTE4_RGB5_A1_OES 0x8B94 +#define GL_PALETTE8_RGB8_OES 0x8B95 +#define GL_PALETTE8_RGBA8_OES 0x8B96 +#define GL_PALETTE8_R5_G6_B5_OES 0x8B97 +#define GL_PALETTE8_RGBA4_OES 0x8B98 +#define GL_PALETTE8_RGB5_A1_OES 0x8B99 + +/* VertexPointerType */ +/* GL_SHORT */ +/* GL_FLOAT */ +/* GL_FIXED */ +/* GL_BYTE */ + +/* LightName */ +#define GL_LIGHT0 0x4000 +#define GL_LIGHT1 0x4001 +#define GL_LIGHT2 0x4002 +#define GL_LIGHT3 0x4003 +#define GL_LIGHT4 0x4004 +#define GL_LIGHT5 0x4005 +#define GL_LIGHT6 0x4006 +#define GL_LIGHT7 0x4007 + +/* Buffer Objects */ +#define GL_ARRAY_BUFFER 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER 0x8893 + +#define GL_ARRAY_BUFFER_BINDING 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A + +#define GL_STATIC_DRAW 0x88E4 +#define GL_DYNAMIC_DRAW 0x88E8 + +#define GL_WRITE_ONLY 0x88B9 + +#define GL_BUFFER_SIZE 0x8764 +#define GL_BUFFER_USAGE 0x8765 +#define GL_BUFFER_ACCESS 0x88BB + + +/* Texture combine + dot3 */ +#define GL_SUBTRACT 0x84E7 +#define GL_COMBINE 0x8570 +#define GL_COMBINE_RGB 0x8571 +#define GL_COMBINE_ALPHA 0x8572 +#define GL_RGB_SCALE 0x8573 +#define GL_ADD_SIGNED 0x8574 +#define GL_INTERPOLATE 0x8575 +#define GL_CONSTANT 0x8576 +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PREVIOUS 0x8578 +#define GL_OPERAND0_RGB 0x8590 +#define GL_OPERAND1_RGB 0x8591 +#define GL_OPERAND2_RGB 0x8592 +#define GL_OPERAND0_ALPHA 0x8598 +#define GL_OPERAND1_ALPHA 0x8599 +#define GL_OPERAND2_ALPHA 0x859A + +#define GL_ALPHA_SCALE 0x0D1C + +#define GL_SRC0_RGB 0x8580 +#define GL_SRC1_RGB 0x8581 +#define GL_SRC2_RGB 0x8582 +#define GL_SRC0_ALPHA 0x8588 +#define GL_SRC1_ALPHA 0x8589 +#define GL_SRC2_ALPHA 0x858A + +#define GL_DOT3_RGB 0x86AE +#define GL_DOT3_RGBA 0x86AF + +/*****************************************************************************************/ +/* OES extension functions */ +/*****************************************************************************************/ + +/* OES_draw_texture */ +#define GL_TEXTURE_CROP_RECT_OES 0x8B9D + +/* OES_matrix_get */ +#define GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES 0x898D +#define GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES 0x898E +#define GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES 0x898F + +/* OES_matrix_palette */ +#define GL_MAX_VERTEX_UNITS_OES 0x86A4 +#define GL_MAX_PALETTE_MATRICES_OES 0x8842 +#define GL_MATRIX_PALETTE_OES 0x8840 +#define GL_MATRIX_INDEX_ARRAY_OES 0x8844 +#define GL_WEIGHT_ARRAY_OES 0x86AD + +#define GL_MATRIX_INDEX_ARRAY_SIZE_OES 0x8846 +#define GL_MATRIX_INDEX_ARRAY_TYPE_OES 0x8847 +#define GL_MATRIX_INDEX_ARRAY_STRIDE_OES 0x8848 +#define GL_MATRIX_INDEX_ARRAY_POINTER_OES 0x8849 +#define GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES 0x8B9E + +#define GL_WEIGHT_ARRAY_SIZE_OES 0x86AB +#define GL_WEIGHT_ARRAY_TYPE_OES 0x86A9 +#define GL_WEIGHT_ARRAY_STRIDE_OES 0x86AA +#define GL_WEIGHT_ARRAY_POINTER_OES 0x86AC +#define GL_WEIGHT_ARRAY_BUFFER_BINDING_OES 0x889E + +/* OES_point_size_array */ +#define GL_POINT_SIZE_ARRAY_OES 0x8B9C +#define GL_POINT_SIZE_ARRAY_TYPE_OES 0x898A +#define GL_POINT_SIZE_ARRAY_STRIDE_OES 0x898B +#define GL_POINT_SIZE_ARRAY_POINTER_OES 0x898C +#define GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES 0x8B9F + +/* OES_point_sprite */ +#define GL_POINT_SPRITE_OES 0x8861 +#define GL_COORD_REPLACE_OES 0x8862 + + +/*************************************************************/ + +GL_API void GL_APIENTRY glAlphaFunc (GLenum func, GLclampf ref); +GL_API void GL_APIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +GL_API void GL_APIENTRY glClearDepthf (GLclampf depth); +GL_API void GL_APIENTRY glClipPlanef (GLenum plane, const GLfloat *equation); +GL_API void GL_APIENTRY glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GL_API void GL_APIENTRY glDepthRangef (GLclampf zNear, GLclampf zFar); +GL_API void GL_APIENTRY glFogf (GLenum pname, GLfloat param); +GL_API void GL_APIENTRY glFogfv (GLenum pname, const GLfloat *params); +GL_API void GL_APIENTRY glFrustumf (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); +GL_API void GL_APIENTRY glGetClipPlanef (GLenum pname, GLfloat eqn[4]); +GL_API void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat *params); +GL_API void GL_APIENTRY glGetLightfv (GLenum light, GLenum pname, GLfloat *params); +GL_API void GL_APIENTRY glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params); +GL_API void GL_APIENTRY glGetTexEnvfv (GLenum env, GLenum pname, GLfloat *params); +GL_API void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params); +GL_API void GL_APIENTRY glLightModelf (GLenum pname, GLfloat param); +GL_API void GL_APIENTRY glLightModelfv (GLenum pname, const GLfloat *params); +GL_API void GL_APIENTRY glLightf (GLenum light, GLenum pname, GLfloat param); +GL_API void GL_APIENTRY glLightfv (GLenum light, GLenum pname, const GLfloat *params); +GL_API void GL_APIENTRY glLineWidth (GLfloat width); +GL_API void GL_APIENTRY glLoadMatrixf (const GLfloat *m); +GL_API void GL_APIENTRY glMaterialf (GLenum face, GLenum pname, GLfloat param); +GL_API void GL_APIENTRY glMaterialfv (GLenum face, GLenum pname, const GLfloat *params); +GL_API void GL_APIENTRY glMultMatrixf (const GLfloat *m); +GL_API void GL_APIENTRY glMultiTexCoord4f (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GL_API void GL_APIENTRY glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz); +GL_API void GL_APIENTRY glOrtho(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); +GL_API void GL_APIENTRY glPointParameterf (GLenum pname, GLfloat param); +GL_API void GL_APIENTRY glPointParameterfv (GLenum pname, const GLfloat *params); +GL_API void GL_APIENTRY glPointSize (GLfloat size); +GL_API void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units); +GL_API void GL_APIENTRY glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +GL_API void GL_APIENTRY glScalef (GLfloat x, GLfloat y, GLfloat z); +GL_API void GL_APIENTRY glTexEnvf (GLenum target, GLenum pname, GLfloat param); +GL_API void GL_APIENTRY glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params); +GL_API void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param); +GL_API void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params); +GL_API void GL_APIENTRY glTranslatef (GLfloat x, GLfloat y, GLfloat z); + +GL_API void GL_APIENTRY glActiveTexture (GLenum texture); +GL_API void GL_APIENTRY glAlphaFuncx (GLenum func, GLclampx ref); +GL_API void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer); +GL_API void GL_APIENTRY glBindTexture (GLenum target, GLuint texture); +GL_API void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor); +GL_API void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage); +GL_API void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data); +GL_API void GL_APIENTRY glClear (GLbitfield mask); +GL_API void GL_APIENTRY glClearColorx (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha); +GL_API void GL_APIENTRY glClearDepthx (GLclampx depth); +GL_API void GL_APIENTRY glClearStencil (GLint s); +GL_API void GL_APIENTRY glClientActiveTexture (GLenum texture); +GL_API void GL_APIENTRY glClipPlanex (GLenum plane, const GLfixed *equation); +GL_API void GL_APIENTRY glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); +GL_API void GL_APIENTRY glColor4x (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +GL_API void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +GL_API void GL_APIENTRY glColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GL_API void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +GL_API void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +GL_API void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GL_API void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GL_API void GL_APIENTRY glCullFace (GLenum mode); +GL_API void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers); +GL_API void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint *textures); +GL_API void GL_APIENTRY glDepthFunc (GLenum func); +GL_API void GL_APIENTRY glDepthMask (GLboolean flag); +GL_API void GL_APIENTRY glDepthRangex (GLclampx zNear, GLclampx zFar); +GL_API void GL_APIENTRY glDisable (GLenum cap); +GL_API void GL_APIENTRY glDisableClientState (GLenum array); +GL_API void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count); +GL_API void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices); +GL_API void GL_APIENTRY glEnable (GLenum cap); +GL_API void GL_APIENTRY glEnableClientState (GLenum array); +GL_API void GL_APIENTRY glFinish (void); +GL_API void GL_APIENTRY glFlush (void); +GL_API void GL_APIENTRY glFogx (GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glFogxv (GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glFrontFace (GLenum mode); +GL_API void GL_APIENTRY glFrustumx (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); +GL_API void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean *params); +GL_API void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params); +GL_API void GL_APIENTRY glGetClipPlanex (GLenum pname, GLfixed eqn[4]); +GL_API void GL_APIENTRY glGenBuffers (GLsizei n, GLuint *buffers); +GL_API void GL_APIENTRY glGenTextures (GLsizei n, GLuint *textures); +GL_API GLenum GL_APIENTRY glGetError (void); +GL_API void GL_APIENTRY glGetFixedv (GLenum pname, GLfixed *params); +GL_API void GL_APIENTRY glGetIntegerv (GLenum pname, GLint *params); +GL_API void GL_APIENTRY glGetLightxv (GLenum light, GLenum pname, GLfixed *params); +GL_API void GL_APIENTRY glGetMaterialxv (GLenum face, GLenum pname, GLfixed *params); +GL_API void GL_APIENTRY glGetPointerv (GLenum pname, void **params); +GL_API const GLubyte * GL_APIENTRY glGetString (GLenum name); +GL_API void GL_APIENTRY glGetTexEnviv (GLenum env, GLenum pname, GLint *params); +GL_API void GL_APIENTRY glGetTexEnvxv (GLenum env, GLenum pname, GLfixed *params); +GL_API void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params); +GL_API void GL_APIENTRY glGetTexParameterxv (GLenum target, GLenum pname, GLfixed *params); +GL_API void GL_APIENTRY glHint (GLenum target, GLenum mode); +GL_API GLboolean GL_APIENTRY glIsBuffer (GLuint buffer); +GL_API GLboolean GL_APIENTRY glIsEnabled (GLenum cap); +GL_API GLboolean GL_APIENTRY glIsTexture (GLuint texture); +GL_API void GL_APIENTRY glLightModelx (GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glLightModelxv (GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glLightx (GLenum light, GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glLightxv (GLenum light, GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glLineWidthx (GLfixed width); +GL_API void GL_APIENTRY glLoadIdentity (void); +GL_API void GL_APIENTRY glLoadMatrixx (const GLfixed *m); +GL_API void GL_APIENTRY glLogicOp (GLenum opcode); +GL_API void GL_APIENTRY glMaterialx (GLenum face, GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glMaterialxv (GLenum face, GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glMatrixMode (GLenum mode); +GL_API void GL_APIENTRY glMultMatrixx (const GLfixed *m); +GL_API void GL_APIENTRY glMultiTexCoord4x (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q); +GL_API void GL_APIENTRY glNormal3x (GLfixed nx, GLfixed ny, GLfixed nz); +GL_API void GL_APIENTRY glNormalPointer (GLenum type, GLsizei stride, const GLvoid *pointer); +GL_API void GL_APIENTRY glOrthox (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); +GL_API void GL_APIENTRY glPixelStorei (GLenum pname, GLint param); +GL_API void GL_APIENTRY glPointParameterx (GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glPointParameterxv (GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glPointSizex (GLfixed size); +GL_API void GL_APIENTRY glPolygonOffsetx (GLfixed factor, GLfixed units); +GL_API void GL_APIENTRY glPopMatrix (void); +GL_API void GL_APIENTRY glPushMatrix (void); +GL_API void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels); +GL_API void GL_APIENTRY glRotatex (GLfixed angle, GLfixed x, GLfixed y, GLfixed z); +GL_API void GL_APIENTRY glSampleCoverage (GLclampf value, GLboolean invert); +GL_API void GL_APIENTRY glSampleCoveragex (GLclampx value, GLboolean invert); +GL_API void GL_APIENTRY glScalex (GLfixed x, GLfixed y, GLfixed z); +GL_API void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height); +GL_API void GL_APIENTRY glShadeModel (GLenum mode); +GL_API void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask); +GL_API void GL_APIENTRY glStencilMask (GLuint mask); +GL_API void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass); +GL_API void GL_APIENTRY glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GL_API void GL_APIENTRY glTexEnvi (GLenum target, GLenum pname, GLint param); +GL_API void GL_APIENTRY glTexEnvx (GLenum target, GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glTexEnviv (GLenum target, GLenum pname, const GLint *params); +GL_API void GL_APIENTRY glTexEnvxv (GLenum target, GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GL_API void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param); +GL_API void GL_APIENTRY glTexParameterx (GLenum target, GLenum pname, GLfixed param); +GL_API void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params); +GL_API void GL_APIENTRY glTexParameterxv (GLenum target, GLenum pname, const GLfixed *params); +GL_API void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +GL_API void GL_APIENTRY glTranslatex (GLfixed x, GLfixed y, GLfixed z); +GL_API void GL_APIENTRY glVertexPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GL_API void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height); + +/*****************************************************************************************/ +/* OES extension functions */ +/*****************************************************************************************/ +/* OES_matrix_palette */ +GL_API void GL_APIENTRY glCurrentPaletteMatrixOES (GLuint matrixpaletteindex); +GL_API void GL_APIENTRY glLoadPaletteFromModelViewMatrixOES (void); +GL_API void GL_APIENTRY glMatrixIndexPointerOES (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GL_API void GL_APIENTRY glWeightPointerOES (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); + +/* OES_point_size_array */ +GL_API void GL_APIENTRY glPointSizePointerOES (GLenum type, GLsizei stride, const GLvoid *pointer); + +/* OES_draw_texture */ +GL_API void GL_APIENTRY glDrawTexsOES (GLshort x, GLshort y, GLshort z, GLshort width, GLshort height); +GL_API void GL_APIENTRY glDrawTexiOES (GLint x, GLint y, GLint z, GLint width, GLint height); +GL_API void GL_APIENTRY glDrawTexxOES (GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height); + +GL_API void GL_APIENTRY glDrawTexsvOES (const GLshort *coords); +GL_API void GL_APIENTRY glDrawTexivOES (const GLint *coords); +GL_API void GL_APIENTRY glDrawTexxvOES (const GLfixed *coords); + +GL_API void GL_APIENTRY glDrawTexfOES (GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height); +GL_API void GL_APIENTRY glDrawTexfvOES (const GLfloat *coords); + + +GL_API void GL_APIENTRY glBegin(GLenum mode); +GL_API void GL_APIENTRY glEnd(void); +GL_API void GL_APIENTRY glVertex2f(GLfloat x, GLfloat y); +GL_API void GL_APIENTRY glColor3f( GLfloat red, GLfloat green, GLfloat blue); + +GL_API void GL_APIENTRY glClearDepth( GLclampf depth ); +GL_API void GL_APIENTRY glFrustum (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); + +#ifdef __cplusplus +} +#endif + +#endif /* __gl_h_ */ + diff --git a/wiz/GL/glext.h b/wiz/GL/glext.h new file mode 100755 index 000000000..1ab015a49 --- /dev/null +++ b/wiz/GL/glext.h @@ -0,0 +1,77 @@ +#ifndef __glext_h_ +#define __glext_h_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright 1992-2003, Silicon Graphics, Inc. +** All Rights Reserved. +** +** This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.; +** the contents of this file may not be disclosed to third parties, copied or +** duplicated in any form, in whole or in part, without the prior written +** permission of Silicon Graphics, Inc. +** +** RESTRICTED RIGHTS LEGEND: +** Use, duplication or disclosure by the Government is subject to restrictions +** as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data +** and Computer Software clause at DFARS 252.227-7013, and/or in similar or +** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished - +** rights reserved under the Copyright Laws of the United States. +*/ + +#define GL_OES_query_matrix 1 + + +#define GL_HARDWAREBUFFER_ARRAY_OES 0x9000 + +#define GL_HWBUFFER_SIZE_OES 0 +#define GL_HWBUFFER_FORMAT_OES 1 + +// Fixed or Float(fixed:1, float:0) / Num of element( 1, 2, 3, 4, 5(?) ) / Format ( vctn:0, vnct:1, vtnc:2 ) +#define GL_HWBUFFER_FV_OES 0x010 +#define GL_HWBUFFER_XV_OES 0x110 +#define GL_HWBUFFER_FVN_OES 0x021 +#define GL_HWBUFFER_XVN_OES 0x121 +#define GL_HWBUFFER_FVC_OES 0x020 +#define GL_HWBUFFER_XVC_OES 0x120 +//#define GL_HWBUFFER_FVCN_OES 6 +//#define GL_HWBUFFER_XVCN_OES 7 +#define GL_HWBUFFER_FVT_OES 0x022 +#define GL_HWBUFFER_XVT_OES 0x122 +//#define GL_HWBUFFER_FVTN_OES 10 +//#define GL_HWBUFFER_XVTN_OES 11 +//#define GL_HWBUFFER_FVCT_OES 12 +//#define GL_HWBUFFER_XVCT_OES 13 +#define GL_HWBUFFER_FVCTN_OES 0x040 +#define GL_HWBUFFER_XVCTN_OES 0x140 + + +/* OES_query_matrix */ +GL_API GLbitfield GL_APIENTRY glQueryMatrixxOES(GLfixed *mantissa, GLint *exponent); + +/* OES hardware buffer object */ +GL_API void glGenHWBuffersOES(GLsizei n, GLuint *hwbuffers); +GL_API void glDeleteHWBuffersOES(GLsizei n, const GLuint *hwbuffers); +GL_API void glBindHWBufferOES(GLenum target, GLuint hwbuffer); +GL_API GLboolean glIsHWBufferOES(GLuint hwbuffer); +GL_API void glGetHWBufferParameterivOES(GLenum target, GLenum pname, GLint * params); +GL_API void glHWBufferDataOES(GLenum target, GLsizeiptr n, const GLvoid * data, GLenum format); +GL_API void glHWBufferSubDataOES(GLenum target, GLintptr offset_n, GLsizeiptr n, const GLvoid *data); + +#ifndef LF1000 +/* OES video texture */ +GL_API void glTexImage2DFromVideoOES(const GLvoid *pY,const GLvoid *pCb,const GLvoid *pCr, + GLint clipx, GLint clipy, GLsizei clipwidth, GLsizei clipheight ); + +/* OES set color key */ +GL_API void glTexColorKeyOES(GLboolean enable, GLshort colorkey_r5g6b5 ); +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __glext_h_ */ diff --git a/wiz/GL/libogl.h b/wiz/GL/libogl.h new file mode 100755 index 000000000..93278a619 --- /dev/null +++ b/wiz/GL/libogl.h @@ -0,0 +1,54 @@ +//------------------------------------------------------------------------------ +// +// libogl interface +//------------------------------------------------------------------------------ +#ifndef __libogl_h__ +#define __libogl_h__ + +//------------------------------------------------------------------------------ +// +// +// interface between the OpenGL ES 1.1 lite and operating systems +// +// +//------------------------------------------------------------------------------ +#ifdef __cplusplus +extern "C" { +#endif + void OS_InitFakeOS( void ); + NativeWindowType OS_CreateWindow(); + unsigned int OS_GetTickCount( void ); + void OS_GetWindowSize( NativeWindowType hNativeWnd, int* width, int* height ); + void OS_Sleep( unsigned int milliseconds ); + + + typedef int GLESOALbool; + + typedef struct + { + unsigned int VirtualAddressOf3DCore ; // virtual address of the 3D core register + + unsigned int Memory1D_VirtualAddress ; // must be 8byte aligned, non-cacheable + unsigned int Memory1D_PhysicalAddress; // must be 8byte aligned, non-cacheable + unsigned int Memory1D_SizeInMbyte ; // size (Mbyte) + + unsigned int Memory2D_VirtualAddress ; // must be 4Mbyte aligned, non-cacheable + unsigned int Memory2D_PhysicalAddress; // must be 4Mbyte aligned, non-cacheable + unsigned int Memory2D_SizeInMbyte ; // size (Mbyte), must be multiple of 4 + } ___OAL_MEMORY_INFORMATION__; + + + GLESOALbool GLESOAL_Initalize( ___OAL_MEMORY_INFORMATION__* pMemoryInfomation, int FSAAEnb); + void GLESOAL_Finalize( void ); + void GLESOAL_SwapBufferCallback( void ); + void GLESOAL_SetWindow ( void* pNativeWindow ); + void GLESOAL_GetWindowSize( int* pWidth, int* pHeight ); + void GLESOAL_WaitForDisplayAddressPatched( void ); + void GLESOAL_SetDisplayAddress( const unsigned int DisplayBufferPhysicalAddress ); + void GLESOAL_Sleep( unsigned long Milliseconds ); + +#ifdef __cplusplus +} +#endif + +#endif // ___libogl_h__ diff --git a/wiz/GL/nanogl.h b/wiz/GL/nanogl.h new file mode 100644 index 000000000..449d293bc --- /dev/null +++ b/wiz/GL/nanogl.h @@ -0,0 +1,37 @@ +/* +Copyright (C) 2007-2009 Olli Hinkka + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ + +#ifndef __NANOGL__H__ +#define __NANOGL__H__ + +#ifdef __cplusplus +extern "C" { +#endif + +int nanoGL_Init(void); +void nanoGL_Destroy(void); + +#ifdef __cplusplus +} +#endif + + +#endif + diff --git a/wiz/GL/wizGLES.h b/wiz/GL/wizGLES.h new file mode 100755 index 000000000..43f4afa4f --- /dev/null +++ b/wiz/GL/wizGLES.h @@ -0,0 +1,46 @@ +/* +Copyright (C) 2007-2009 Olli Hinkka + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ + +#ifndef __WIZGLES__H__ +#define __WIZGLES__H__ + +#include "GL/egltypes.h" + +#ifdef __cplusplus +extern "C" { +#endif + +NativeWindowType OS_CreateWindow(); +unsigned int OS_GetTickCount(void); +void GLESOAL_Finalize( void ); +void GLESOAL_SwapBufferCallback( void ); +void GLESOAL_SetWindow ( void* pNativeWindow ); +void GLESOAL_GetWindowSize( int* pWidth, int* pHeight ); +void GLESOAL_WaitForDisplayAddressPatched( void ); +void GLESOAL_SetDisplayAddress( const unsigned int DisplayBufferPhysicalAddress ); +void GLESOAL_Sleep( unsigned long Milliseconds ); +int GLESOAL_GetDisplayDirection(void); + +#ifdef __cplusplus +} +#endif + + +#endif