added nanogl library

This commit is contained in:
lubomyr
2016-03-09 22:58:02 +02:00
parent ccbcb5130e
commit 92de300ea5
12 changed files with 3689 additions and 1 deletions

Submodule project/jni/nanogl deleted from 5ea04e4036

View File

@@ -0,0 +1,35 @@
# Copyright (C) 2009 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := nanogl
#include $(XASH3D_CONFIG)
LOCAL_CFLAGS +=
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include/GL
LOCAL_SRC_FILES := \
src/nanogl.cpp \
src/nanoWrap.cpp \
src/eglwrap.cpp
#LOCAL_LDLIBS := -llog
include $(BUILD_STATIC_LIBRARY)

View File

@@ -0,0 +1,3 @@
OpenGL 1.x to OpenGL ES 1.x wrapper by Olli Hinkka
Extracted from Quake 2 port

View File

@@ -0,0 +1,192 @@
#ifndef __EGL__H__
#define __EGL__H__
typedef int EGLBoolean;
typedef int EGLint;
typedef int EGLDisplay;
typedef int EGLConfig;
typedef int EGLSurface;
typedef int EGLContext;
typedef int NativeDisplayType;
typedef void* NativeWindowType;
typedef void* NativePixmapType;
#define EGL_DEFAULT_DISPLAY 0
#define EGL_NO_CONTEXT 0
#define EGL_NO_DISPLAY 0
#define EGL_NO_SURFACE 0
/*
** 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
#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
#ifdef __cplusplus
extern "C" {
#endif
EGLint eglGetError (void);
EGLDisplay eglGetDisplay (NativeDisplayType display);
EGLBoolean eglInitialize (EGLDisplay dpy, EGLint *major, EGLint *minor);
EGLBoolean eglTerminate (EGLDisplay dpy);
const char * eglQueryString (EGLDisplay dpy, EGLint name);
//#ifdef __cplusplus
//void (* eglGetProcAddress (const char *procname))(...);
//#else
void * eglGetProcAddress (const char *procname);
//#endif
EGLBoolean eglGetConfigs (EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config);
EGLBoolean eglChooseConfig (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config);
EGLBoolean eglGetConfigAttrib (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value);
EGLSurface eglCreateWindowSurface (EGLDisplay dpy, EGLConfig config, NativeWindowType window, const EGLint *attrib_list);
EGLSurface eglCreatePixmapSurface (EGLDisplay dpy, EGLConfig config, NativePixmapType pixmap, const EGLint *attrib_list);
EGLSurface eglCreatePbufferSurface (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
EGLBoolean eglDestroySurface (EGLDisplay dpy, EGLSurface surface);
EGLBoolean eglQuerySurface (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value);
/* EGL 1.1 render-to-texture APIs */
EGLBoolean eglSurfaceAttrib (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value);
EGLBoolean eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
EGLBoolean eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
/* EGL 1.1 swap control API */
EGLBoolean eglSwapInterval(EGLDisplay dpy, EGLint interval);
EGLContext eglCreateContext (EGLDisplay dpy, EGLConfig config, EGLContext share_list, const EGLint *attrib_list);
EGLBoolean eglDestroyContext (EGLDisplay dpy, EGLContext ctx);
EGLBoolean eglMakeCurrent (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx);
EGLContext eglGetCurrentContext (void);
EGLSurface eglGetCurrentSurface (EGLint readdraw);
EGLDisplay eglGetCurrentDisplay (void);
EGLBoolean eglQueryContext (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value);
EGLBoolean eglWaitGL (void);
EGLBoolean eglWaitNative (EGLint engine);
EGLBoolean eglSwapBuffers (EGLDisplay dpy, EGLSurface draw);
EGLBoolean eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, NativePixmapType target);
#ifdef __cplusplus
}
#endif
#endif /* ___egl_h_ */

View File

@@ -0,0 +1,700 @@
#ifndef __GL__H__
#define __GL__H__
#ifdef __cplusplus
extern "C" {
#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 double GLdouble;
typedef float GLclampf;
typedef float GLclampd;
typedef void GLvoid;
typedef int GLfixed;
typedef int GLclampx;
/* Boolean values */
#define GL_FALSE 0x0
#define GL_TRUE 0x1
/* Data types */
#define GL_BYTE 0x1400
#define GL_UNSIGNED_BYTE 0x1401
#define GL_SHORT 0x1402
#define GL_UNSIGNED_SHORT 0x1403
#define GL_INT 0x1404
#define GL_UNSIGNED_INT 0x1405
#define GL_FLOAT 0x1406
#define GL_2_BYTES 0x1407
#define GL_3_BYTES 0x1408
#define GL_4_BYTES 0x1409
#define GL_DOUBLE 0x140A
/* StringName */
#define GL_VENDOR 0x1F00
#define GL_RENDERER 0x1F01
#define GL_VERSION 0x1F02
#define GL_EXTENSIONS 0x1F03
/* TextureEnvMode */
#define GL_MODULATE 0x2100
#define GL_DECAL 0x2101
/* GL_BLEND */
#define GL_ADD 0x0104
/* GL_REPLACE */
/* Primitives */
#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
#define GL_QUADS 0x0007
#define GL_QUAD_STRIP 0x0008
#define GL_POLYGON 0x0009
/* 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
/* Texture mapping */
#define GL_TEXTURE_ENV 0x2300
#define GL_TEXTURE_ENV_MODE 0x2200
#define GL_TEXTURE_1D 0x0DE0
#define GL_TEXTURE_2D 0x0DE1
#define GL_TEXTURE_WRAP_S 0x2802
#define GL_TEXTURE_WRAP_T 0x2803
#define GL_TEXTURE_MAG_FILTER 0x2800
#define GL_TEXTURE_MIN_FILTER 0x2801
#define GL_TEXTURE_ENV_COLOR 0x2201
#define GL_TEXTURE_GEN_S 0x0C60
#define GL_TEXTURE_GEN_T 0x0C61
#define GL_TEXTURE_GEN_MODE 0x2500
#define GL_TEXTURE_BORDER_COLOR 0x1004
#define GL_TEXTURE_WIDTH 0x1000
#define GL_TEXTURE_HEIGHT 0x1001
#define GL_TEXTURE_BORDER 0x1005
#define GL_TEXTURE_COMPONENTS 0x1003
#define GL_TEXTURE_RED_SIZE 0x805C
#define GL_TEXTURE_GREEN_SIZE 0x805D
#define GL_TEXTURE_BLUE_SIZE 0x805E
#define GL_TEXTURE_ALPHA_SIZE 0x805F
#define GL_TEXTURE_LUMINANCE_SIZE 0x8060
#define GL_TEXTURE_INTENSITY_SIZE 0x8061
#define GL_NEAREST_MIPMAP_NEAREST 0x2700
#define GL_NEAREST_MIPMAP_LINEAR 0x2702
#define GL_LINEAR_MIPMAP_NEAREST 0x2701
#define GL_LINEAR_MIPMAP_LINEAR 0x2703
#define GL_OBJECT_LINEAR 0x2401
#define GL_OBJECT_PLANE 0x2501
#define GL_EYE_LINEAR 0x2400
#define GL_EYE_PLANE 0x2502
#define GL_SPHERE_MAP 0x2402
#define GL_DECAL 0x2101
#define GL_MODULATE 0x2100
#define GL_NEAREST 0x2600
#define GL_REPEAT 0x2901
#define GL_CLAMP 0x2900
#define GL_S 0x2000
#define GL_T 0x2001
#define GL_R 0x2002
#define GL_Q 0x2003
#define GL_TEXTURE_GEN_R 0x0C62
#define GL_TEXTURE_GEN_Q 0x0C63
#define GL_CLAMP_TO_EDGE 0x812F
/* Matrix Mode */
#define GL_MATRIX_MODE 0x0BA0
#define GL_MODELVIEW 0x1700
#define GL_PROJECTION 0x1701
#define GL_TEXTURE 0x1702
/* Buffers, Pixel Drawing/Reading */
#define GL_NONE 0x0
#define GL_LEFT 0x0406
#define GL_RIGHT 0x0407
/*GL_FRONT 0x0404 */
/*GL_BACK 0x0405 */
/*GL_FRONT_AND_BACK 0x0408 */
#define GL_FRONT_LEFT 0x0400
#define GL_FRONT_RIGHT 0x0401
#define GL_BACK_LEFT 0x0402
#define GL_BACK_RIGHT 0x0403
#define GL_AUX0 0x0409
#define GL_AUX1 0x040A
#define GL_AUX2 0x040B
#define GL_AUX3 0x040C
#define GL_COLOR_INDEX 0x1900
#define GL_RED 0x1903
#define GL_GREEN 0x1904
#define GL_BLUE 0x1905
#define GL_ALPHA 0x1906
#define GL_LUMINANCE 0x1909
#define GL_LUMINANCE_ALPHA 0x190A
#define GL_ALPHA_BITS 0x0D55
#define GL_RED_BITS 0x0D52
#define GL_GREEN_BITS 0x0D53
#define GL_BLUE_BITS 0x0D54
#define GL_INDEX_BITS 0x0D51
#define GL_SUBPIXEL_BITS 0x0D50
#define GL_AUX_BUFFERS 0x0C00
#define GL_READ_BUFFER 0x0C02
#define GL_DRAW_BUFFER 0x0C01
#define GL_DOUBLEBUFFER 0x0C32
#define GL_STEREO 0x0C33
#define GL_BITMAP 0x1A00
#define GL_COLOR 0x1800
#define GL_DEPTH 0x1801
#define GL_STENCIL 0x1802
#define GL_DITHER 0x0BD0
#define GL_RGB 0x1907
#define GL_RGBA 0x1908
/* Fog */
#define GL_FOG 0x0B60
#define GL_FOG_MODE 0x0B65
#define GL_FOG_DENSITY 0x0B62
#define GL_FOG_COLOR 0x0B66
#define GL_FOG_INDEX 0x0B61
#define GL_FOG_START 0x0B63
#define GL_FOG_END 0x0B64
#define GL_LINEAR 0x2601
#define GL_EXP 0x0800
#define GL_EXP2 0x0801
/* Polygons */
#define GL_POINT 0x1B00
#define GL_LINE 0x1B01
#define GL_FILL 0x1B02
#define GL_CW 0x0900
#define GL_CCW 0x0901
#define GL_FRONT 0x0404
#define GL_BACK 0x0405
#define GL_POLYGON_MODE 0x0B40
#define GL_POLYGON_SMOOTH 0x0B41
#define GL_POLYGON_STIPPLE 0x0B42
#define GL_EDGE_FLAG 0x0B43
#define GL_CULL_FACE 0x0B44
#define GL_CULL_FACE_MODE 0x0B45
#define GL_FRONT_FACE 0x0B46
#define GL_POLYGON_OFFSET_FACTOR 0x8038
#define GL_POLYGON_OFFSET_UNITS 0x2A00
#define GL_POLYGON_OFFSET_POINT 0x2A01
#define GL_POLYGON_OFFSET_LINE 0x2A02
#define GL_POLYGON_OFFSET_FILL 0x8037
/* Lighting */
#define GL_LIGHTING 0x0B50
#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
#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
#define GL_AMBIENT 0x1200
#define GL_DIFFUSE 0x1201
#define GL_SPECULAR 0x1202
#define GL_SHININESS 0x1601
#define GL_EMISSION 0x1600
#define GL_POSITION 0x1203
#define GL_SPOT_DIRECTION 0x1204
#define GL_AMBIENT_AND_DIFFUSE 0x1602
#define GL_COLOR_INDEXES 0x1603
#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52
#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51
#define GL_LIGHT_MODEL_AMBIENT 0x0B53
#define GL_FRONT_AND_BACK 0x0408
#define GL_SHADE_MODEL 0x0B54
#define GL_FLAT 0x1D00
#define GL_SMOOTH 0x1D01
#define GL_COLOR_MATERIAL 0x0B57
#define GL_COLOR_MATERIAL_FACE 0x0B55
#define GL_COLOR_MATERIAL_PARAMETER 0x0B56
#define GL_NORMALIZE 0x0BA1
/* Blending */
#define GL_BLEND 0x0BE2
#define GL_BLEND_SRC 0x0BE1
#define GL_BLEND_DST 0x0BE0
#define GL_ZERO 0x0
#define GL_ONE 0x1
#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
#define GL_DST_COLOR 0x0306
#define GL_ONE_MINUS_DST_COLOR 0x0307
#define GL_SRC_ALPHA_SATURATE 0x0308
/* 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
/* OpenGL 1.1 */
#define GL_PROXY_TEXTURE_1D 0x8063
#define GL_PROXY_TEXTURE_2D 0x8064
#define GL_TEXTURE_PRIORITY 0x8066
#define GL_TEXTURE_RESIDENT 0x8067
#define GL_TEXTURE_BINDING_1D 0x8068
#define GL_TEXTURE_BINDING_2D 0x8069
#define GL_TEXTURE_INTERNAL_FORMAT 0x1003
#define GL_ALPHA4 0x803B
#define GL_ALPHA8 0x803C
#define GL_ALPHA12 0x803D
#define GL_ALPHA16 0x803E
#define GL_LUMINANCE4 0x803F
#define GL_LUMINANCE8 0x8040
#define GL_LUMINANCE12 0x8041
#define GL_LUMINANCE16 0x8042
#define GL_LUMINANCE4_ALPHA4 0x8043
#define GL_LUMINANCE6_ALPHA2 0x8044
#define GL_LUMINANCE8_ALPHA8 0x8045
#define GL_LUMINANCE12_ALPHA4 0x8046
#define GL_LUMINANCE12_ALPHA12 0x8047
#define GL_LUMINANCE16_ALPHA16 0x8048
#define GL_INTENSITY 0x8049
#define GL_INTENSITY4 0x804A
#define GL_INTENSITY8 0x804B
#define GL_INTENSITY12 0x804C
#define GL_INTENSITY16 0x804D
#define GL_R3_G3_B2 0x2A10
#define GL_RGB4 0x804F
#define GL_RGB5 0x8050
#define GL_RGB8 0x8051
#define GL_RGB10 0x8052
#define GL_RGB12 0x8053
#define GL_RGB16 0x8054
#define GL_RGBA2 0x8055
#define GL_RGBA4 0x8056
#define GL_RGB5_A1 0x8057
#define GL_RGBA8 0x8058
#define GL_RGB10_A2 0x8059
#define GL_RGBA12 0x805A
#define GL_RGBA16 0x805B
#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
#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001
#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002
#define GL_ALL_CLIENT_ATTRIB_BITS 0xFFFFFFFF
#define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF
/* Stencil */
#define GL_STENCIL_TEST 0x0B90
#define GL_STENCIL_WRITEMASK 0x0B98
#define GL_STENCIL_BITS 0x0D57
#define GL_STENCIL_FUNC 0x0B92
#define GL_STENCIL_VALUE_MASK 0x0B93
#define GL_STENCIL_REF 0x0B97
#define GL_STENCIL_FAIL 0x0B94
#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
#define GL_STENCIL_CLEAR_VALUE 0x0B91
#define GL_STENCIL_INDEX 0x1901
#define GL_KEEP 0x1E00
#define GL_REPLACE 0x1E01
#define GL_INCR 0x1E02
#define GL_DECR 0x1E03
/* Hints */
#define GL_FOG_HINT 0x0C54
#define GL_LINE_SMOOTH_HINT 0x0C52
#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50
#define GL_POINT_SMOOTH_HINT 0x0C51
#define GL_POLYGON_SMOOTH_HINT 0x0C53
#define GL_DONT_CARE 0x1100
#define GL_FASTEST 0x1101
#define GL_NICEST 0x1102
/* Gets */
#define GL_ATTRIB_STACK_DEPTH 0x0BB0
#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1
#define GL_COLOR_CLEAR_VALUE 0x0C22
#define GL_COLOR_WRITEMASK 0x0C23
#define GL_CURRENT_INDEX 0x0B01
#define GL_CURRENT_COLOR 0x0B00
#define GL_CURRENT_NORMAL 0x0B02
#define GL_CURRENT_RASTER_COLOR 0x0B04
#define GL_CURRENT_RASTER_DISTANCE 0x0B09
#define GL_CURRENT_RASTER_INDEX 0x0B05
#define GL_CURRENT_RASTER_POSITION 0x0B07
#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06
#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08
#define GL_CURRENT_TEXTURE_COORDS 0x0B03
#define GL_INDEX_CLEAR_VALUE 0x0C20
#define GL_INDEX_MODE 0x0C30
#define GL_INDEX_WRITEMASK 0x0C21
#define GL_MODELVIEW_MATRIX 0x0BA6
#define GL_MODELVIEW_STACK_DEPTH 0x0BA3
#define GL_NAME_STACK_DEPTH 0x0D70
#define GL_PROJECTION_MATRIX 0x0BA7
#define GL_PROJECTION_STACK_DEPTH 0x0BA4
#define GL_RENDER_MODE 0x0C40
#define GL_RGBA_MODE 0x0C31
#define GL_TEXTURE_MATRIX 0x0BA8
#define GL_TEXTURE_STACK_DEPTH 0x0BA5
#define GL_VIEWPORT 0x0BA2
/* glPush/PopAttrib bits */
#define GL_CURRENT_BIT 0x00000001
#define GL_POINT_BIT 0x00000002
#define GL_LINE_BIT 0x00000004
#define GL_POLYGON_BIT 0x00000008
#define GL_POLYGON_STIPPLE_BIT 0x00000010
#define GL_PIXEL_MODE_BIT 0x00000020
#define GL_LIGHTING_BIT 0x00000040
#define GL_FOG_BIT 0x00000080
#define GL_DEPTH_BUFFER_BIT 0x00000100
#define GL_ACCUM_BUFFER_BIT 0x00000200
#define GL_STENCIL_BUFFER_BIT 0x00000400
#define GL_VIEWPORT_BIT 0x00000800
#define GL_TRANSFORM_BIT 0x00001000
#define GL_ENABLE_BIT 0x00002000
#define GL_COLOR_BUFFER_BIT 0x00004000
#define GL_HINT_BIT 0x00008000
#define GL_EVAL_BIT 0x00010000
#define GL_LIST_BIT 0x00020000
#define GL_TEXTURE_BIT 0x00040000
#define GL_SCISSOR_BIT 0x00080000
#define GL_ALL_ATTRIB_BITS 0x000FFFFF
/* Depth buffer */
#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
#define GL_DEPTH_TEST 0x0B71
#define GL_DEPTH_BITS 0x0D56
#define GL_DEPTH_CLEAR_VALUE 0x0B73
#define GL_DEPTH_FUNC 0x0B74
#define GL_DEPTH_RANGE 0x0B70
#define GL_DEPTH_WRITEMASK 0x0B72
#define GL_DEPTH_COMPONENT 0x1902
/* 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
/* 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
/* 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
// Vladimir
#define glVertex2i(x,y) glVertex3f(x,y,0.0)
#define glTexCoord2d glTexCoord2f
#define glVertex3d glVertex3f
//#define glColor4ub(x,y,z,p) glColor4f(x,y,z,p) //nicknekit: wtf???
#define glFogi glFogf
//
void glBegin(GLenum mode);
void glEnd(void);
void glEnable (GLenum cap);
void glDisable (GLenum cap);
void glVertex2f(GLfloat x, GLfloat y);
void glColor3f( GLfloat red, GLfloat green, GLfloat blue);
void glTexCoord2f(GLfloat s, GLfloat t);
void glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
void glLoadIdentity (void);
void glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
void glOrtho (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
void glMatrixMode (GLenum mode);
void glTexParameterf (GLenum target, GLenum pname, GLfloat param);
void glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
void glDrawBuffer(GLenum mode);
void glTranslatef (GLfloat x, GLfloat y, GLfloat z);
void glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
void glScalef (GLfloat x, GLfloat y, GLfloat z);
void glDepthRange(GLclampf zNear, GLclampf zFar);
void glDepthFunc (GLenum func);
void glFinish (void);
void glGetFloatv (GLenum pname, GLfloat *params);
void glGetIntegerv (GLenum pname, GLint *params);
void glCullFace (GLenum mode);
void glFrustum (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
void glClear (GLbitfield mask);
void glVertex3f( GLfloat x, GLfloat y, GLfloat z );
void glColor4fv( const GLfloat *v );
void glHint (GLenum target, GLenum mode);
void glBlendFunc (GLenum sfactor, GLenum dfactor);
void glPopMatrix (void);
void glShadeModel (GLenum mode);
void glPushMatrix (void);
void glTexEnvf (GLenum target, GLenum pname, GLfloat param);
void glVertex3fv( const GLfloat *v );
void glDepthMask (GLboolean flag);
void glBindTexture (GLenum target, GLuint texture);
const GLubyte* glGetString (GLenum name);
void glAlphaFunc (GLenum func, GLclampf ref);
void glFlush (void);
void glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
void glReadBuffer( GLenum mode );
void glLoadMatrixf (const GLfloat *m);
void glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
void glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
GLenum glGetError (void);
void glActiveTexture (GLenum texture);
void glClientActiveTexture (GLenum texture);
void glColor3ubv( const GLubyte* v);
void glPolygonMode( GLenum face, GLenum mode );
void glArrayElement(GLint i);
void glLineWidth(GLfloat width);
void glCallList( GLuint list );
void glTexCoord2fv( const GLfloat *v );
void glColorMask( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha );
void glStencilFunc( GLenum func, GLint ref, GLuint mask );
void glStencilOp( GLenum fail, GLenum zfail, GLenum zpass );
void glColor4ubv( const GLubyte *v );
void glDrawElements( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices );
void glEnableClientState( GLenum array );
void glDisableClientState(GLenum array);
void glVertexPointer( GLint size, GLenum type,GLsizei stride, const GLvoid *pointer );
void glTexCoordPointer( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer );
void glColorPointer( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer );
void glPolygonOffset( GLfloat factor, GLfloat units );
void glClearDepth( GLclampf depth );
void glDeleteTextures( GLsizei n, const GLuint *textures );
void glTexParameterfv( GLenum target, GLenum pname, const GLfloat * params);
void glStencilMask( GLuint mask );
void glClearStencil( GLint s );
void glScissor( GLint x, GLint y, GLsizei width, GLsizei height );
void glClipPlane( GLenum plane, const GLdouble *equation );
void glColor3fv( const GLfloat *v );
void glPointSize( GLfloat size );
// Vladimir
void glDrawArrays( GLenum mode, int first, int count);
void glMultMatrixf (const GLfloat *m);
void glPixelStorei (GLenum pname, GLint param);
void glFogf (GLenum pname, GLfloat param);
void glFogfv (GLenum pname, const GLfloat *params);
void glGetTexParameteriv (GLenum target, GLenum pname, GLint *params);
void glTexParameteri (GLenum target, GLenum pname, GLint param);
void glTexParameterf (GLenum target, GLenum pname, GLfloat param);
void glTexParameterx (GLenum target, GLenum pname, GLfixed param);
void glGenTextures (GLsizei n, GLuint *textures);
void glFrontFace (GLenum mode);
//nicknekit: for xash3d
void glColor3ub( GLubyte red, GLubyte green, GLubyte blue);
void glNormal3fv( const GLfloat *v );
void glCopyTexImage2D( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border );
void glTexImage1D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
void glTexImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
void glTexSubImage1D( GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels );
void glTexSubImage3D( GLenum target, GLint level,
GLint xoffset, GLint yoffset,
GLint zoffset, GLsizei width,
GLsizei height, GLsizei depth,
GLenum format,
GLenum type, const GLvoid *pixels);
GLboolean glIsTexture(GLuint texture);
void glTexGeni( GLenum coord, GLenum pname, GLint param );
void glTexGenfv( GLenum coord, GLenum pname, const GLfloat *params );
void glColor4ub( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,184 @@
//
GL_ENTRY(int,eglChooseConfig,int dpy, const int *attrib_list, int *configs, int config_size, int *num_config)
GL_ENTRY(int,eglCopyBuffers,int dpy, int surface, void* target)
GL_ENTRY(int,eglCreateContext,int dpy, int config, int share_list, const int *attrib_list)
GL_ENTRY(int,eglCreatePbufferSurface,int dpy, int config, const int *attrib_list)
GL_ENTRY(int,eglCreatePixmapSurface,int dpy, int config, void* pixmap, const int *attrib_list)
GL_ENTRY(int,eglCreateWindowSurface,int dpy, int config, void* window, const int *attrib_list)
GL_ENTRY(int,eglDestroyContext,int dpy, int ctx)
GL_ENTRY(int,eglDestroySurface,int dpy, int surface)
GL_ENTRY(int,eglGetConfigAttrib,int dpy, int config, int attribute, int *value)
GL_ENTRY(int,eglGetConfigs,int dpy, int *configs, int config_size, int *num_config)
GL_ENTRY(int,eglGetCurrentContext,void)
GL_ENTRY(int,eglGetCurrentDisplay,void)
GL_ENTRY(int,eglGetCurrentSurface,int readdraw)
GL_ENTRY(int,eglGetDisplay,int display)
GL_ENTRY(int,eglGetError,void)
GL_ENTRY(void, eglGetProcAddress,const char *procname)
GL_ENTRY(int,eglInitialize,int dpy, int *major, int *minor)
GL_ENTRY(int,eglMakeCurrent,int dpy, int draw, int read, int ctx)
GL_ENTRY(int,eglQueryContext,int dpy, int ctx, int attribute, int *value)
GL_ENTRY(const char * ,eglQueryString,int dpy, int name)
GL_ENTRY(int,eglQuerySurface,int dpy, int surface, int attribute, int *value)
GL_ENTRY(int,eglSwapBuffers,int dpy, int draw)
GL_ENTRY(int,eglTerminate,int dpy)
GL_ENTRY(int,eglWaitGL,void)
GL_ENTRY(int,eglWaitNative,int engine)
// GL
GL_ENTRY(void,glActiveTexture,unsigned int texture)
GL_ENTRY(void,glAlphaFunc,unsigned int func, float ref)
GL_ENTRY(void,glAlphaFuncx,unsigned int func, int ref)
GL_ENTRY(void,glBindTexture,unsigned int target, unsigned int texture)
GL_ENTRY(void,glBlendFunc,unsigned int sfactor, unsigned int dfactor)
GL_ENTRY(void,glClear,unsigned int mask)
GL_ENTRY(void,glClearColor,float red, float green, float blue, float alpha)
GL_ENTRY(void,glClearColorx,int red, int green, int blue, int alpha)
GL_ENTRY(void,glClearDepthf,float depth)
GL_ENTRY(void,glClearDepthx,int depth)
GL_ENTRY(void,glClearStencil,int s)
GL_ENTRY(void,glClientActiveTexture,unsigned int texture)
GL_ENTRY(void,glColor4f,float red, float green, float blue, float alpha)
GL_ENTRY(void,glColor4x,int red, int green, int blue, int alpha)
GL_ENTRY(void,glColorMask,unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha)
GL_ENTRY(void,glColorPointer,int size, unsigned int type, int stride, const void *pointer)
GL_ENTRY(void,glCompressedTexImage2D,unsigned int target, int level, unsigned int internalformat, int width, int height, int border, int imageSize, const void *data)
GL_ENTRY(void,glCompressedTexSubImage2D,unsigned int target, int level, int xoffset, int yoffset, int width, int height, unsigned int format, int imageSize, const void *data)
GL_ENTRY(void,glCopyTexImage2D,unsigned int target, int level, unsigned int internalformat, int x, int y, int width, int height, int border)
GL_ENTRY(void,glCopyTexSubImage2D,unsigned int target, int level, int xoffset, int yoffset, int x, int y, int width, int height)
GL_ENTRY(void,glCullFace,unsigned int mode)
GL_ENTRY(void,glDeleteTextures,int n, const unsigned int *textures)
GL_ENTRY(void,glDepthFunc,unsigned int func)
GL_ENTRY(void,glDepthMask,unsigned char flag)
GL_ENTRY(void,glDepthRangef,float zNear, float zFar)
GL_ENTRY(void,glDepthRangex,int zNear, int zFar)
GL_ENTRY(void,glDisable,unsigned int cap)
GL_ENTRY(void,glDisableClientState,unsigned int array)
GL_ENTRY(void,glDrawArrays,unsigned int mode, int first, int count)
GL_ENTRY(void,glDrawElements,unsigned int mode, int count, unsigned int type, const void *indices)
GL_ENTRY(void,glEnable,unsigned int cap)
GL_ENTRY(void,glEnableClientState,unsigned int array)
GL_ENTRY(void,glFinish,void)
GL_ENTRY(void,glFlush,void)
GL_ENTRY(void,glFogf,unsigned int pname, float param)
GL_ENTRY(void,glFogfv,unsigned int pname, const float *params)
GL_ENTRY(void,glFogx,unsigned int pname, int param)
GL_ENTRY(void,glFogxv,unsigned int pname, const int *params)
GL_ENTRY(void,glFrontFace,unsigned int mode)
GL_ENTRY(void,glFrustumf,float left, float right, float bottom, float top, float zNear, float zFar)
GL_ENTRY(void,glFrustumx,int left, int right, int bottom, int top, int zNear, int zFar)
GL_ENTRY(void,glGenTextures,int n, unsigned int *textures)
GL_ENTRY(unsigned int , glGetError,void)
GL_ENTRY(void,glGetIntegerv,unsigned int pname, int *params)
GL_ENTRY(const unsigned char * , glGetString,unsigned int name)
GL_ENTRY(void,glHint,unsigned int target, unsigned int mode)
GL_ENTRY(void,glLightModelf,unsigned int pname, float param)
GL_ENTRY(void,glLightModelfv,unsigned int pname, const float *params)
GL_ENTRY(void,glLightModelx,unsigned int pname, int param)
GL_ENTRY(void,glLightModelxv,unsigned int pname, const int *params)
GL_ENTRY(void,glLightf,unsigned int light, unsigned int pname, float param)
GL_ENTRY(void,glLightfv,unsigned int light, unsigned int pname, const float *params)
GL_ENTRY(void,glLightx,unsigned int light, unsigned int pname, int param)
GL_ENTRY(void,glLightxv,unsigned int light, unsigned int pname, const int *params)
GL_ENTRY(void,glLineWidth,float width)
GL_ENTRY(void,glLineWidthx,int width)
GL_ENTRY(void,glLoadIdentity,void)
GL_ENTRY(void,glLoadMatrixf,const float *m)
GL_ENTRY(void,glLoadMatrixx,const int *m)
GL_ENTRY(void,glLogicOp,unsigned int opcode)
GL_ENTRY(void,glMaterialf,unsigned int face, unsigned int pname, float param)
GL_ENTRY(void,glMaterialfv,unsigned int face, unsigned int pname, const float *params)
GL_ENTRY(void,glMaterialx,unsigned int face, unsigned int pname, int param)
GL_ENTRY(void,glMaterialxv,unsigned int face, unsigned int pname, const int *params)
GL_ENTRY(void,glMatrixMode,unsigned int mode)
GL_ENTRY(void,glMultMatrixf,const float *m)
GL_ENTRY(void,glMultMatrixx,const int *m)
GL_ENTRY(void,glMultiTexCoord4f,unsigned int target, float s, float t, float r, float q)
GL_ENTRY(void,glMultiTexCoord4x,unsigned int target, int s, int t, int r, int q)
GL_ENTRY(void,glNormal3f,float nx, float ny, float nz)
GL_ENTRY(void,glNormal3x,int nx, int ny, int nz)
GL_ENTRY(void,glNormalPointer,unsigned int type, int stride, const void *pointer)
GL_ENTRY(void,glOrthof,float left, float right, float bottom, float top, float zNear, float zFar)
GL_ENTRY(void,glOrthox,int left, int right, int bottom, int top, int zNear, int zFar)
GL_ENTRY(void,glPixelStorei,unsigned int pname, int param)
GL_ENTRY(void,glPointSize,float size)
GL_ENTRY(void,glPointSizex,int size)
GL_ENTRY(void,glPolygonOffset,float factor, float units)
GL_ENTRY(void,glPolygonOffsetx,int factor, int units)
GL_ENTRY(void,glPopMatrix,void)
GL_ENTRY(void,glPushMatrix,void)
GL_ENTRY(unsigned int , glQueryMatrixxOES,int mantissa[16], int exponent[16])
GL_ENTRY(void,glReadPixels,int x, int y, int width, int height, unsigned int format, unsigned int type, void *pixels)
GL_ENTRY(void,glRotatef,float angle, float x, float y, float z)
GL_ENTRY(void,glRotatex,int angle, int x, int y, int z)
GL_ENTRY(void,glSampleCoverage,float value, unsigned char invert)
GL_ENTRY(void,glSampleCoveragex,int value, unsigned char invert)
GL_ENTRY(void,glScalef,float x, float y, float z)
GL_ENTRY(void,glScalex,int x, int y, int z)
GL_ENTRY(void,glScissor,int x, int y, int width, int height)
GL_ENTRY(void,glShadeModel,unsigned int mode)
GL_ENTRY(void,glStencilFunc,unsigned int func, int ref, unsigned int mask)
GL_ENTRY(void,glStencilMask,unsigned int mask)
GL_ENTRY(void,glStencilOp,unsigned int fail, unsigned int zfail, unsigned int zpass)
GL_ENTRY(void,glTexCoordPointer,int size, unsigned int type, int stride, const void *pointer)
GL_ENTRY(void,glTexEnvf,unsigned int target, unsigned int pname, float param)
GL_ENTRY(void,glTexEnvfv,unsigned int target, unsigned int pname, const float *params)
GL_ENTRY(void,glTexEnvx,unsigned int target, unsigned int pname, int param)
GL_ENTRY(void,glTexEnvxv,unsigned int target, unsigned int pname, const int *params)
GL_ENTRY(void,glTexImage2D,unsigned int target, int level, int internalformat, int width, int height, int border, unsigned int format, unsigned int type, const void *pixels)
GL_ENTRY(void,glTexParameterf,unsigned int target, unsigned int pname, float param)
GL_ENTRY(void,glTexParameterx,unsigned int target, unsigned int pname, int param)
GL_ENTRY(void,glTexSubImage2D,unsigned int target, int level, int xoffset, int yoffset, int width, int height, unsigned int format, unsigned int type, const void *pixels)
GL_ENTRY(void,glTranslatef,float x, float y, float z)
GL_ENTRY(void,glTranslatex,int x, int y, int z)
GL_ENTRY(void,glVertexPointer,int size, unsigned int type, int stride, const void *pointer)
GL_ENTRY(void,glViewport,int x, int y, int width, int height)
GL_ENTRY(int , eglSwapInterval,int dpy, int interval)
GL_ENTRY(void,glBindBuffer,unsigned int target, unsigned int buffer)
GL_ENTRY(void,glBufferData,unsigned int target, int size, const void *data, unsigned int usage)
GL_ENTRY(void,glBufferSubData,unsigned int target, int offset,int size, const void *data)
GL_ENTRY(void,glClipPlanef,unsigned int plane, const float *equation)
GL_ENTRY(void,glClipPlanex,unsigned int plane, const int *equation)
GL_ENTRY(void,glColor4ub,unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha)
GL_ENTRY(void,glDeleteBuffers,int n, const unsigned int *buffers)
GL_ENTRY(void,glGenBuffers,int n, unsigned int *buffers)
GL_ENTRY(void,glGetBooleanv,unsigned int pname, unsigned char *params)
GL_ENTRY(void,glGetBufferParameteriv,unsigned int target, unsigned int pname, int *params)
GL_ENTRY(void,glGetClipPlanef,unsigned int pname, float eqn[4])
GL_ENTRY(void,glGetClipPlanex,unsigned int pname, int eqn[4])
GL_ENTRY(void,glGetFixedv,unsigned int pname, int *params)
GL_ENTRY(void,glGetFloatv,unsigned int pname, float *params)
GL_ENTRY(void,glGetLightfv,unsigned int light, unsigned int pname, float *params)
GL_ENTRY(void,glGetLightxv,unsigned int light, unsigned int pname, int *params)
GL_ENTRY(void,glGetMaterialfv,unsigned int face, unsigned int pname, float *params)
GL_ENTRY(void,glGetMaterialxv,unsigned int face, unsigned int pname, int *params)
GL_ENTRY(void,glGetPointerv,unsigned int pname, void **params)
GL_ENTRY(void,glGetTexEnvfv,unsigned int env, unsigned int pname, float *params)
GL_ENTRY(void,glGetTexEnviv,unsigned int env, unsigned int pname, int *params)
GL_ENTRY(void,glGetTexEnvxv,unsigned int env, unsigned int pname, int *params)
GL_ENTRY(void,glGetTexParameterfv,unsigned int target, unsigned int pname, float *params)
GL_ENTRY(void,glGetTexParameteriv,unsigned int target, unsigned int pname, int *params)
GL_ENTRY(void,glGetTexParameterxv,unsigned int target, unsigned int pname, int *params)
GL_ENTRY(unsigned char ,glIsBuffer,unsigned int buffer)
GL_ENTRY(unsigned char ,glIsEnabled,unsigned int cap)
GL_ENTRY(unsigned char ,glIsTexture,unsigned int texture)
GL_ENTRY(void,glPointParameterf,unsigned int pname, float param)
GL_ENTRY(void,glPointParameterfv,unsigned int pname, const float *params)
GL_ENTRY(void,glPointParameterx,unsigned int pname, int param)
GL_ENTRY(void,glPointParameterxv,unsigned int pname, const int *params)
GL_ENTRY(void,glPointSizePointerOES,unsigned int type, int stride, const void *pointer)
GL_ENTRY(void,glTexEnvi,unsigned int target, unsigned int pname, int param)
GL_ENTRY(void,glTexEnviv,unsigned int target, unsigned int pname, const int *params)
GL_ENTRY(void,glTexParameterfv,unsigned int target, unsigned int pname, const float *params)
GL_ENTRY(void,glTexParameteri,unsigned int target, unsigned int pname, int param)
GL_ENTRY(void,glTexParameteriv,unsigned int target, unsigned int pname, const int *params)
GL_ENTRY(void,glTexParameterxv,unsigned int target, unsigned int pname, const int *params)
// EGL EXT
GL_ENTRY(int,eglBindTexImage,int dpy, int surface, int buffer)
GL_ENTRY(int,eglReleaseTexImage,int dpy, int surface, int buffer)
GL_ENTRY(int,eglSurfaceAttrib,int dpy, int surface, int attribute, int value)

View File

@@ -0,0 +1,227 @@
/*
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 __GLESINTERFACE_H__
#define __GLESINTERFACE_H__
#if !defined (__WINS__)
#if defined(__TARGET_FPU_VFP)
#pragma softfp_linkage
#endif
#endif
#ifdef SOFTFP_LINK
#define S __attribute__((pcs("aapcs")))
#else
#define S
#endif
struct GlESInterface
{
int (*eglChooseConfig) (int dpy, const int *attrib_list, int *configs, int config_size, int *num_config) S;
int (*eglCopyBuffers) (int dpy, int surface, void* target) S;
int (*eglCreateContext) (int dpy, int config, int share_list, const int *attrib_list) S;
int (*eglCreatePbufferSurface) (int dpy, int config, const int *attrib_list) S;
int (*eglCreatePixmapSurface) (int dpy, int config, void* pixmap, const int *attrib_list) S;
int (*eglCreateWindowSurface) (int dpy, int config, void* window, const int *attrib_list) S;
int (*eglDestroyContext) (int dpy, int ctx) S;
int (*eglDestroySurface) (int dpy, int surface) S;
int (*eglGetConfigAttrib) (int dpy, int config, int attribute, int *value) S;
int (*eglGetConfigs) (int dpy, int *configs, int config_size, int *num_config) S;
int (*eglGetCurrentContext) (void) S;
int (*eglGetCurrentDisplay) (void) S;
int (*eglGetCurrentSurface) (int readdraw) S;
int (*eglGetDisplay) (int display) S;
int (*eglGetError) (void) S;
void (*(*eglGetProcAddress) (const char *procname))(...) S;
int (*eglInitialize) (int dpy, int *major, int *minor) S;
int (*eglMakeCurrent) (int dpy, int draw, int read, int ctx) S;
int (*eglQueryContext) (int dpy, int ctx, int attribute, int *value) S;
const char * (*eglQueryString) (int dpy, int name) S;
int (*eglQuerySurface) (int dpy, int surface, int attribute, int *value) S;
int (*eglSwapBuffers) (int dpy, int draw) S;
int (*eglTerminate) (int dpy) S;
int (*eglWaitGL) (void) S;
int (*eglWaitNative) (int engine) S;
void (*glActiveTexture) (unsigned int texture) S;
void (*glAlphaFunc) (unsigned int func, float ref) S;
void (*glAlphaFuncx) (unsigned int func, int ref) S;
void (*glBindTexture) (unsigned int target, unsigned int texture) S;
void (*glBlendFunc) (unsigned int sfactor, unsigned int dfactor) S;
void (*glClear) (unsigned int mask) S;
void (*glClearColor) (float red, float green, float blue, float alpha) S;
void (*glClearColorx) (int red, int green, int blue, int alpha) S;
void (*glClearDepthf) (float depth) S;
void (*glClearDepthx) (int depth) S;
void (*glClearStencil) (int s) S;
void (*glClientActiveTexture) (unsigned int texture) S;
void (*glColor4f) (float red, float green, float blue, float alpha) S;
void (*glColor4x) (int red, int green, int blue, int alpha) S;
void (*glColorMask) (unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha) S;
void (*glColorPointer) (int size, unsigned int type, int stride, const void *pointer) S;
void (*glCompressedTexImage2D) (unsigned int target, int level, unsigned int internalformat, int width, int height, int border, int imageSize, const void *data) S;
void (*glCompressedTexSubImage2D) (unsigned int target, int level, int xoffset, int yoffset, int width, int height, unsigned int format, int imageSize, const void *data) S;
void (*glCopyTexImage2D) (unsigned int target, int level, unsigned int internalformat, int x, int y, int width, int height, int border) S;
void (*glCopyTexSubImage2D) (unsigned int target, int level, int xoffset, int yoffset, int x, int y, int width, int height) S;
void (*glCullFace) (unsigned int mode) S;
void (*glDeleteTextures) (int n, const unsigned int *textures) S;
void (*glDepthFunc) (unsigned int func) S;
void (*glDepthMask) (unsigned char flag) S;
void (*glDepthRangef) (float zNear, float zFar) S;
void (*glDepthRangex) (int zNear, int zFar) S;
void (*glDisable) (unsigned int cap) S;
void (*glDisableClientState) (unsigned int array) S;
void (*glDrawArrays) (unsigned int mode, int first, int count) S;
void (*glDrawElements) (unsigned int mode, int count, unsigned int type, const void *indices) S;
void (*glEnable) (unsigned int cap) S;
void (*glEnableClientState) (unsigned int array) S;
void (*glFinish) (void) S;
void (*glFlush) (void) S;
void (*glFogf) (unsigned int pname, float param) S;
void (*glFogfv) (unsigned int pname, const float *params) S;
void (*glFogx) (unsigned int pname, int param) S;
void (*glFogxv) (unsigned int pname, const int *params) S;
void (*glFrontFace) (unsigned int mode) S;
void (*glFrustumf) (float left, float right, float bottom, float top, float zNear, float zFar) S;
void (*glFrustumx) (int left, int right, int bottom, int top, int zNear, int zFar) S;
void (*glGenTextures) (int n, unsigned int *textures) S;
unsigned int (*glGetError) (void) S;
void (*glGetIntegerv) (unsigned int pname, int *params) S;
const unsigned char * (*glGetString) (unsigned int name) S;
void (*glHint) (unsigned int target, unsigned int mode) S;
void (*glLightModelf) (unsigned int pname, float param) S;
void (*glLightModelfv) (unsigned int pname, const float *params) S;
void (*glLightModelx) (unsigned int pname, int param) S;
void (*glLightModelxv) (unsigned int pname, const int *params) S;
void (*glLightf) (unsigned int light, unsigned int pname, float param) S;
void (*glLightfv) (unsigned int light, unsigned int pname, const float *params) S;
void (*glLightx) (unsigned int light, unsigned int pname, int param) S;
void (*glLightxv) (unsigned int light, unsigned int pname, const int *params) S;
void (*glLineWidth) (float width) S;
void (*glLineWidthx) (int width) S;
void (*glLoadIdentity) (void) S;
void (*glLoadMatrixf) (const float *m) S;
void (*glLoadMatrixx) (const int *m) S;
void (*glLogicOp) (unsigned int opcode) S;
void (*glMaterialf) (unsigned int face, unsigned int pname, float param) S;
void (*glMaterialfv) (unsigned int face, unsigned int pname, const float *params) S;
void (*glMaterialx) (unsigned int face, unsigned int pname, int param) S;
void (*glMaterialxv) (unsigned int face, unsigned int pname, const int *params) S;
void (*glMatrixMode) (unsigned int mode) S;
void (*glMultMatrixf) (const float *m) S;
void (*glMultMatrixx) (const int *m) S;
void (*glMultiTexCoord4f) (unsigned int target, float s, float t, float r, float q) S;
void (*glMultiTexCoord4x) (unsigned int target, int s, int t, int r, int q) S;
void (*glNormal3f) (float nx, float ny, float nz) S;
void (*glNormal3x) (int nx, int ny, int nz) S;
void (*glNormalPointer) (unsigned int type, int stride, const void *pointer) S;
void (*glOrthof) (float left, float right, float bottom, float top, float zNear, float zFar) S;
void (*glOrthox) (int left, int right, int bottom, int top, int zNear, int zFar) S;
void (*glPixelStorei) (unsigned int pname, int param) S;
void (*glPointSize) (float size) S;
void (*glPointSizex) (int size) S;
void (*glPolygonOffset) (float factor, float units) S;
void (*glPolygonOffsetx) (int factor, int units) S;
void (*glPopMatrix) (void) S;
void (*glPushMatrix) (void) S;
unsigned int (*glQueryMatrixxOES) (int mantissa[16], int exponent[16]) S;
void (*glReadPixels) (int x, int y, int width, int height, unsigned int format, unsigned int type, void *pixels) S;
void (*glRotatef) (float angle, float x, float y, float z) S;
void (*glRotatex) (int angle, int x, int y, int z) S;
void (*glSampleCoverage) (float value, unsigned char invert) S;
void (*glSampleCoveragex) (int value, unsigned char invert) S;
void (*glScalef) (float x, float y, float z) S;
void (*glScalex) (int x, int y, int z) S;
void (*glScissor) (int x, int y, int width, int height) S;
void (*glShadeModel) (unsigned int mode) S;
void (*glStencilFunc) (unsigned int func, int ref, unsigned int mask) S;
void (*glStencilMask) (unsigned int mask) S;
void (*glStencilOp) (unsigned int fail, unsigned int zfail, unsigned int zpass) S;
void (*glTexCoordPointer) (int size, unsigned int type, int stride, const void *pointer) S;
void (*glTexEnvf) (unsigned int target, unsigned int pname, float param) S;
void (*glTexEnvfv) (unsigned int target, unsigned int pname, const float *params) S;
void (*glTexEnvx) (unsigned int target, unsigned int pname, int param) S;
void (*glTexEnvxv) (unsigned int target, unsigned int pname, const int *params) S;
void (*glTexImage2D) (unsigned int target, int level, int internalformat, int width, int height, int border, unsigned int format, unsigned int type, const void *pixels) S;
void (*glTexParameterf) (unsigned int target, unsigned int pname, float param) S;
void (*glTexParameterx) (unsigned int target, unsigned int pname, int param) S;
void (*glTexSubImage2D) (unsigned int target, int level, int xoffset, int yoffset, int width, int height, unsigned int format, unsigned int type, const void *pixels) S;
void (*glTranslatef) (float x, float y, float z) S;
void (*glTranslatex) (int x, int y, int z) S;
void (*glVertexPointer) (int size, unsigned int type, int stride, const void *pointer) S;
void (*glViewport) (int x, int y, int width, int height) S;
int (*eglSwapInterval) (int dpy, int interval) S;
void (*glBindBuffer) (unsigned int target, unsigned int buffer) S;
void (*glBufferData) (unsigned int target, int size, const void *data, unsigned int usage) S;
void (*glBufferSubData) (unsigned int target, int offset,int size, const void *data) S;
void (*glClipPlanef) (unsigned int plane, const float *equation) S;
void (*glClipPlanex) (unsigned int plane, const int *equation) S;
void (*glColor4ub) (unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha) S;
void (*glDeleteBuffers) (int n, const unsigned int *buffers) S;
void (*glGenBuffers) (int n, unsigned int *buffers) S;
void (*glGetBooleanv) (unsigned int pname, unsigned char *params) S;
void (*glGetBufferParameteriv) (unsigned int target, unsigned int pname, int *params) S;
void (*glGetClipPlanef) (unsigned int pname, float eqn[4]) S;
void (*glGetClipPlanex) (unsigned int pname, int eqn[4]) S;
void (*glGetFixedv) (unsigned int pname, int *params) S;
void (*glGetFloatv) (unsigned int pname, float *params) S;
void (*glGetLightfv) (unsigned int light, unsigned int pname, float *params) S;
void (*glGetLightxv) (unsigned int light, unsigned int pname, int *params) S;
void (*glGetMaterialfv) (unsigned int face, unsigned int pname, float *params) S;
void (*glGetMaterialxv) (unsigned int face, unsigned int pname, int *params) S;
void (*glGetPointerv) (unsigned int pname, void **params) S;
void (*glGetTexEnvfv) (unsigned int env, unsigned int pname, float *params) S;
void (*glGetTexEnviv) (unsigned int env, unsigned int pname, int *params) S;
void (*glGetTexEnvxv) (unsigned int env, unsigned int pname, int *params) S;
void (*glGetTexParameterfv) (unsigned int target, unsigned int pname, float *params) S;
void (*glGetTexParameteriv) (unsigned int target, unsigned int pname, int *params) S;
void (*glGetTexParameterxv) (unsigned int target, unsigned int pname, int *params) S;
unsigned char (*glIsBuffer) (unsigned int buffer) S;
unsigned char (*glIsEnabled) (unsigned int cap) S;
unsigned char (*glIsTexture) (unsigned int texture) S;
void (*glPointParameterf) (unsigned int pname, float param) S;
void (*glPointParameterfv) (unsigned int pname, const float *params) S;
void (*glPointParameterx) (unsigned int pname, int param) S;
void (*glPointParameterxv) (unsigned int pname, const int *params) S;
void (*glPointSizePointerOES) (unsigned int type, int stride, const void *pointer) S;
void (*glTexEnvi) (unsigned int target, unsigned int pname, int param) S;
void (*glTexEnviv) (unsigned int target, unsigned int pname, const int *params) S;
void (*glTexParameterfv) (unsigned int target, unsigned int pname, const float *params) S;
void (*glTexParameteri) (unsigned int target, unsigned int pname, int param) S;
void (*glTexParameteriv) (unsigned int target, unsigned int pname, const int *params) S;
void (*glTexParameterxv) (unsigned int target, unsigned int pname, const int *params) S;
int (*eglBindTexImage) (int dpy, int surface, int buffer) S;
int (*eglReleaseTexImage) (int dpy, int surface, int buffer) S;
int (*eglSurfaceAttrib) (int dpy, int surface, int attribute, int value) S;
};
#if !defined (__WINS__)
#if defined(__TARGET_FPU_VFP)
#pragma no_softfp_linkage
#endif
#endif
#endif

View File

@@ -0,0 +1,45 @@
/***************************************************************************
glu_rip.h - description
A few convenience routines ripped from MesaGL
***************************************************************************/
#ifndef _GLU_RIP_H_
#define _GLU_RIP_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <GL/gl.h>
#include <malloc.h>
#include <math.h>
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
void gluLookAt( GLdouble eyex, GLdouble eyey, GLdouble eyez,
GLdouble centerx, GLdouble centery, GLdouble centerz,
GLdouble upx, GLdouble upy, GLdouble upz );
void gluPerspective( GLdouble fovy, GLdouble aspect,
GLdouble zNear, GLdouble zFar );
GLint gluScaleImage( GLenum format,
GLint widthin, GLint heightin,
GLenum typein, const void *datain,
GLint widthout, GLint heightout,
GLenum typeout, void *dataout );
GLint gluBuild2DMipmaps( GLenum target, GLint components,
GLint width, GLint height, GLenum format,
GLenum type, const void *data );
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,38 @@
/*
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);
void nanoGL_Flush();
void *nanoGL_GetProcAddress(const char *);
void nanoGL_Reset();
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,197 @@
/*
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.
*/
#include "egl.h"
#include "glesinterface.h"
#include "gl.h"
#include <string.h>
extern "C++" GlESInterface* glEsImpl;
extern "C++" void FlushOnStateChange();
EGLint eglGetError (void)
{
return glEsImpl->eglGetError();
}
EGLDisplay eglGetDisplay (NativeDisplayType display)
{
return glEsImpl->eglGetDisplay(display);
}
EGLBoolean eglInitialize (EGLDisplay dpy, EGLint *major, EGLint *minor)
{
return glEsImpl->eglInitialize(dpy,major,minor);
}
EGLBoolean eglTerminate (EGLDisplay dpy)
{
return glEsImpl->eglTerminate(dpy);
}
const char * eglQueryString (EGLDisplay dpy, EGLint name)
{
return glEsImpl->eglQueryString(dpy,name);
}
#if defined(__MULTITEXTURE_SUPPORT__)
extern "C" void glMultiTexCoord2fARB( GLenum target, GLfloat s, GLfloat t );
#endif
void * eglGetProcAddress (const char *procname)
{
#if defined(__MULTITEXTURE_SUPPORT__)
if (!strcmp(procname, "glMultiTexCoord2fARB"))
{
return (void*)&glMultiTexCoord2fARB;
}
else if (!strcmp(procname, "glActiveTextureARB"))
{
return (void*)&glActiveTexture;
}
else if (!strcmp(procname, "glClientActiveTextureARB"))
{
return (void*)&glClientActiveTexture;
}
#endif
return (void*)glEsImpl->eglGetProcAddress(procname);
}
EGLBoolean eglGetConfigs (EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config)
{
return glEsImpl->eglGetConfigs(dpy,configs, config_size, num_config);
}
EGLBoolean eglChooseConfig (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config)
{
return glEsImpl->eglChooseConfig(dpy,attrib_list,configs,config_size, num_config);
}
EGLBoolean eglGetConfigAttrib (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value)
{
return glEsImpl->eglGetConfigAttrib(dpy,config,attribute,value);
}
EGLSurface eglCreateWindowSurface (EGLDisplay dpy, EGLConfig config, NativeWindowType window, const EGLint *attrib_list)
{
return glEsImpl->eglCreateWindowSurface(dpy,config,window,attrib_list);
}
EGLSurface eglCreatePixmapSurface (EGLDisplay dpy, EGLConfig config, NativePixmapType pixmap, const EGLint *attrib_list)
{
return glEsImpl->eglCreatePixmapSurface(dpy,config,pixmap,attrib_list);
}
EGLSurface eglCreatePbufferSurface (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list)
{
return glEsImpl->eglCreatePbufferSurface(dpy, config, attrib_list);
}
EGLBoolean eglDestroySurface (EGLDisplay dpy, EGLSurface surface)
{
return glEsImpl->eglDestroySurface(dpy,surface);
}
EGLBoolean eglQuerySurface (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value)
{
return glEsImpl->eglQuerySurface(dpy,surface,attribute,value);
}
/* EGL 1.1 render-to-texture APIs */
EGLBoolean eglSurfaceAttrib (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value)
{
return glEsImpl->eglSurfaceAttrib(dpy,surface,attribute,value);
}
EGLBoolean eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer)
{
return glEsImpl->eglBindTexImage(dpy,surface,buffer);
}
EGLBoolean eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer)
{
return glEsImpl->eglReleaseTexImage(dpy,surface,buffer);
}
/* EGL 1.1 swap control API */
EGLBoolean eglSwapInterval(EGLDisplay dpy, EGLint interval)
{
return glEsImpl->eglSwapInterval(dpy,interval);
}
EGLContext eglCreateContext (EGLDisplay dpy, EGLConfig config, EGLContext share_list, const EGLint *attrib_list)
{
return glEsImpl->eglCreateContext(dpy,config,share_list,attrib_list);
}
EGLBoolean eglDestroyContext (EGLDisplay dpy, EGLContext ctx)
{
return glEsImpl->eglDestroyContext(dpy,ctx);
}
EGLBoolean eglMakeCurrent (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx)
{
FlushOnStateChange();
return glEsImpl->eglMakeCurrent(dpy,draw,read,ctx);
}
EGLContext eglGetCurrentContext (void)
{
return glEsImpl->eglGetCurrentContext();
}
EGLSurface eglGetCurrentSurface (EGLint readdraw)
{
return glEsImpl->eglGetCurrentSurface(readdraw);
}
EGLDisplay eglGetCurrentDisplay (void)
{
return glEsImpl->eglGetCurrentDisplay();
}
EGLBoolean eglQueryContext (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value)
{
return glEsImpl->eglQueryContext(dpy,ctx,attribute,value);
}
EGLBoolean eglWaitGL (void)
{
FlushOnStateChange();
return glEsImpl->eglWaitGL();
}
EGLBoolean eglWaitNative (EGLint engine)
{
FlushOnStateChange();
return glEsImpl->eglWaitNative(engine);
}
EGLBoolean eglSwapBuffers (EGLDisplay dpy, EGLSurface draw)
{
FlushOnStateChange();
return glEsImpl->eglSwapBuffers(dpy,draw);
}
EGLBoolean eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, NativePixmapType target)
{
FlushOnStateChange();
return glEsImpl->eglCopyBuffers(dpy,surface,target);
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,219 @@
/*
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.
*/
#define LOG_TAG "nanoGL"
#include <stdio.h>
#include <stdlib.h>
#include <dlfcn.h>
//#include <cutils/log.h>
#include "nanogl.h"
#include "glesinterface.h"
#include "gl.h"
#define DEBUG_NANO 0
#ifdef __ANDROID__
#include <android/log.h>
#define LOG __android_log_print
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)
#define LOGD(...) if (DEBUG_NANO) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__)
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG,__VA_ARGS__)
#define LOGW(...) __android_log_print(ANDROID_LOG_WARN, LOG_TAG,__VA_ARGS__)
#else
#define LOGI(...) printf("I: "__VA_ARGS__)
#define LOGD(...) if(DEBUG_NANO) printf("D: "__VA_ARGS__)
#define LOGE(...) printf("E: "__VA_ARGS__)
#define LOGW(...) printf("W: "__VA_ARGS__)
#endif
#define GL_ENTRY(_r, _api, ...) #_api,
static char const * const gl_names[] = {
#include "gl_entries.in"
NULL
};
//const char * driver;
static void* glesLib = NULL;
GlESInterface* glEsImpl = NULL;
extern void InitGLStructs();
static void gl_unimplemented() {
LOGE ("Called unimplemented OpenGL ES API\n");
}
void *nanoGL_GetProcAddress(const char *name)
{
#if defined(__MULTITEXTURE_SUPPORT__)
if (!strcmp(procname, "glMultiTexCoord2fARB"))
{
return (void*)&glMultiTexCoord2fARB;
}
else if (!strcmp(procname, "glActiveTextureARB"))
{
return (void*)&glActiveTexture;
}
else if (!strcmp(procname, "glClientActiveTextureARB"))
{
return (void*)&glClientActiveTexture;
}
#endif
return dlsym(glesLib, name);
}
static int CreateGlEsInterface( const char * name, void * lib, void * lib1, void * default_func )
{
// alloc space
if ( !glEsImpl )
glEsImpl = (GlESInterface *) malloc(sizeof(GlESInterface));
if (!glEsImpl) {
return 0;
}
// load GL API calls
char const * const * api;
api = gl_names;
// nanoGL interface pointer
void ** ptr = (void **)(glEsImpl);
while (*api)
{
void * f;
f = dlsym(lib, *api); // try libGLESxx_CM.so
if (f == NULL) {
LOGW( "<%s> not found in %s. Trying libEGL.so.", *api, name); //driver);
// try lib1
if ( lib1 ) {
f = dlsym(lib1, *api); // libEGL.so
if ( f == NULL ) {
LOGE ( "<%s> not found in libEGL.so", *api);
f = default_func; //(void*)gl_unimplemented;
}
else {
LOGD ("<%s> @ 0x%p\n", *api, f);
}
}
else
f = default_func;
}
else {
LOGD ("<%s> @ 0x%p\n", *api, f);
}
*ptr++ = f;
api++;
}
return 1;
}
// Load using the dynamic loader
static int loadDriver(const char * name) {
glesLib = dlopen(name, RTLD_NOW | RTLD_LOCAL);
int rc = (glesLib) ? 1 : 0;
return rc;
}
/**
* Init
*/
int nanoGL_Init()
{
const char * lib1 = "libGLESv1_CM.so"; // Has both gl* & egl* funcs SDK < 1.5
const char * lib2 = "libGLESv2.so"; // Only gl* funcs SDK >= 1.5
const char * lib3 = "libEGL.so"; // Only egl* funcs SDK >= 1.5
const char * driver;
// load lib
LOGI("nanoGL: Init loading driver %s\n", lib1);
//LOG (ANDROID_LOG_DEBUG, LOG_TAG, "nanoGL: Init loading driver %s\n", lib1);
if ( ! loadDriver(lib1) )
{
LOGE("Failed to load driver %s. Trying %s\n", lib1, lib2);
if ( ! loadDriver(lib2) ) {
LOGE ("Failed to load %s.\n", lib2);
return 0;
}
else
driver = lib2;
}
else
driver = lib1;
void * eglLib;
//if ( strcmp(driver, lib2) == 0 ) {
LOGD ("**** Will Load EGL subs from %s ****", lib3);
eglLib = dlopen(lib3, RTLD_NOW | RTLD_LOCAL);
if ( ! eglLib ) {
LOGE ( "Failed to load %s", lib3);
}
//}
// Load API gl* for 1.5+ else egl* gl*
//if (CreateGlEsInterface(driver, glesLib, eglLib, NULL) == -1)
if ( !CreateGlEsInterface(driver, glesLib, eglLib, (void *) gl_unimplemented) == -1)
{
// release lib
LOGE ( "CreateGlEsInterface failed.");
dlclose(glesLib);
return 0;
}
// Init nanoGL
InitGLStructs();
return 1;
}
void nanoGL_Destroy()
{
LOGD ("nanoGL_Destroy");
if (glEsImpl) {
free( glEsImpl);
glEsImpl = NULL;
}
// release lib
dlclose(glesLib);
}