gl4es updated, added latest changes by ptitSeb
This commit is contained in:
14
project/jni/gl4es/Android.mk
Normal file → Executable file
14
project/jni/gl4es/Android.mk
Normal file → Executable file
@@ -10,8 +10,7 @@ include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := gl4es
|
||||
|
||||
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include \
|
||||
$(LOCAL_PATH)/src/util
|
||||
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
|
||||
|
||||
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES) -DBCMHOST
|
||||
|
||||
@@ -23,11 +22,16 @@ LOCAL_SRC_FILES := \
|
||||
src/gl/directstate.c \
|
||||
src/gl/eval.c \
|
||||
src/gl/framebuffers.c \
|
||||
src/gl/getter.c \
|
||||
src/gl/gl.c \
|
||||
src/gl/hint.c \
|
||||
src/gl/init.c \
|
||||
src/gl/light.c \
|
||||
src/gl/line.c \
|
||||
src/gl/list.c \
|
||||
src/gl/loader.c \
|
||||
src/gl/matrix.c \
|
||||
src/gl/matvec.c \
|
||||
src/gl/pixel.c \
|
||||
src/gl/queries.c \
|
||||
src/gl/raster.c \
|
||||
@@ -41,14 +45,14 @@ LOCAL_SRC_FILES := \
|
||||
src/gl/wrap/glesext.c \
|
||||
src/gl/wrap/glstub.c \
|
||||
src/gl/math/eval.c \
|
||||
src/glx/glx.c \
|
||||
src/glx/hardext.c \
|
||||
src/glx/glx.c \
|
||||
src/glx/lookup.c \
|
||||
src/glx/streaming.c
|
||||
src/glx/streaming.c \
|
||||
|
||||
LOCAL_CFLAGS += -g -std=c99 -funwind-tables -O3 -DBCMHOST -fvisibility=hidden -include include/android_debug.h
|
||||
|
||||
#LOCAL_LDLIBS := -ldl -llog -lEGL
|
||||
#LOCAL_LDLIBS := -ldl -llog
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
glshim
|
||||
gl4es
|
||||
====
|
||||
|
||||
This is a shim providing OpenGL 1.x functionality to OpenGL ES accelerated cards.
|
||||
This is a library providing OpenGL 1.x functionality for OpenGL ES accelerated cards.
|
||||
|
||||
This is a fork a glshim (https://github.com/lunixbochs/glshim). Go check this lib if you need things like RemoteGL or if need support for TinyGLES (for 100% software rendering).
|
||||
|
||||
The focusse is on compatibility with a wide selection of game and software, as well as speed.
|
||||
|
||||
Most function of OpenGL up to 1.5 are supported, with some notable exceptions:
|
||||
* Reading of Depth or Stencil buffer will not work
|
||||
@@ -58,7 +62,7 @@ Put lib/libGL.so.1 in your `LD_LIBRARY_PATH`.
|
||||
Usage
|
||||
----
|
||||
|
||||
There are many environnement variable to control glshim behavour. All are numeric, except LIBGL_VERSION that take a string.
|
||||
There are many environnement variable to control gl4es behavour. All are numeric, except LIBGL_VERSION that take a string.
|
||||
|
||||
##### LIBGL_FB
|
||||
Controls the Framebuffer output
|
||||
@@ -204,3 +208,14 @@ Expose glQueries functions
|
||||
Initial Hardware test
|
||||
* 0 : Default, perform intial hardware testing (using a PBuffer)
|
||||
* 1 : Do not perform test (no extensions tested or used)
|
||||
|
||||
----
|
||||
|
||||
Version history
|
||||
----
|
||||
|
||||
##### 0.9.1
|
||||
* Added gl4es specifics glHint capabilities. If the extension GL_GL4ES_hint is present, than a few Hint are accessible. Look in include/gl4eshint.h for the list.
|
||||
|
||||
##### 0.9.0
|
||||
* New name: gl4es
|
||||
|
||||
27
project/jni/gl4es/include/gl4eshint.h
Executable file
27
project/jni/gl4es/include/gl4eshint.h
Executable file
@@ -0,0 +1,27 @@
|
||||
#ifndef _GL4ES_HINT_H_
|
||||
#define _GL4ES_HINT_H_
|
||||
|
||||
// Custom hints to handles some specifics gl4es options
|
||||
|
||||
// same as using LIBGL_SHRINK=x
|
||||
#define GL_SHRINK_HINT_GL4ES 0xA101
|
||||
// same as using LIBGL_ALPHAHACK=x
|
||||
#define GL_ALPHAHACK_HINT_GL4ES 0xA102
|
||||
// same as using LIBGL_RECYCLEFBO=x
|
||||
#define GL_RECYCLEFBO_HINT_GL4ES 0xA103
|
||||
// same as using LIBGL_MIPMAP=x
|
||||
#define GL_MIPMAP_HINT_GL4ES 0xA104
|
||||
// same as using LIBGL_TEXDUMP=x
|
||||
#define GL_TEXDUMP_HINT_GL4ES 0xA105
|
||||
// same as using LIBGL_COPY=x
|
||||
#define GL_COPY_HINT_GL4ES 0xA106
|
||||
// same as using LIBGL_NOLUMALPHA=x
|
||||
#define GL_NOLUMAPHA_HINT_GL4ES 0xA107
|
||||
// same as using LIBGL_BLENDHACK=x
|
||||
#define GL_BLENDHACK_HINT_GL4ES 0xA108
|
||||
// same as using LIBGL_BATCH=x
|
||||
#define GL_BATCH_HINT_GL4ES 0xA109
|
||||
// same as using LIBGL_NOERROR=x
|
||||
#define GL_NOERROR_HINT_GL4ES 0xA10A
|
||||
|
||||
#endif
|
||||
@@ -17,10 +17,3 @@ glext=$(ls -1 yml/*ext-1.1.yml | tr '\n' ',' | sed -e 's/,$//')
|
||||
#./gen.py "$gles2" --ifdef USE_ES2 glxfuncs.j2 gles2funcs.inc ../gl/gl.h > "$base/glx/gles2funcs.inc"
|
||||
|
||||
# ./gen.py "yml/egl.yml" eglwrap.c.j2 eglwrap.c "<GLES/egl.h>" > "$base/gl/wrap/egl.c" &
|
||||
|
||||
cats="VERSION_1_0,VERSION_1_1,VERSION_1_2,VERSION_1_3,VERSION_1_4,VERSION_1_5,glx"
|
||||
proxy='yml/opengl.yml,yml/my_glx.yml,yml/glxext.yml,yml/alsa.yml'
|
||||
./gen.py --deep --cats "$cats" "$proxy" proxy.h.j2 proxy.h "<GL/gl.h>" "<GL/glx.h>" "<stdlib.h>" "<alsa/asoundlib.h>" "../gl/defines.h" "../config.h" "config.h" > "$base/proxy/proxy.h"
|
||||
./gen.py --deep --cats "$cats" "$proxy" client.c.j2 client.c "../proxy.h" > "$base/proxy/client/src/client.c"
|
||||
./gen.py --deep --cats "$cats" "$proxy" host.c.j2 host.c "../proxy.h" > "$base/proxy/host/host.c"
|
||||
#wait
|
||||
|
||||
13
project/jni/gl4es/spec/template/base/copy_packed_call.j2
Executable file
13
project/jni/gl4es/spec/template/base/copy_packed_call.j2
Executable file
@@ -0,0 +1,13 @@
|
||||
packed_call_t* glCopyPackedCall(const packed_call_t *packed) {
|
||||
switch (packed->format) {
|
||||
{% for f in formats %}
|
||||
case FORMAT_{{ f.types }}: {
|
||||
int sizeofpacked = sizeof(PACKED_{{ f.types }});
|
||||
PACKED_{{ f.types }} *newpacked = (PACKED_{{ f.types }}*)malloc(sizeofpacked);
|
||||
memcpy(newpacked, packed, sizeofpacked);
|
||||
return (packed_call_t*)newpacked;
|
||||
break;
|
||||
}
|
||||
{% endfor %}
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@
|
||||
{% if not func.void %}return {% endif %}{% block prefix %}wrap{% endblock %}_{{ func.name }}({{ func.args|args(0) }});
|
||||
{%- endblock %}
|
||||
}
|
||||
{{ func.return }} {{ func.name }}({{ func.args|args }}) __attribute__((alias("glshim_{{ func.name }}"))) __attribute__((visibility("default")));
|
||||
{{ func.return }} {{ func.name }}({{ func.args|args }}) __attribute__((alias("gl4es_{{ func.name }}"))) __attribute__((visibility("default")));
|
||||
{% endblock %}
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -45,6 +45,7 @@ typedef struct {
|
||||
extern void glPushCall(void *data);
|
||||
void glPackedCall(const packed_call_t *packed);
|
||||
void glIndexedCall(const indexed_call_t *packed, void *ret_v);
|
||||
packed_call_t* glCopyPackedCall(const packed_call_t *packed);
|
||||
|
||||
{% for func in functions %}
|
||||
#define {{ func.name }}_INDEX {{ loop.index }}
|
||||
@@ -57,7 +58,7 @@ void glIndexedCall(const indexed_call_t *packed, void *ret_v);
|
||||
{% endfor %}
|
||||
|
||||
{% for func in functions %}
|
||||
{{ func.return }} glshim_{{ func.name }}({{ func.name }}_ARG_EXPAND);
|
||||
{{ func.return }} gl4es_{{ func.name }}({{ func.name }}_ARG_EXPAND);
|
||||
typedef {{ func.return }} (*{{ func.name }}_PTR)({{ func.name }}_ARG_EXPAND);
|
||||
{% endfor %}
|
||||
|
||||
|
||||
2
project/jni/gl4es/spec/template/eglwrap.c.j2
Normal file → Executable file
2
project/jni/gl4es/spec/template/eglwrap.c.j2
Normal file → Executable file
@@ -2,7 +2,7 @@
|
||||
{% block headers %}
|
||||
{{ super() }}
|
||||
void *egl_lib;
|
||||
#define WARN_NULL(name) if (name == NULL) printf("libGL: warning, " #name " is NULL\n");
|
||||
#define WARN_NULL(name) if (name == NULL) printf("LIBGL: warning, " #name " is NULL\n");
|
||||
#define LOAD_EGL(type, name, args...) \
|
||||
typedef type (*eglptr_##name)(args); \
|
||||
static eglptr_##name egl_##name; \
|
||||
|
||||
@@ -6,6 +6,10 @@
|
||||
{% block content %}
|
||||
{% include "base/packed_call.j2" %}
|
||||
|
||||
/*
|
||||
{% include "base/copy_packed_call.j2" %}
|
||||
*/
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block definition %}
|
||||
|
||||
@@ -1,16 +1,100 @@
|
||||
include_directories(util)
|
||||
|
||||
file(GLOB_RECURSE GL_SOURCES gl/*.c)
|
||||
#file(GLOB_RECURSE GL_SOURCES gl/*.c)
|
||||
SET(GL_SRC
|
||||
gl/array.c
|
||||
gl/buffers.c
|
||||
gl/debug.c
|
||||
gl/decompress.c
|
||||
gl/directstate.c
|
||||
gl/eval.c
|
||||
gl/framebuffers.c
|
||||
gl/getter.c
|
||||
gl/gl.c
|
||||
gl/hint.c
|
||||
gl/init.c
|
||||
gl/light.c
|
||||
gl/line.c
|
||||
gl/list.c
|
||||
gl/loader.c
|
||||
gl/matrix.c
|
||||
gl/matvec.c
|
||||
gl/pixel.c
|
||||
gl/queries.c
|
||||
gl/raster.c
|
||||
gl/render.c
|
||||
gl/stack.c
|
||||
gl/texgen.c
|
||||
gl/texture.c
|
||||
gl/wrap/gl.c
|
||||
gl/wrap/gles.c
|
||||
gl/wrap/gles2.c
|
||||
gl/wrap/glesext.c
|
||||
gl/wrap/glstub.c
|
||||
gl/math/eval.c
|
||||
)
|
||||
|
||||
SET(GL_H
|
||||
../version.h
|
||||
gl/array.h
|
||||
gl/buffers.h
|
||||
gl/const.h
|
||||
gl/debug.h
|
||||
gl/decompress.h
|
||||
gl/defines.h
|
||||
gl/directstate.h
|
||||
gl/eval.h
|
||||
gl/framebuffers.h
|
||||
gl/gles.h
|
||||
gl/gl.h
|
||||
gl/hint.h
|
||||
gl/init.h
|
||||
gl/light.h
|
||||
gl/line.h
|
||||
gl/list.h
|
||||
gl/loader.h
|
||||
gl/logs.h
|
||||
gl/matrix.h
|
||||
gl/matvec.h
|
||||
gl/pixel.h
|
||||
gl/queries.h
|
||||
gl/raster.h
|
||||
gl/render.h
|
||||
gl/stack.h
|
||||
gl/state.h
|
||||
gl/stb_dxt_104.h
|
||||
gl/texgen.h
|
||||
gl/texture.h
|
||||
gl/math/eval.h
|
||||
gl/wrap/es.h
|
||||
gl/wrap/gles2.h
|
||||
gl/wrap/gles.h
|
||||
gl/wrap/gl.h
|
||||
gl/wrap/stub.h
|
||||
)
|
||||
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
include_directories(glx)
|
||||
aux_source_directory(glx GLX_SOURCES)
|
||||
list(APPEND GL_SOURCES ${GLX_SOURCES})
|
||||
# aux_source_directory(glx GLX_SOURCES)
|
||||
# list(APPEND GL_SOURCES ${GLX_SOURCES})
|
||||
list(APPEND GL_SRC
|
||||
glx/hardext.c
|
||||
glx/glx.c
|
||||
glx/lookup.c
|
||||
glx/streaming.c
|
||||
glx/utils.c
|
||||
)
|
||||
list(APPEND GL_H
|
||||
glx/glx.h
|
||||
glx/hardext.h
|
||||
glx/streaming.h
|
||||
glx/utils.h
|
||||
)
|
||||
else()
|
||||
message(STATUS "Not on Linux: building without GLX support.")
|
||||
endif()
|
||||
|
||||
add_library(GL SHARED ${GL_SOURCES})
|
||||
add_library(GL SHARED ${GL_SRC})
|
||||
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
target_link_libraries(GL X11 m dl)
|
||||
@@ -19,11 +103,3 @@ endif()
|
||||
if(CMAKE_SHARED_LIBRARY_SUFFIX MATCHES ".so")
|
||||
set_target_properties(GL PROPERTIES SUFFIX ".so.1")
|
||||
endif()
|
||||
|
||||
aux_source_directory(preload PRELOAD_SOURCES)
|
||||
add_library(preload SHARED ${PRELOAD_SOURCES})
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
target_link_libraries(preload X11)
|
||||
endif()
|
||||
|
||||
add_subdirectory(proxy)
|
||||
|
||||
@@ -13,18 +13,11 @@
|
||||
#define skip_glColor4f
|
||||
#define skip_glDisable
|
||||
#define skip_glEnable
|
||||
#define skip_glGetIntegerv
|
||||
#define skip_glGetString
|
||||
#define skip_glIsEnabled
|
||||
#define skip_glMaterialfv
|
||||
#define skip_glMaterialf
|
||||
#define skip_glNormal3f
|
||||
|
||||
#define skip_glGetFloatv
|
||||
|
||||
#define skip_glPushMatrix
|
||||
#define skip_glPopMatrix
|
||||
|
||||
#define skip_glBindBuffer
|
||||
#define skip_glBufferData
|
||||
#define skip_glBufferSubData
|
||||
@@ -36,7 +29,6 @@
|
||||
#define skip_glUnmapBuffer
|
||||
#define skip_glGetBufferParameteriv
|
||||
#define skip_glGetBufferSubData
|
||||
#define skip_glGetPointerv
|
||||
|
||||
#define skip_glBlendColor
|
||||
#define skip_glBlendFunc
|
||||
@@ -49,7 +41,15 @@
|
||||
#define skip_glBlendFuncSeparate
|
||||
#define skip_glBlendFuncSeparatei
|
||||
|
||||
// getter.c
|
||||
#define skip_glGetError
|
||||
#define skip_glGetPointerv
|
||||
#define skip_glGetIntegerv
|
||||
#define skip_glGetFloatv
|
||||
#define skip_glGetString
|
||||
|
||||
// hint.c
|
||||
#define skip_glHint
|
||||
|
||||
// light.c
|
||||
#define skip_glLightModelf
|
||||
@@ -119,9 +119,18 @@
|
||||
#define skip_glFlush
|
||||
#define skip_glFinish
|
||||
|
||||
// matrix don't go to stack well, because values are pointer, not immediate...
|
||||
// matrix.c
|
||||
#define skip_glPushMatrix
|
||||
#define skip_glPopMatrix
|
||||
#define skip_glLoadMatrixf
|
||||
#define skip_glMultMatrixf
|
||||
#define skip_glMatrixMode
|
||||
#define skip_glLoadIdentity
|
||||
#define skip_glTranslatef
|
||||
#define skip_glScalef
|
||||
#define skip_glRotatef
|
||||
#define skip_glOrthof
|
||||
#define skip_glFrustumf
|
||||
|
||||
// MultiDrawArrays
|
||||
#define skip_glMultiDrawArrays
|
||||
|
||||
@@ -54,7 +54,7 @@ int buffer_target(GLenum target) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void glshim_glGenBuffers(GLsizei n, GLuint * buffers) {
|
||||
void gl4es_glGenBuffers(GLsizei n, GLuint * buffers) {
|
||||
//printf("glGenBuffers(%i, %p)\n", n, buffers);
|
||||
noerrorShim();
|
||||
if (n<1) {
|
||||
@@ -66,7 +66,7 @@ void glshim_glGenBuffers(GLsizei n, GLuint * buffers) {
|
||||
}
|
||||
}
|
||||
|
||||
void glshim_glBindBuffer(GLenum target, GLuint buffer) {
|
||||
void gl4es_glBindBuffer(GLenum target, GLuint buffer) {
|
||||
//printf("glBindBuffer(%s, %u)\n", PrintEnum(target), buffer);
|
||||
if (glstate->gl_batch) {
|
||||
flush();
|
||||
@@ -111,7 +111,7 @@ void glshim_glBindBuffer(GLenum target, GLuint buffer) {
|
||||
noerrorShim();
|
||||
}
|
||||
|
||||
void glshim_glBufferData(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage) {
|
||||
void gl4es_glBufferData(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage) {
|
||||
//printf("glBufferData(%s, %i, %p, %s)\n", PrintEnum(target), size, data, PrintEnum(usage));
|
||||
if (!buffer_target(target)) {
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
@@ -135,7 +135,7 @@ void glshim_glBufferData(GLenum target, GLsizeiptr size, const GLvoid * data, GL
|
||||
noerrorShim();
|
||||
}
|
||||
|
||||
void glshim_glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data) {
|
||||
void gl4es_glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data) {
|
||||
//printf("glBufferSubData(%s, %p, %i, %p)\n", PrintEnum(target), offset, size, data);
|
||||
if (!buffer_target(target)) {
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
@@ -151,7 +151,7 @@ void glshim_glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, con
|
||||
noerrorShim();
|
||||
}
|
||||
|
||||
void glshim_glDeleteBuffers(GLsizei n, const GLuint * buffers) {
|
||||
void gl4es_glDeleteBuffers(GLsizei n, const GLuint * buffers) {
|
||||
//printf("glDeleteBuffers(%i, %p)\n", n, buffers);
|
||||
if (glstate->gl_batch) {
|
||||
flush();
|
||||
@@ -185,7 +185,7 @@ void glshim_glDeleteBuffers(GLsizei n, const GLuint * buffers) {
|
||||
noerrorShim();
|
||||
}
|
||||
|
||||
GLboolean glshim_glIsBuffer(GLuint buffer) {
|
||||
GLboolean gl4es_glIsBuffer(GLuint buffer) {
|
||||
//printf("glIsBuffer(%u)\n", buffer);
|
||||
khash_t(buff) *list = glstate->buffers;
|
||||
khint_t k;
|
||||
@@ -201,7 +201,7 @@ GLboolean glshim_glIsBuffer(GLuint buffer) {
|
||||
|
||||
|
||||
|
||||
void glshim_glGetBufferParameteriv(GLenum target, GLenum value, GLint * data) {
|
||||
void gl4es_glGetBufferParameteriv(GLenum target, GLenum value, GLint * data) {
|
||||
//printf("glGetBufferParameteriv(%s, %s, %p)\n", PrintEnum(target), PrintEnum(value), data);
|
||||
if (!buffer_target(target)) {
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
@@ -241,7 +241,7 @@ void glshim_glGetBufferParameteriv(GLenum target, GLenum value, GLint * data) {
|
||||
}
|
||||
}
|
||||
|
||||
void *glshim_glMapBuffer(GLenum target, GLenum access) {
|
||||
void *gl4es_glMapBuffer(GLenum target, GLenum access) {
|
||||
//printf("glMapBuffer(%s, %s)\n", PrintEnum(target), PrintEnum(access));
|
||||
if (!buffer_target(target)) {
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
@@ -256,7 +256,7 @@ void *glshim_glMapBuffer(GLenum target, GLenum access) {
|
||||
return buff->data; // Not nice, should do some copy or something probably
|
||||
}
|
||||
|
||||
GLboolean glshim_glUnmapBuffer(GLenum target) {
|
||||
GLboolean gl4es_glUnmapBuffer(GLenum target) {
|
||||
//printf("glUnmapBuffer(%s)\n", PrintEnum(target));
|
||||
if (!buffer_target(target)) {
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
@@ -273,7 +273,7 @@ GLboolean glshim_glUnmapBuffer(GLenum target) {
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
void glshim_glGetBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid * data) {
|
||||
void gl4es_glGetBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid * data) {
|
||||
//printf("glGetBufferSubData(%s, %p, %i, %p)\n", PrintEnum(target), offset, size, data);
|
||||
if (!buffer_target(target)) {
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
@@ -287,7 +287,7 @@ void glshim_glGetBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size,
|
||||
noerrorShim();
|
||||
}
|
||||
|
||||
void glshim_glGetBufferPointerv(GLenum target, GLenum pname, GLvoid ** params) {
|
||||
void gl4es_glGetBufferPointerv(GLenum target, GLenum pname, GLvoid ** params) {
|
||||
//printf("glGetBufferPointerv(%s, %s, %p)\n", PrintEnum(target), PrintEnum(pname), params);
|
||||
if (!buffer_target(target)) {
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
@@ -308,35 +308,35 @@ void glshim_glGetBufferPointerv(GLenum target, GLenum pname, GLvoid ** params) {
|
||||
}
|
||||
|
||||
//Direct wrapper
|
||||
void glGenBuffers(GLsizei n, GLuint * buffers) AliasExport("glshim_glGenBuffers");
|
||||
void glBindBuffer(GLenum target, GLuint buffer) AliasExport("glshim_glBindBuffer");
|
||||
void glBufferData(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage) AliasExport("glshim_glBufferData");
|
||||
void glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data) AliasExport("glshim_glBufferSubData");
|
||||
void glDeleteBuffers(GLsizei n, const GLuint * buffers) AliasExport("glshim_glDeleteBuffers");
|
||||
GLboolean glIsBuffer(GLuint buffer) AliasExport("glshim_glIsBuffer");
|
||||
void glGetBufferParameteriv(GLenum target, GLenum value, GLint * data) AliasExport("glshim_glGetBufferParameteriv");
|
||||
void *glMapBuffer(GLenum target, GLenum access) AliasExport("glshim_glMapBuffer");
|
||||
GLboolean glUnmapBuffer(GLenum target) AliasExport("glshim_glUnmapBuffer");
|
||||
void glGetBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid * data) AliasExport("glshim_glGetBufferSubData");
|
||||
void glGetBufferPointerv(GLenum target, GLenum pname, GLvoid ** params) AliasExport("glshim_glGetBufferPointerv");
|
||||
void glGenBuffers(GLsizei n, GLuint * buffers) AliasExport("gl4es_glGenBuffers");
|
||||
void glBindBuffer(GLenum target, GLuint buffer) AliasExport("gl4es_glBindBuffer");
|
||||
void glBufferData(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage) AliasExport("gl4es_glBufferData");
|
||||
void glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data) AliasExport("gl4es_glBufferSubData");
|
||||
void glDeleteBuffers(GLsizei n, const GLuint * buffers) AliasExport("gl4es_glDeleteBuffers");
|
||||
GLboolean glIsBuffer(GLuint buffer) AliasExport("gl4es_glIsBuffer");
|
||||
void glGetBufferParameteriv(GLenum target, GLenum value, GLint * data) AliasExport("gl4es_glGetBufferParameteriv");
|
||||
void *glMapBuffer(GLenum target, GLenum access) AliasExport("gl4es_glMapBuffer");
|
||||
GLboolean glUnmapBuffer(GLenum target) AliasExport("gl4es_glUnmapBuffer");
|
||||
void glGetBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid * data) AliasExport("gl4es_glGetBufferSubData");
|
||||
void glGetBufferPointerv(GLenum target, GLenum pname, GLvoid ** params) AliasExport("gl4es_glGetBufferPointerv");
|
||||
|
||||
//ARB wrapper
|
||||
void glGenBuffersARB(GLsizei n, GLuint * buffers) AliasExport("glshim_glGenBuffers");
|
||||
void glBindBufferARB(GLenum target, GLuint buffer) AliasExport("glshim_glBindBuffer");
|
||||
void glBufferDataARB(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage) AliasExport("glshim_glBufferData");
|
||||
void glBufferSubDataARB(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data) AliasExport("glshim_glBufferSubData");
|
||||
void glDeleteBuffersARB(GLsizei n, const GLuint * buffers) AliasExport("glshim_glDeleteBuffers");
|
||||
GLboolean glIsBufferARB(GLuint buffer) AliasExport("glshim_glIsBuffer");
|
||||
void glGetBufferParameterivARB(GLenum target, GLenum value, GLint * data) AliasExport("glshim_glGetBufferParameteriv");
|
||||
void *glMapBufferARB(GLenum target, GLenum access) AliasExport("glshim_glMapBuffer");
|
||||
GLboolean glUnmapBufferARB(GLenum target) AliasExport("glshim_glUnmapBuffer");
|
||||
void glGetBufferSubDataARB(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid * data) AliasExport("glshim_glGetBufferSubData");
|
||||
void glGetBufferPointervARB(GLenum target, GLenum pname, GLvoid ** params) AliasExport("glshim_glGetBufferPointerv");
|
||||
void glGenBuffersARB(GLsizei n, GLuint * buffers) AliasExport("gl4es_glGenBuffers");
|
||||
void glBindBufferARB(GLenum target, GLuint buffer) AliasExport("gl4es_glBindBuffer");
|
||||
void glBufferDataARB(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage) AliasExport("gl4es_glBufferData");
|
||||
void glBufferSubDataARB(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data) AliasExport("gl4es_glBufferSubData");
|
||||
void glDeleteBuffersARB(GLsizei n, const GLuint * buffers) AliasExport("gl4es_glDeleteBuffers");
|
||||
GLboolean glIsBufferARB(GLuint buffer) AliasExport("gl4es_glIsBuffer");
|
||||
void glGetBufferParameterivARB(GLenum target, GLenum value, GLint * data) AliasExport("gl4es_glGetBufferParameteriv");
|
||||
void *glMapBufferARB(GLenum target, GLenum access) AliasExport("gl4es_glMapBuffer");
|
||||
GLboolean glUnmapBufferARB(GLenum target) AliasExport("gl4es_glUnmapBuffer");
|
||||
void glGetBufferSubDataARB(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid * data) AliasExport("gl4es_glGetBufferSubData");
|
||||
void glGetBufferPointervARB(GLenum target, GLenum pname, GLvoid ** params) AliasExport("gl4es_glGetBufferPointerv");
|
||||
|
||||
// VAO ****************
|
||||
static GLuint lastvao = 1;
|
||||
|
||||
void glshim_glGenVertexArrays(GLsizei n, GLuint *arrays) {
|
||||
void gl4es_glGenVertexArrays(GLsizei n, GLuint *arrays) {
|
||||
//printf("glGenVertexArrays(%i, %p)\n", n, arrays);
|
||||
noerrorShim();
|
||||
if (n<1) {
|
||||
@@ -347,7 +347,7 @@ void glshim_glGenVertexArrays(GLsizei n, GLuint *arrays) {
|
||||
arrays[i] = lastvao++;
|
||||
}
|
||||
}
|
||||
void glshim_glBindVertexArray(GLuint array) {
|
||||
void gl4es_glBindVertexArray(GLuint array) {
|
||||
//printf("glBindVertexArray(%u)\n", array);
|
||||
if (glstate->gl_batch) {
|
||||
flush();
|
||||
@@ -391,7 +391,7 @@ void glshim_glBindVertexArray(GLuint array) {
|
||||
}
|
||||
noerrorShim();
|
||||
}
|
||||
void glshim_glDeleteVertexArrays(GLsizei n, const GLuint *arrays) {
|
||||
void gl4es_glDeleteVertexArrays(GLsizei n, const GLuint *arrays) {
|
||||
//printf("glDeleteVertexArrays(%i, %p)\n", n, arrays);
|
||||
if (glstate->gl_batch) {
|
||||
flush();
|
||||
@@ -414,7 +414,7 @@ void glshim_glDeleteVertexArrays(GLsizei n, const GLuint *arrays) {
|
||||
}
|
||||
noerrorShim();
|
||||
}
|
||||
GLboolean glshim_glIsVertexArray(GLuint array) {
|
||||
GLboolean gl4es_glIsVertexArray(GLuint array) {
|
||||
//printf("glIsVertexArray(%u)\n", array);
|
||||
khash_t(glvao) *list = glstate->vaos;
|
||||
khint_t k;
|
||||
@@ -429,8 +429,8 @@ GLboolean glshim_glIsVertexArray(GLuint array) {
|
||||
}
|
||||
|
||||
//Dirzct wrapper
|
||||
void glGenVertexArrays(GLsizei n, GLuint *arrays) AliasExport("glshim_glGenVertexArrays");
|
||||
void glBindVertexArray(GLuint array) AliasExport("glshim_glBindVertexArray");
|
||||
void glDeleteVertexArrays(GLsizei n, const GLuint *arrays) AliasExport("glshim_glDeleteVertexArrays");
|
||||
GLboolean glIsVertexArray(GLuint array) AliasExport("glshim_glIsVertexArray");
|
||||
void glGenVertexArrays(GLsizei n, GLuint *arrays) AliasExport("gl4es_glGenVertexArrays");
|
||||
void glBindVertexArray(GLuint array) AliasExport("gl4es_glBindVertexArray");
|
||||
void glDeleteVertexArrays(GLsizei n, const GLuint *arrays) AliasExport("gl4es_glDeleteVertexArrays");
|
||||
GLboolean glIsVertexArray(GLuint array) AliasExport("gl4es_glIsVertexArray");
|
||||
|
||||
|
||||
@@ -16,18 +16,18 @@ typedef struct {
|
||||
|
||||
KHASH_MAP_INIT_INT(buff, glbuffer_t *)
|
||||
|
||||
void glshim_glGenBuffers(GLsizei n, GLuint * buffers);
|
||||
void glshim_glBindBuffer(GLenum target, GLuint buffer);
|
||||
void glshim_glBufferData(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage);
|
||||
void glshim_glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data);
|
||||
void glshim_glDeleteBuffers(GLsizei n, const GLuint * buffers);
|
||||
GLboolean glshim_glIsBuffer(GLuint buffer);
|
||||
void glshim_glGetBufferParameteriv(GLenum target, GLenum value, GLint * data);
|
||||
void gl4es_glGenBuffers(GLsizei n, GLuint * buffers);
|
||||
void gl4es_glBindBuffer(GLenum target, GLuint buffer);
|
||||
void gl4es_glBufferData(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage);
|
||||
void gl4es_glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data);
|
||||
void gl4es_glDeleteBuffers(GLsizei n, const GLuint * buffers);
|
||||
GLboolean gl4es_glIsBuffer(GLuint buffer);
|
||||
void gl4es_glGetBufferParameteriv(GLenum target, GLenum value, GLint * data);
|
||||
|
||||
void *glshim_glMapBuffer(GLenum target, GLenum access);
|
||||
GLboolean glshim_glUnmapBuffer(GLenum target);
|
||||
void glshim_glGetBufferPointerv(GLenum target, GLenum pname, GLvoid ** params);
|
||||
void glshim_glGetBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid * data);
|
||||
void *gl4es_glMapBuffer(GLenum target, GLenum access);
|
||||
GLboolean gl4es_glUnmapBuffer(GLenum target);
|
||||
void gl4es_glGetBufferPointerv(GLenum target, GLenum pname, GLvoid ** params);
|
||||
void gl4es_glGetBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid * data);
|
||||
|
||||
void glGenBuffers(GLsizei n, GLuint * buffers);
|
||||
void glBindBuffer(GLenum target, GLuint buffer);
|
||||
@@ -85,10 +85,10 @@ typedef struct {
|
||||
|
||||
KHASH_MAP_INIT_INT(glvao, glvao_t*)
|
||||
|
||||
void glshim_glGenVertexArrays(GLsizei n, GLuint *arrays);
|
||||
void glshim_glBindVertexArray(GLuint array);
|
||||
void glshim_glDeleteVertexArrays(GLsizei n, const GLuint *arrays);
|
||||
GLboolean glshim_glIsVertexArray(GLuint array);
|
||||
void gl4es_glGenVertexArrays(GLsizei n, GLuint *arrays);
|
||||
void gl4es_glBindVertexArray(GLuint array);
|
||||
void gl4es_glDeleteVertexArrays(GLsizei n, const GLuint *arrays);
|
||||
GLboolean gl4es_glIsVertexArray(GLuint array);
|
||||
|
||||
void glGenVertexArrays(GLsizei n, GLuint *arrays);
|
||||
void glBindVertexArray(GLuint array);
|
||||
|
||||
@@ -122,6 +122,10 @@ const char* PrintEnum(GLenum what) {
|
||||
p(GL_SPHERE_MAP);
|
||||
p(GL_NORMAL_MAP);
|
||||
p(GL_REFLECTION_MAP);
|
||||
// matrix mode
|
||||
p(GL_PROJECTION);
|
||||
p(GL_MODELVIEW);
|
||||
p(GL_TEXTURE);
|
||||
default:
|
||||
sprintf(fallback, "0x%04X", what);
|
||||
}
|
||||
|
||||
@@ -3,20 +3,20 @@
|
||||
#include "stack.h"
|
||||
|
||||
// Client State
|
||||
void glshim_glClientAttribDefault(GLbitfield mask) {
|
||||
void gl4es_glClientAttribDefault(GLbitfield mask) {
|
||||
if (mask & GL_CLIENT_PIXEL_STORE_BIT) {
|
||||
glshim_glPixelStorei(GL_PACK_ALIGNMENT, 0);
|
||||
glshim_glPixelStorei(GL_UNPACK_ALIGNMENT, 0);
|
||||
glshim_glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
|
||||
glshim_glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
|
||||
glshim_glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
|
||||
glshim_glPixelStorei(GL_PACK_ROW_LENGTH, 0);
|
||||
glshim_glPixelStorei(GL_PACK_SKIP_PIXELS, 0);
|
||||
glshim_glPixelStorei(GL_PACK_SKIP_ROWS, 0);
|
||||
gl4es_glPixelStorei(GL_PACK_ALIGNMENT, 0);
|
||||
gl4es_glPixelStorei(GL_UNPACK_ALIGNMENT, 0);
|
||||
gl4es_glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
|
||||
gl4es_glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
|
||||
gl4es_glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
|
||||
gl4es_glPixelStorei(GL_PACK_ROW_LENGTH, 0);
|
||||
gl4es_glPixelStorei(GL_PACK_SKIP_PIXELS, 0);
|
||||
gl4es_glPixelStorei(GL_PACK_SKIP_ROWS, 0);
|
||||
}
|
||||
#define enable_disable(pname, enabled) \
|
||||
if (enabled) glshim_glEnableClientState(pname); \
|
||||
else glshim_glDisableClientState(pname)
|
||||
if (enabled) gl4es_glEnableClientState(pname); \
|
||||
else gl4es_glDisableClientState(pname)
|
||||
|
||||
if (mask & GL_CLIENT_VERTEX_ARRAY_BIT) {
|
||||
int client = glstate->texture.client;
|
||||
@@ -26,414 +26,414 @@ void glshim_glClientAttribDefault(GLbitfield mask) {
|
||||
enable_disable(GL_COLOR_ARRAY, false);
|
||||
enable_disable(GL_SECONDARY_COLOR_ARRAY, false);
|
||||
for (int a=0; a<MAX_TEX; a++) {
|
||||
glshim_glClientActiveTexture(GL_TEXTURE0+a);
|
||||
gl4es_glClientActiveTexture(GL_TEXTURE0+a);
|
||||
enable_disable(GL_TEXTURE_COORD_ARRAY, false);
|
||||
}
|
||||
#undef enable_disable
|
||||
if (glstate->texture.client != client) glshim_glClientActiveTexture(GL_TEXTURE0+client);
|
||||
if (glstate->texture.client != client) gl4es_glClientActiveTexture(GL_TEXTURE0+client);
|
||||
}
|
||||
}
|
||||
void glshim_glPushClientAttribDefault(GLbitfield mask) {
|
||||
glshim_glPushClientAttrib(mask);
|
||||
glshim_glClientAttribDefault(mask);
|
||||
void gl4es_glPushClientAttribDefault(GLbitfield mask) {
|
||||
gl4es_glPushClientAttrib(mask);
|
||||
gl4es_glClientAttribDefault(mask);
|
||||
}
|
||||
|
||||
// Matrix
|
||||
#define mat(f) \
|
||||
GLenum old_mat; \
|
||||
glshim_glGetIntegerv(GL_MATRIX_MODE, &old_mat); \
|
||||
glshim_glMatrixMode(matrixMode); \
|
||||
glshim_##f; \
|
||||
glshim_glMatrixMode(old_mat)
|
||||
gl4es_glGetIntegerv(GL_MATRIX_MODE, &old_mat); \
|
||||
gl4es_glMatrixMode(matrixMode); \
|
||||
gl4es_##f; \
|
||||
gl4es_glMatrixMode(old_mat)
|
||||
|
||||
void glshim_glMatrixLoadf(GLenum matrixMode, const GLfloat *m) {
|
||||
void gl4es_glMatrixLoadf(GLenum matrixMode, const GLfloat *m) {
|
||||
mat(glLoadMatrixf(m));
|
||||
}
|
||||
void glshim_glMatrixLoadd(GLenum matrixMode, const GLdouble *m) {
|
||||
void gl4es_glMatrixLoadd(GLenum matrixMode, const GLdouble *m) {
|
||||
mat(glLoadMatrixd(m));
|
||||
}
|
||||
void glshim_glMatrixMultf(GLenum matrixMode, const GLfloat *m) {
|
||||
void gl4es_glMatrixMultf(GLenum matrixMode, const GLfloat *m) {
|
||||
mat(glMultMatrixf(m));
|
||||
}
|
||||
void glshim_glMatrixMultd(GLenum matrixMode, const GLdouble *m) {
|
||||
void gl4es_glMatrixMultd(GLenum matrixMode, const GLdouble *m) {
|
||||
mat(glMultMatrixd(m));
|
||||
}
|
||||
void glshim_glMatrixLoadIdentity(GLenum matrixMode) {
|
||||
void gl4es_glMatrixLoadIdentity(GLenum matrixMode) {
|
||||
mat(glLoadIdentity());
|
||||
}
|
||||
void glshim_glMatrixRotatef(GLenum matrixMode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z) {
|
||||
void gl4es_glMatrixRotatef(GLenum matrixMode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z) {
|
||||
mat(glRotatef(angle, x, y, z));
|
||||
}
|
||||
void glshim_glMatrixRotated(GLenum matrixMode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z) {
|
||||
void gl4es_glMatrixRotated(GLenum matrixMode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z) {
|
||||
mat(glRotated(angle, x, y, z));
|
||||
}
|
||||
void glshim_glMatrixScalef(GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z) {
|
||||
void gl4es_glMatrixScalef(GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z) {
|
||||
mat(glScalef(x, y, z));
|
||||
}
|
||||
void glshim_glMatrixScaled(GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z) {
|
||||
void gl4es_glMatrixScaled(GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z) {
|
||||
mat(glScaled(x, y, z));
|
||||
}
|
||||
void glshim_glMatrixTranslatef(GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z) {
|
||||
void gl4es_glMatrixTranslatef(GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z) {
|
||||
mat(glTranslatef(x, y, z));
|
||||
}
|
||||
void glshim_glMatrixTranslated(GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z) {
|
||||
void gl4es_glMatrixTranslated(GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z) {
|
||||
mat(glTranslated(x, y, z));
|
||||
}
|
||||
void glshim_glMatrixOrtho(GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f) {
|
||||
void gl4es_glMatrixOrtho(GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f) {
|
||||
mat(glOrtho(l, r, b ,t, n, f));
|
||||
}
|
||||
void glshim_glMatrixFrustum(GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f) {
|
||||
void gl4es_glMatrixFrustum(GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f) {
|
||||
mat(glFrustum(l, r, b, t, n, f));
|
||||
}
|
||||
void glshim_glMatrixPush(GLenum matrixMode) {
|
||||
void gl4es_glMatrixPush(GLenum matrixMode) {
|
||||
mat(glPushMatrix());
|
||||
}
|
||||
void glshim_glMatrixPop(GLenum matrixMode) {
|
||||
void gl4es_glMatrixPop(GLenum matrixMode) {
|
||||
mat(glPopMatrix());
|
||||
}
|
||||
void glshim_glMatrixLoadTransposef(GLenum matrixMode, const GLfloat *m) {
|
||||
void gl4es_glMatrixLoadTransposef(GLenum matrixMode, const GLfloat *m) {
|
||||
mat(glLoadTransposeMatrixf(m));
|
||||
}
|
||||
void glshim_glMatrixLoadTransposed(GLenum matrixMode, const GLdouble *m) {
|
||||
void gl4es_glMatrixLoadTransposed(GLenum matrixMode, const GLdouble *m) {
|
||||
mat(glLoadTransposeMatrixd(m));
|
||||
}
|
||||
void glshim_glMatrixMultTransposef(GLenum matrixMode, const GLfloat *m) {
|
||||
void gl4es_glMatrixMultTransposef(GLenum matrixMode, const GLfloat *m) {
|
||||
mat(glMultTransposeMatrixf(m));
|
||||
}
|
||||
void glshim_glMatrixMultTransposed(GLenum matrixMode, const GLdouble *m) {
|
||||
void gl4es_glMatrixMultTransposed(GLenum matrixMode, const GLdouble *m) {
|
||||
mat(glMultTransposeMatrixd(m));
|
||||
}
|
||||
#undef mat
|
||||
|
||||
// Textures
|
||||
#define text(f) \
|
||||
glshim_glBindTexture(target, texture); \
|
||||
glshim_##f
|
||||
gl4es_glBindTexture(target, texture); \
|
||||
gl4es_##f
|
||||
|
||||
void glshim_glTextureParameteri(GLuint texture, GLenum target, GLenum pname, GLint param) {
|
||||
void gl4es_glTextureParameteri(GLuint texture, GLenum target, GLenum pname, GLint param) {
|
||||
text(glTexParameteri(target, pname, param));
|
||||
}
|
||||
void glshim_glTextureParameteriv(GLuint texture, GLenum target, GLenum pname, const GLint *param) {
|
||||
void gl4es_glTextureParameteriv(GLuint texture, GLenum target, GLenum pname, const GLint *param) {
|
||||
text(glTexParameteriv(target, pname, param));
|
||||
}
|
||||
void glshim_glTextureParameterf(GLuint texture, GLenum target, GLenum pname, GLfloat param) {
|
||||
void gl4es_glTextureParameterf(GLuint texture, GLenum target, GLenum pname, GLfloat param) {
|
||||
text(glTexParameterf(target, pname, param));
|
||||
}
|
||||
void glshim_glTextureParameterfv(GLuint texture, GLenum target, GLenum pname, const GLfloat *param) {
|
||||
void gl4es_glTextureParameterfv(GLuint texture, GLenum target, GLenum pname, const GLfloat *param) {
|
||||
text(glTexParameterfv(target, pname, param));
|
||||
}
|
||||
void glshim_glTextureImage1D(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
void gl4es_glTextureImage1D(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
text(glTexImage1D(target, level, internalformat, width, border, format, type, pixels));
|
||||
}
|
||||
void glshim_glTextureImage2D(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
void gl4es_glTextureImage2D(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
text(glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels));
|
||||
}
|
||||
void glshim_glTextureSubImage1D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
void gl4es_glTextureSubImage1D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
text(glTexSubImage1D(target, level, xoffset, width, format, type, pixels));
|
||||
}
|
||||
void glshim_glTextureSubImage2D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
void gl4es_glTextureSubImage2D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
text(glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels));
|
||||
}
|
||||
void glshim_glCopyTextureImage1D(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) {
|
||||
void gl4es_glCopyTextureImage1D(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) {
|
||||
text(glCopyTexImage1D(target, level, internalformat, x, y, width, border));
|
||||
}
|
||||
void glshim_glCopyTextureImage2D(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) {
|
||||
void gl4es_glCopyTextureImage2D(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) {
|
||||
text(glCopyTexImage2D(target, level, internalformat, x, y, width, height, border));
|
||||
}
|
||||
void glshim_glCopyTextureSubImage1D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) {
|
||||
void gl4es_glCopyTextureSubImage1D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) {
|
||||
text(glCopyTexSubImage1D(target, level, xoffset, x, y, width));
|
||||
}
|
||||
void glshim_glCopyTextureSubImage2D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
|
||||
void gl4es_glCopyTextureSubImage2D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
|
||||
text(glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height));
|
||||
}
|
||||
void glshim_glGetTextureImage(GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels) {
|
||||
void gl4es_glGetTextureImage(GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels) {
|
||||
text(glGetTexImage(target, level, format, type, pixels));
|
||||
}
|
||||
void glshim_glGetTextureParameterfv(GLuint texture, GLenum target, GLenum pname, GLfloat *params) {
|
||||
void gl4es_glGetTextureParameterfv(GLuint texture, GLenum target, GLenum pname, GLfloat *params) {
|
||||
text(glGetTexParameterfv(target, pname, params));
|
||||
}
|
||||
void glshim_glGetTextureParameteriv(GLuint texture, GLenum target, GLenum pname, GLint *params) {
|
||||
void gl4es_glGetTextureParameteriv(GLuint texture, GLenum target, GLenum pname, GLint *params) {
|
||||
text(glGetTexParameteriv(target, pname, params));
|
||||
}
|
||||
void glshim_glGetTextureLevelParameterfv(GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params) {
|
||||
void gl4es_glGetTextureLevelParameterfv(GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params) {
|
||||
text(glGetTexLevelParameterfv(target, level, pname, params));
|
||||
}
|
||||
void glshim_glGetTextureLevelParameteriv(GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params) {
|
||||
void gl4es_glGetTextureLevelParameteriv(GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params) {
|
||||
text(glGetTexLevelParameteriv(target, level, pname, params));
|
||||
}
|
||||
|
||||
// Texture 3D
|
||||
void glshim_glTextureImage3D(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
void gl4es_glTextureImage3D(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
text(glTexImage3D(target, level, internalformat, width, height, depth, border, format, type, pixels));
|
||||
}
|
||||
void glshim_glTextureSubImage3D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
void gl4es_glTextureSubImage3D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
text(glTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels));
|
||||
}
|
||||
void glshim_glCopyTextureSubImage3D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
|
||||
void gl4es_glCopyTextureSubImage3D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
|
||||
text(glCopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height));
|
||||
}
|
||||
// Compressed texture
|
||||
void glshim_glCompressedTextureImage3D(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data) {
|
||||
void gl4es_glCompressedTextureImage3D(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data) {
|
||||
text(glCompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data));
|
||||
}
|
||||
void glshim_glCompressedTextureImage2D(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data) {
|
||||
void gl4es_glCompressedTextureImage2D(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data) {
|
||||
text(glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data));
|
||||
}
|
||||
void glshim_glCompressedTextureImage1D(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data) {
|
||||
void gl4es_glCompressedTextureImage1D(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data) {
|
||||
text(glCompressedTexImage1D(target, level, internalformat, width, border, imageSize, data));
|
||||
}
|
||||
void glshim_glCompressedTextureSubImage3D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data) {
|
||||
void gl4es_glCompressedTextureSubImage3D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data) {
|
||||
text(glCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data));
|
||||
}
|
||||
void glshim_glCompressedTextureSubImage2D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data) {
|
||||
void gl4es_glCompressedTextureSubImage2D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data) {
|
||||
text(glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data));
|
||||
}
|
||||
void glshim_glCompressedTextureSubImage1D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data) {
|
||||
void gl4es_glCompressedTextureSubImage1D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data) {
|
||||
text(glCompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, data));
|
||||
}
|
||||
void glshim_glGetCompressedTextureImage(GLuint texture, GLenum target, GLint level, GLvoid *img) {
|
||||
void gl4es_glGetCompressedTextureImage(GLuint texture, GLenum target, GLint level, GLvoid *img) {
|
||||
text(glGetCompressedTexImage(target, level, img));
|
||||
}
|
||||
|
||||
#undef text
|
||||
#define text(f) \
|
||||
GLenum old_tex = glstate->texture.active; \
|
||||
if(texunit != old_tex) glshim_glActiveTexture(texunit); \
|
||||
glshim_##f; \
|
||||
if(texunit != old_tex) glshim_glActiveTexture(old_tex)
|
||||
if(texunit != old_tex) gl4es_glActiveTexture(texunit); \
|
||||
gl4es_##f; \
|
||||
if(texunit != old_tex) gl4es_glActiveTexture(old_tex)
|
||||
#define texc(f) \
|
||||
GLenum old_tex = glstate->texture.client; \
|
||||
if(texunit != old_tex) glshim_glClientActiveTexture(texunit); \
|
||||
glshim_##f; \
|
||||
if(texunit != old_tex) glshim_glClientActiveTexture(old_tex)
|
||||
if(texunit != old_tex) gl4es_glClientActiveTexture(texunit); \
|
||||
gl4es_##f; \
|
||||
if(texunit != old_tex) gl4es_glClientActiveTexture(old_tex)
|
||||
|
||||
void glshim_glBindMultiTexture(GLenum texunit, GLenum target, GLuint texture) {
|
||||
void gl4es_glBindMultiTexture(GLenum texunit, GLenum target, GLuint texture) {
|
||||
text(glBindTexture(target, texture));
|
||||
}
|
||||
void glshim_glMultiTexCoordPointer(GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) {
|
||||
void gl4es_glMultiTexCoordPointer(GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) {
|
||||
texc(glTexCoordPointer(size, type, stride, pointer));
|
||||
}
|
||||
void glshim_glMultiTexEnvf(GLenum texunit, GLenum target, GLenum pname, GLfloat param) {
|
||||
void gl4es_glMultiTexEnvf(GLenum texunit, GLenum target, GLenum pname, GLfloat param) {
|
||||
text(glTexEnvf(target, pname, param));
|
||||
}
|
||||
void glshim_glMultiTexEnvfv(GLenum texunit, GLenum target, GLenum pname, const GLfloat *params) {
|
||||
void gl4es_glMultiTexEnvfv(GLenum texunit, GLenum target, GLenum pname, const GLfloat *params) {
|
||||
text(glTexEnvfv(target, pname, params));
|
||||
}
|
||||
void glshim_glMultiTexEnvi(GLenum texunit, GLenum target, GLenum pname, GLint param) {
|
||||
void gl4es_glMultiTexEnvi(GLenum texunit, GLenum target, GLenum pname, GLint param) {
|
||||
text(glTexEnvi(target, pname, param));
|
||||
}
|
||||
void glshim_glMultiTexEnviv(GLenum texunit, GLenum target, GLenum pname, const GLint *params) {
|
||||
void gl4es_glMultiTexEnviv(GLenum texunit, GLenum target, GLenum pname, const GLint *params) {
|
||||
text(glTexEnviv(target, pname, params));
|
||||
}
|
||||
void glshim_glMultiTexGend(GLenum texunit, GLenum coord, GLenum pname, GLdouble param) {
|
||||
void gl4es_glMultiTexGend(GLenum texunit, GLenum coord, GLenum pname, GLdouble param) {
|
||||
text(glTexGend(coord, pname, param));
|
||||
}
|
||||
void glshim_glMultiTexGendv(GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params) {
|
||||
void gl4es_glMultiTexGendv(GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params) {
|
||||
text(glTexGendv(coord, pname, params));
|
||||
}
|
||||
void glshim_glMultiTexGenf(GLenum texunit, GLenum coord, GLenum pname, GLfloat param) {
|
||||
void gl4es_glMultiTexGenf(GLenum texunit, GLenum coord, GLenum pname, GLfloat param) {
|
||||
text(glTexGenf(coord, pname, param));
|
||||
}
|
||||
void glshim_glMultiTexGenfv(GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params) {
|
||||
void gl4es_glMultiTexGenfv(GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params) {
|
||||
text(glTexGenfv(coord, pname, params));
|
||||
}
|
||||
void glshim_glMultiTexGeni(GLenum texunit, GLenum coord, GLenum pname, GLint param) {
|
||||
void gl4es_glMultiTexGeni(GLenum texunit, GLenum coord, GLenum pname, GLint param) {
|
||||
text(glTexGeni(coord, pname, param));
|
||||
}
|
||||
void glshim_glMultiTexGeniv(GLenum texunit, GLenum coord, GLenum pname, const GLint *params) {
|
||||
void gl4es_glMultiTexGeniv(GLenum texunit, GLenum coord, GLenum pname, const GLint *params) {
|
||||
text(glTexGeniv(coord, pname, params));
|
||||
}
|
||||
void glshim_glGetMultiTexEnvfv(GLenum texunit, GLenum target, GLenum pname, GLfloat *params) {
|
||||
void gl4es_glGetMultiTexEnvfv(GLenum texunit, GLenum target, GLenum pname, GLfloat *params) {
|
||||
text(glGetTexEnvfv(target, pname, params));
|
||||
}
|
||||
void glshim_glGetMultiTexEnviv(GLenum texunit, GLenum target, GLenum pname, GLint *params) {
|
||||
void gl4es_glGetMultiTexEnviv(GLenum texunit, GLenum target, GLenum pname, GLint *params) {
|
||||
text(glGetTexEnviv(target, pname, params));
|
||||
}
|
||||
void glshim_glGetMultiTexGendv(GLenum texunit, GLenum coord, GLenum pname, GLdouble *params) {
|
||||
void gl4es_glGetMultiTexGendv(GLenum texunit, GLenum coord, GLenum pname, GLdouble *params) {
|
||||
text(glGetTexGendv(coord, pname, params));
|
||||
}
|
||||
void glshim_glGetMultiTexGenfv(GLenum texunit, GLenum coord, GLenum pname, GLfloat *params) {
|
||||
void gl4es_glGetMultiTexGenfv(GLenum texunit, GLenum coord, GLenum pname, GLfloat *params) {
|
||||
text(glGetTexGenfv(coord, pname, params));
|
||||
}
|
||||
void glshim_glGetMultiTexGeniv(GLenum texunit, GLenum coord, GLenum pname, GLint *params) {
|
||||
void gl4es_glGetMultiTexGeniv(GLenum texunit, GLenum coord, GLenum pname, GLint *params) {
|
||||
text(glGetTexGeniv(coord, pname, params));
|
||||
}
|
||||
void glshim_glMultiTexParameteri(GLenum texunit, GLenum target, GLenum pname, GLint param) {
|
||||
void gl4es_glMultiTexParameteri(GLenum texunit, GLenum target, GLenum pname, GLint param) {
|
||||
text(glTexParameteri(target, pname, param));
|
||||
}
|
||||
void glshim_glMultiTexParameteriv(GLenum texunit, GLenum target, GLenum pname, const GLint *param) {
|
||||
void gl4es_glMultiTexParameteriv(GLenum texunit, GLenum target, GLenum pname, const GLint *param) {
|
||||
text(glTexParameteriv(target, pname, param));
|
||||
}
|
||||
void glshim_glMultiTexParameterf(GLenum texunit, GLenum target, GLenum pname, GLfloat param) {
|
||||
void gl4es_glMultiTexParameterf(GLenum texunit, GLenum target, GLenum pname, GLfloat param) {
|
||||
text(glTexParameterf(target, pname, param));
|
||||
}
|
||||
void glshim_glMultiTexParameterfv(GLenum texunit, GLenum target, GLenum pname, const GLfloat *param) {
|
||||
void gl4es_glMultiTexParameterfv(GLenum texunit, GLenum target, GLenum pname, const GLfloat *param) {
|
||||
text(glTexParameterfv(target, pname, param));
|
||||
}
|
||||
void glshim_glMultiTexImage1D(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
void gl4es_glMultiTexImage1D(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
text(glTexImage1D(target, level, internalformat, width, border, format, type, pixels));
|
||||
}
|
||||
void glshim_glMultiTexImage2D(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
void gl4es_glMultiTexImage2D(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
text(glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels));
|
||||
}
|
||||
void glshim_glMultiTexSubImage1D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
void gl4es_glMultiTexSubImage1D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
text(glTexSubImage1D(target, level, xoffset, width, format, type, pixels));
|
||||
}
|
||||
void glshim_glMultiTexSubImage2D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
void gl4es_glMultiTexSubImage2D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
text(glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels));
|
||||
}
|
||||
void glshim_glCopyMultiTexImage1D(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) {
|
||||
void gl4es_glCopyMultiTexImage1D(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) {
|
||||
text(glCopyTexImage1D(target, level, internalformat, x, y, width, border));
|
||||
}
|
||||
void glshim_glCopyMultiTexImage2D(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) {
|
||||
void gl4es_glCopyMultiTexImage2D(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) {
|
||||
text(glCopyTexImage2D(target, level, internalformat, x, y, width, height, border));
|
||||
}
|
||||
void glshim_glCopyMultiTexSubImage1D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) {
|
||||
void gl4es_glCopyMultiTexSubImage1D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) {
|
||||
text(glCopyTexSubImage1D(target, level, xoffset, x, y, width));
|
||||
}
|
||||
void glshim_glCopyMultiTexSubImage2D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
|
||||
void gl4es_glCopyMultiTexSubImage2D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
|
||||
text(glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height));
|
||||
}
|
||||
void glshim_glGetMultiTexImage(GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels) {
|
||||
void gl4es_glGetMultiTexImage(GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels) {
|
||||
text(glGetTexImage(target, level, format, type, pixels));
|
||||
}
|
||||
void glshim_glGetMultiTexParameterfv(GLenum texunit, GLenum target, GLenum pname, GLfloat *params) {
|
||||
void gl4es_glGetMultiTexParameterfv(GLenum texunit, GLenum target, GLenum pname, GLfloat *params) {
|
||||
text(glGetTexParameterfv(target, pname, params));
|
||||
}
|
||||
void glshim_glGetMultiTexParameteriv(GLenum texunit, GLenum target, GLenum pname, GLint *params) {
|
||||
void gl4es_glGetMultiTexParameteriv(GLenum texunit, GLenum target, GLenum pname, GLint *params) {
|
||||
text(glGetTexParameteriv(target, pname, params));
|
||||
}
|
||||
void glshim_glGetMultiTexLevelParameterfv(GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params) {
|
||||
void gl4es_glGetMultiTexLevelParameterfv(GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params) {
|
||||
text(glGetTexLevelParameterfv(target, level, pname, params));
|
||||
}
|
||||
void glshim_glGetMultiTexLevelParameteriv(GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params) {
|
||||
void gl4es_glGetMultiTexLevelParameteriv(GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params) {
|
||||
text(glGetTexLevelParameteriv(target, level, pname, params));
|
||||
}
|
||||
void glshim_glMultiTexImage3D(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
void gl4es_glMultiTexImage3D(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
text(glTexImage3D(target, level, internalformat, width, height, depth, border, format, type, pixels));
|
||||
}
|
||||
void glshim_glMultiTexSubImage3D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
void gl4es_glMultiTexSubImage3D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
text(glTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels));
|
||||
}
|
||||
void glshim_glCopyMultiTexSubImage3D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
|
||||
void gl4es_glCopyMultiTexSubImage3D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
|
||||
text(glCopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height));
|
||||
}
|
||||
// Compressed texture
|
||||
void glshim_glCompressedMultiTexImage3D(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data) {
|
||||
void gl4es_glCompressedMultiTexImage3D(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data) {
|
||||
text(glCompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data));
|
||||
}
|
||||
void glshim_glCompressedMultiTexImage2D(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data) {
|
||||
void gl4es_glCompressedMultiTexImage2D(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data) {
|
||||
text(glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data));
|
||||
}
|
||||
void glshim_glCompressedMultiTexImage1D(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data) {
|
||||
void gl4es_glCompressedMultiTexImage1D(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data) {
|
||||
text(glCompressedTexImage1D(target, level, internalformat, width, border, imageSize, data));
|
||||
}
|
||||
void glshim_glCompressedMultiTexSubImage3D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data) {
|
||||
void gl4es_glCompressedMultiTexSubImage3D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data) {
|
||||
text(glCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data));
|
||||
}
|
||||
void glshim_glCompressedMultiTexSubImage2D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data) {
|
||||
void gl4es_glCompressedMultiTexSubImage2D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data) {
|
||||
text(glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data));
|
||||
}
|
||||
void glshim_glCompressedMultiTexSubImage1D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data) {
|
||||
void gl4es_glCompressedMultiTexSubImage1D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data) {
|
||||
text(glCompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, data));
|
||||
}
|
||||
void glshim_glGetCompressedMultiTexImage(GLenum texunit, GLenum target, GLint level, GLvoid *img) {
|
||||
void gl4es_glGetCompressedMultiTexImage(GLenum texunit, GLenum target, GLint level, GLvoid *img) {
|
||||
text(glGetCompressedTexImage(target, level, img));
|
||||
}
|
||||
|
||||
//EXT wrapper
|
||||
void glClientAttribDefaultEXT(GLbitfield mask) AliasExport("glshim_glClientAttribDefault");
|
||||
void glPushClientAttribDefaultEXT(GLbitfield mask) AliasExport("glshim_glPushClientAttribDefault");
|
||||
void glMatrixLoadfEXT(GLenum matrixMode, const GLfloat *m) AliasExport("glshim_glMatrixLoadf");
|
||||
void glMatrixLoaddEXT(GLenum matrixMode, const GLdouble *m) AliasExport("glshim_glMatrixLoadd");
|
||||
void glMatrixMultfEXT(GLenum matrixMode, const GLfloat *m) AliasExport("glshim_glMatrixMultf");
|
||||
void glMatrixMultdEXT(GLenum matrixMode, const GLdouble *m) AliasExport("glshim_glMatrixMultd");
|
||||
void glMatrixLoadIdentityEXT(GLenum matrixMode) AliasExport("glshim_glMatrixLoadIdentity");
|
||||
void glMatrixRotatefEXT(GLenum matrixMode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z) AliasExport("glshim_glMatrixRotatef");
|
||||
void glMatrixRotatedEXT(GLenum matrixMode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z) AliasExport("glshim_glMatrixRotated");
|
||||
void glMatrixScalefEXT(GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z) AliasExport("glshim_glMatrixScalef");
|
||||
void glMatrixScaledEXT(GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z) AliasExport("glshim_glMatrixScaled");
|
||||
void glMatrixTranslatefEXT(GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z) AliasExport("glshim_glMatrixTranslatef");
|
||||
void glMatrixTranslatedEXT(GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z) AliasExport("glshim_glMatrixTranslated");
|
||||
void glMatrixOrthoEXT(GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f) AliasExport("glshim_glMatrixOrtho");
|
||||
void glMatrixFrustumEXT(GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f) AliasExport("glshim_glMatrixFrustum");
|
||||
void glMatrixPushEXT(GLenum matrixMode) AliasExport("glshim_glMatrixPush");
|
||||
void glMatrixPopEXT(GLenum matrixMode) AliasExport("glshim_glMatrixPop");
|
||||
void glTextureParameteriEXT(GLuint texture, GLenum target, GLenum pname, GLint param) AliasExport("glshim_glTextureParameteri");
|
||||
void glTextureParameterivEXT(GLuint texture, GLenum target, GLenum pname, const GLint *param) AliasExport("glshim_glTextureParameteriv");
|
||||
void glTextureParameterfEXT(GLuint texture, GLenum target, GLenum pname, GLfloat param) AliasExport("glshim_glTextureParameterf");
|
||||
void glTextureParameterfvEXT(GLuint texture, GLenum target, GLenum pname, const GLfloat *param) AliasExport("glshim_glTextureParameterfv");
|
||||
void glTextureImage1DEXT(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels) AliasExport("glshim_glTextureImage1D");
|
||||
void glTextureImage2DEXT(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels) AliasExport("glshim_glTextureImage2D");
|
||||
void glTextureSubImage1DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels) AliasExport("glshim_glTextureSubImage1D");
|
||||
void glTextureSubImage2DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels) AliasExport("glshim_glTextureSubImage2D");
|
||||
void glCopyTextureImage1DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) AliasExport("glshim_glCopyTextureImage1D");
|
||||
void glCopyTextureImage2DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) AliasExport("glshim_glCopyTextureImage2D");
|
||||
void glCopyTextureSubImage1DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) AliasExport("glshim_glCopyTextureSubImage1D");
|
||||
void glCopyTextureSubImage2DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) AliasExport("glshim_glCopyTextureSubImage2D");
|
||||
void glGetTextureImageEXT(GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels) AliasExport("glshim_glGetTextureImage");
|
||||
void glGetTextureParameterfvEXT(GLuint texture, GLenum target, GLenum pname, GLfloat *params) AliasExport("glshim_glGetTextureParameterfv");
|
||||
void glGetTextureParameterivEXT(GLuint texture, GLenum target, GLenum pname, GLint *params) AliasExport("glshim_glGetTextureParameteriv");
|
||||
void glGetTextureLevelParameterfvEXT(GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params) AliasExport("glshim_glGetTextureLevelParameterfv");
|
||||
void glGetTextureLevelParameterivEXT(GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params) AliasExport("glshim_glGetTextureLevelParameteriv");
|
||||
void glTextureImage3DEXT(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels) AliasExport("glshim_glTextureImage3D");
|
||||
void glTextureSubImage3DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels) AliasExport("glshim_glTextureSubImage3D");
|
||||
void glCopyTextureSubImage3DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) AliasExport("glshim_glCopyTextureSubImage3D");
|
||||
void glBindMultiTextureEXT(GLenum texunit, GLenum target, GLuint texture) AliasExport("glshim_glBindMultiTexture");
|
||||
void glMultiTexCoordPointerEXT(GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) AliasExport("glshim_glMultiTexCoordPointer");
|
||||
void glMultiTexEnvfEXT(GLenum texunit, GLenum target, GLenum pname, GLfloat param) AliasExport("glshim_glMultiTexEnvf");
|
||||
void glMultiTexEnvfvEXT(GLenum texunit, GLenum target, GLenum pname, const GLfloat *params) AliasExport("glshim_glMultiTexEnvfv");
|
||||
void glMultiTexEnviEXT(GLenum texunit, GLenum target, GLenum pname, GLint param) AliasExport("glshim_glMultiTexEnvi");
|
||||
void glMultiTexEnvivEXT(GLenum texunit, GLenum target, GLenum pname, const GLint *params) AliasExport("glshim_glMultiTexEnviv");
|
||||
void glMultiTexGendEXT(GLenum texunit, GLenum coord, GLenum pname, GLdouble param) AliasExport("glshim_glMultiTexGend");
|
||||
void glMultiTexGendvEXT(GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params) AliasExport("glshim_glMultiTexGendv");
|
||||
void glMultiTexGenfEXT(GLenum texunit, GLenum coord, GLenum pname, GLfloat param) AliasExport("glshim_glMultiTexGenf");
|
||||
void glMultiTexGenfvEXT(GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params) AliasExport("glshim_glMultiTexGenfv");
|
||||
void glMultiTexGeniEXT(GLenum texunit, GLenum coord, GLenum pname, GLint param) AliasExport("glshim_glMultiTexGeni");
|
||||
void glMultiTexGenivEXT(GLenum texunit, GLenum coord, GLenum pname, const GLint *params) AliasExport("glshim_glMultiTexGeniv");
|
||||
void glGetMultiTexEnvfvEXT(GLenum texunit, GLenum target, GLenum pname, GLfloat *params) AliasExport("glshim_glGetMultiTexEnvfv");
|
||||
void glGetMultiTexEnvivEXT(GLenum texunit, GLenum target, GLenum pname, GLint *params) AliasExport("glshim_glGetMultiTexEnviv");
|
||||
void glGetMultiTexGendvEXT(GLenum texunit, GLenum coord, GLenum pname, GLdouble *params) AliasExport("glshim_glGetMultiTexGendv");
|
||||
void glGetMultiTexGenfvEXT(GLenum texunit, GLenum coord, GLenum pname, GLfloat *params) AliasExport("glshim_glGetMultiTexGenfv");
|
||||
void glGetMultiTexGenivEXT(GLenum texunit, GLenum coord, GLenum pname, GLint *params) AliasExport("glshim_glGetMultiTexGeniv");
|
||||
void glMultiTexParameteriEXT(GLenum texunit, GLenum target, GLenum pname, GLint param) AliasExport("glshim_glMultiTexParameteri");
|
||||
void glMultiTexParameterivEXT(GLenum texunit, GLenum target, GLenum pname, const GLint *param) AliasExport("glshim_glMultiTexParameteriv");
|
||||
void glMultiTexParameterfEXT(GLenum texunit, GLenum target, GLenum pname, GLfloat param) AliasExport("glshim_glMultiTexParameterf");
|
||||
void glMultiTexParameterfvEXT(GLenum texunit, GLenum target, GLenum pname, const GLfloat *param) AliasExport("glshim_glMultiTexParameterfv");
|
||||
void glMultiTexImage1DEXT(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels) AliasExport("glshim_glMultiTexImage1D");
|
||||
void glMultiTexImage2DEXT(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels) AliasExport("glshim_glMultiTexImage2D");
|
||||
void glMultiTexSubImage1DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels) AliasExport("glshim_glMultiTexSubImage1D");
|
||||
void glMultiTexSubImage2DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels) AliasExport("glshim_glMultiTexSubImage2D");
|
||||
void glCopyMultiTexImage1DEXT(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) AliasExport("glshim_glCopyMultiTexImage1D");
|
||||
void glCopyMultiTexImage2DEXT(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) AliasExport("glshim_glCopyMultiTexImage2D");
|
||||
void glCopyMultiTexSubImage1DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) AliasExport("glshim_glCopyMultiTexSubImage1D");
|
||||
void glCopyMultiTexSubImage2DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) AliasExport("glshim_glCopyMultiTexSubImage2D");
|
||||
void glGetMultiTexImageEXT(GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels) AliasExport("glshim_glGetMultiTexImage");
|
||||
void glGetMultiTexParameterfvEXT(GLenum texunit, GLenum target, GLenum pname, GLfloat *params) AliasExport("glshim_glGetMultiTexParameterfv");
|
||||
void glGetMultiTexParameterivEXT(GLenum texunit, GLenum target, GLenum pname, GLint *params) AliasExport("glshim_glGetMultiTexParameteriv");
|
||||
void glGetMultiTexLevelParameterfvEXT(GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params) AliasExport("glshim_glGetMultiTexLevelParameterfv");
|
||||
void glGetMultiTexLevelParameterivEXT(GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params) AliasExport("glshim_glGetMultiTexLevelParameteriv");
|
||||
void glMultiTexImage3DEXT(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels) AliasExport("glshim_glMultiTexImage3D");
|
||||
void glMultiTexSubImage3DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels) AliasExport("glshim_glMultiTexSubImage3D");
|
||||
void glCopyMultiTexSubImage3DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) AliasExport("glshim_glCopyMultiTexSubImage3D");
|
||||
void glCompressedTextureImage3DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data) AliasExport("glshim_glCompressedTextureImage3D");
|
||||
void glCompressedTextureImage2DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data) AliasExport("glshim_glCompressedTextureImage2D");
|
||||
void glCompressedTextureImage1DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data) AliasExport("glshim_glCompressedTextureImage1D");
|
||||
void glCompressedTextureSubImage3DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data) AliasExport("glshim_glCompressedTextureSubImage3D");
|
||||
void glCompressedTextureSubImage2DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data) AliasExport("glshim_glCompressedTextureSubImage2D");
|
||||
void glCompressedTextureSubImage1DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data) AliasExport("glshim_glCompressedTextureSubImage1D");
|
||||
void glGetCompressedTextureImageEXT(GLuint texture, GLenum target, GLint level, GLvoid *img) AliasExport("glshim_glGetCompressedTextureImage");
|
||||
void glCompressedMultiTexImage3DEXT(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data) AliasExport("glshim_glCompressedMultiTexImage3D");
|
||||
void glCompressedMultiTexImage2DEXT(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data) AliasExport("glshim_glCompressedMultiTexImage2D");
|
||||
void glCompressedMultiTexImage1DEXT(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data) AliasExport("glshim_glCompressedMultiTexImage1D");
|
||||
void glCompressedMultiTexSubImage3DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data) AliasExport("glshim_glCompressedMultiTexSubImage3D");
|
||||
void glCompressedMultiTexSubImage2DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data) AliasExport("glshim_glCompressedMultiTexSubImage2D");
|
||||
void glCompressedMultiTexSubImage1DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data) AliasExport("glshim_glCompressedMultiTexSubImage1D");
|
||||
void glGetCompressedMultiTexImageEXT(GLenum texunit, GLenum target, GLint level, GLvoid *img) AliasExport("glshim_glGetCompressedMultiTexImage");
|
||||
void glMatrixLoadTransposefEXT(GLenum matrixMode, const GLfloat *m) AliasExport("glshim_glMatrixLoadTransposef");
|
||||
void glMatrixLoadTransposedEXT(GLenum matrixMode, const GLdouble *m) AliasExport("glshim_glMatrixLoadTransposed");
|
||||
void glMatrixMultTransposefEXT(GLenum matrixMode, const GLfloat *m) AliasExport("glshim_glMatrixMultTransposef");
|
||||
void glMatrixMultTransposedEXT(GLenum matrixMode, const GLdouble *m) AliasExport("glshim_glMatrixMultTransposed");
|
||||
void glClientAttribDefaultEXT(GLbitfield mask) AliasExport("gl4es_glClientAttribDefault");
|
||||
void glPushClientAttribDefaultEXT(GLbitfield mask) AliasExport("gl4es_glPushClientAttribDefault");
|
||||
void glMatrixLoadfEXT(GLenum matrixMode, const GLfloat *m) AliasExport("gl4es_glMatrixLoadf");
|
||||
void glMatrixLoaddEXT(GLenum matrixMode, const GLdouble *m) AliasExport("gl4es_glMatrixLoadd");
|
||||
void glMatrixMultfEXT(GLenum matrixMode, const GLfloat *m) AliasExport("gl4es_glMatrixMultf");
|
||||
void glMatrixMultdEXT(GLenum matrixMode, const GLdouble *m) AliasExport("gl4es_glMatrixMultd");
|
||||
void glMatrixLoadIdentityEXT(GLenum matrixMode) AliasExport("gl4es_glMatrixLoadIdentity");
|
||||
void glMatrixRotatefEXT(GLenum matrixMode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z) AliasExport("gl4es_glMatrixRotatef");
|
||||
void glMatrixRotatedEXT(GLenum matrixMode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z) AliasExport("gl4es_glMatrixRotated");
|
||||
void glMatrixScalefEXT(GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z) AliasExport("gl4es_glMatrixScalef");
|
||||
void glMatrixScaledEXT(GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z) AliasExport("gl4es_glMatrixScaled");
|
||||
void glMatrixTranslatefEXT(GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z) AliasExport("gl4es_glMatrixTranslatef");
|
||||
void glMatrixTranslatedEXT(GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z) AliasExport("gl4es_glMatrixTranslated");
|
||||
void glMatrixOrthoEXT(GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f) AliasExport("gl4es_glMatrixOrtho");
|
||||
void glMatrixFrustumEXT(GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f) AliasExport("gl4es_glMatrixFrustum");
|
||||
void glMatrixPushEXT(GLenum matrixMode) AliasExport("gl4es_glMatrixPush");
|
||||
void glMatrixPopEXT(GLenum matrixMode) AliasExport("gl4es_glMatrixPop");
|
||||
void glTextureParameteriEXT(GLuint texture, GLenum target, GLenum pname, GLint param) AliasExport("gl4es_glTextureParameteri");
|
||||
void glTextureParameterivEXT(GLuint texture, GLenum target, GLenum pname, const GLint *param) AliasExport("gl4es_glTextureParameteriv");
|
||||
void glTextureParameterfEXT(GLuint texture, GLenum target, GLenum pname, GLfloat param) AliasExport("gl4es_glTextureParameterf");
|
||||
void glTextureParameterfvEXT(GLuint texture, GLenum target, GLenum pname, const GLfloat *param) AliasExport("gl4es_glTextureParameterfv");
|
||||
void glTextureImage1DEXT(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels) AliasExport("gl4es_glTextureImage1D");
|
||||
void glTextureImage2DEXT(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels) AliasExport("gl4es_glTextureImage2D");
|
||||
void glTextureSubImage1DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels) AliasExport("gl4es_glTextureSubImage1D");
|
||||
void glTextureSubImage2DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels) AliasExport("gl4es_glTextureSubImage2D");
|
||||
void glCopyTextureImage1DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) AliasExport("gl4es_glCopyTextureImage1D");
|
||||
void glCopyTextureImage2DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) AliasExport("gl4es_glCopyTextureImage2D");
|
||||
void glCopyTextureSubImage1DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) AliasExport("gl4es_glCopyTextureSubImage1D");
|
||||
void glCopyTextureSubImage2DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) AliasExport("gl4es_glCopyTextureSubImage2D");
|
||||
void glGetTextureImageEXT(GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels) AliasExport("gl4es_glGetTextureImage");
|
||||
void glGetTextureParameterfvEXT(GLuint texture, GLenum target, GLenum pname, GLfloat *params) AliasExport("gl4es_glGetTextureParameterfv");
|
||||
void glGetTextureParameterivEXT(GLuint texture, GLenum target, GLenum pname, GLint *params) AliasExport("gl4es_glGetTextureParameteriv");
|
||||
void glGetTextureLevelParameterfvEXT(GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params) AliasExport("gl4es_glGetTextureLevelParameterfv");
|
||||
void glGetTextureLevelParameterivEXT(GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params) AliasExport("gl4es_glGetTextureLevelParameteriv");
|
||||
void glTextureImage3DEXT(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels) AliasExport("gl4es_glTextureImage3D");
|
||||
void glTextureSubImage3DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels) AliasExport("gl4es_glTextureSubImage3D");
|
||||
void glCopyTextureSubImage3DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) AliasExport("gl4es_glCopyTextureSubImage3D");
|
||||
void glBindMultiTextureEXT(GLenum texunit, GLenum target, GLuint texture) AliasExport("gl4es_glBindMultiTexture");
|
||||
void glMultiTexCoordPointerEXT(GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) AliasExport("gl4es_glMultiTexCoordPointer");
|
||||
void glMultiTexEnvfEXT(GLenum texunit, GLenum target, GLenum pname, GLfloat param) AliasExport("gl4es_glMultiTexEnvf");
|
||||
void glMultiTexEnvfvEXT(GLenum texunit, GLenum target, GLenum pname, const GLfloat *params) AliasExport("gl4es_glMultiTexEnvfv");
|
||||
void glMultiTexEnviEXT(GLenum texunit, GLenum target, GLenum pname, GLint param) AliasExport("gl4es_glMultiTexEnvi");
|
||||
void glMultiTexEnvivEXT(GLenum texunit, GLenum target, GLenum pname, const GLint *params) AliasExport("gl4es_glMultiTexEnviv");
|
||||
void glMultiTexGendEXT(GLenum texunit, GLenum coord, GLenum pname, GLdouble param) AliasExport("gl4es_glMultiTexGend");
|
||||
void glMultiTexGendvEXT(GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params) AliasExport("gl4es_glMultiTexGendv");
|
||||
void glMultiTexGenfEXT(GLenum texunit, GLenum coord, GLenum pname, GLfloat param) AliasExport("gl4es_glMultiTexGenf");
|
||||
void glMultiTexGenfvEXT(GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params) AliasExport("gl4es_glMultiTexGenfv");
|
||||
void glMultiTexGeniEXT(GLenum texunit, GLenum coord, GLenum pname, GLint param) AliasExport("gl4es_glMultiTexGeni");
|
||||
void glMultiTexGenivEXT(GLenum texunit, GLenum coord, GLenum pname, const GLint *params) AliasExport("gl4es_glMultiTexGeniv");
|
||||
void glGetMultiTexEnvfvEXT(GLenum texunit, GLenum target, GLenum pname, GLfloat *params) AliasExport("gl4es_glGetMultiTexEnvfv");
|
||||
void glGetMultiTexEnvivEXT(GLenum texunit, GLenum target, GLenum pname, GLint *params) AliasExport("gl4es_glGetMultiTexEnviv");
|
||||
void glGetMultiTexGendvEXT(GLenum texunit, GLenum coord, GLenum pname, GLdouble *params) AliasExport("gl4es_glGetMultiTexGendv");
|
||||
void glGetMultiTexGenfvEXT(GLenum texunit, GLenum coord, GLenum pname, GLfloat *params) AliasExport("gl4es_glGetMultiTexGenfv");
|
||||
void glGetMultiTexGenivEXT(GLenum texunit, GLenum coord, GLenum pname, GLint *params) AliasExport("gl4es_glGetMultiTexGeniv");
|
||||
void glMultiTexParameteriEXT(GLenum texunit, GLenum target, GLenum pname, GLint param) AliasExport("gl4es_glMultiTexParameteri");
|
||||
void glMultiTexParameterivEXT(GLenum texunit, GLenum target, GLenum pname, const GLint *param) AliasExport("gl4es_glMultiTexParameteriv");
|
||||
void glMultiTexParameterfEXT(GLenum texunit, GLenum target, GLenum pname, GLfloat param) AliasExport("gl4es_glMultiTexParameterf");
|
||||
void glMultiTexParameterfvEXT(GLenum texunit, GLenum target, GLenum pname, const GLfloat *param) AliasExport("gl4es_glMultiTexParameterfv");
|
||||
void glMultiTexImage1DEXT(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels) AliasExport("gl4es_glMultiTexImage1D");
|
||||
void glMultiTexImage2DEXT(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels) AliasExport("gl4es_glMultiTexImage2D");
|
||||
void glMultiTexSubImage1DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels) AliasExport("gl4es_glMultiTexSubImage1D");
|
||||
void glMultiTexSubImage2DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels) AliasExport("gl4es_glMultiTexSubImage2D");
|
||||
void glCopyMultiTexImage1DEXT(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) AliasExport("gl4es_glCopyMultiTexImage1D");
|
||||
void glCopyMultiTexImage2DEXT(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) AliasExport("gl4es_glCopyMultiTexImage2D");
|
||||
void glCopyMultiTexSubImage1DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) AliasExport("gl4es_glCopyMultiTexSubImage1D");
|
||||
void glCopyMultiTexSubImage2DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) AliasExport("gl4es_glCopyMultiTexSubImage2D");
|
||||
void glGetMultiTexImageEXT(GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels) AliasExport("gl4es_glGetMultiTexImage");
|
||||
void glGetMultiTexParameterfvEXT(GLenum texunit, GLenum target, GLenum pname, GLfloat *params) AliasExport("gl4es_glGetMultiTexParameterfv");
|
||||
void glGetMultiTexParameterivEXT(GLenum texunit, GLenum target, GLenum pname, GLint *params) AliasExport("gl4es_glGetMultiTexParameteriv");
|
||||
void glGetMultiTexLevelParameterfvEXT(GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params) AliasExport("gl4es_glGetMultiTexLevelParameterfv");
|
||||
void glGetMultiTexLevelParameterivEXT(GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params) AliasExport("gl4es_glGetMultiTexLevelParameteriv");
|
||||
void glMultiTexImage3DEXT(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels) AliasExport("gl4es_glMultiTexImage3D");
|
||||
void glMultiTexSubImage3DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels) AliasExport("gl4es_glMultiTexSubImage3D");
|
||||
void glCopyMultiTexSubImage3DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) AliasExport("gl4es_glCopyMultiTexSubImage3D");
|
||||
void glCompressedTextureImage3DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data) AliasExport("gl4es_glCompressedTextureImage3D");
|
||||
void glCompressedTextureImage2DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data) AliasExport("gl4es_glCompressedTextureImage2D");
|
||||
void glCompressedTextureImage1DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data) AliasExport("gl4es_glCompressedTextureImage1D");
|
||||
void glCompressedTextureSubImage3DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data) AliasExport("gl4es_glCompressedTextureSubImage3D");
|
||||
void glCompressedTextureSubImage2DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data) AliasExport("gl4es_glCompressedTextureSubImage2D");
|
||||
void glCompressedTextureSubImage1DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data) AliasExport("gl4es_glCompressedTextureSubImage1D");
|
||||
void glGetCompressedTextureImageEXT(GLuint texture, GLenum target, GLint level, GLvoid *img) AliasExport("gl4es_glGetCompressedTextureImage");
|
||||
void glCompressedMultiTexImage3DEXT(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data) AliasExport("gl4es_glCompressedMultiTexImage3D");
|
||||
void glCompressedMultiTexImage2DEXT(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data) AliasExport("gl4es_glCompressedMultiTexImage2D");
|
||||
void glCompressedMultiTexImage1DEXT(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data) AliasExport("gl4es_glCompressedMultiTexImage1D");
|
||||
void glCompressedMultiTexSubImage3DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data) AliasExport("gl4es_glCompressedMultiTexSubImage3D");
|
||||
void glCompressedMultiTexSubImage2DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data) AliasExport("gl4es_glCompressedMultiTexSubImage2D");
|
||||
void glCompressedMultiTexSubImage1DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data) AliasExport("gl4es_glCompressedMultiTexSubImage1D");
|
||||
void glGetCompressedMultiTexImageEXT(GLenum texunit, GLenum target, GLint level, GLvoid *img) AliasExport("gl4es_glGetCompressedMultiTexImage");
|
||||
void glMatrixLoadTransposefEXT(GLenum matrixMode, const GLfloat *m) AliasExport("gl4es_glMatrixLoadTransposef");
|
||||
void glMatrixLoadTransposedEXT(GLenum matrixMode, const GLdouble *m) AliasExport("gl4es_glMatrixLoadTransposed");
|
||||
void glMatrixMultTransposefEXT(GLenum matrixMode, const GLfloat *m) AliasExport("gl4es_glMatrixMultTransposef");
|
||||
void glMatrixMultTransposedEXT(GLenum matrixMode, const GLdouble *m) AliasExport("gl4es_glMatrixMultTransposed");
|
||||
|
||||
#undef text
|
||||
#undef texc
|
||||
|
||||
@@ -3,104 +3,104 @@
|
||||
|
||||
#include "gl.h"
|
||||
|
||||
void glshim_glClientAttribDefault(GLbitfield mask);
|
||||
void glshim_glPushClientAttribDefault(GLbitfield mask);
|
||||
void gl4es_glClientAttribDefault(GLbitfield mask);
|
||||
void gl4es_glPushClientAttribDefault(GLbitfield mask);
|
||||
|
||||
void glshim_glMatrixLoadf(GLenum matrixMode, const GLfloat *m);
|
||||
void glshim_glMatrixLoadd(GLenum matrixMode, const GLdouble *m);
|
||||
void glshim_glMatrixMultf(GLenum matrixMode, const GLfloat *m);
|
||||
void glshim_glMatrixMultd(GLenum matrixMode, const GLdouble *m);
|
||||
void glshim_glMatrixLoadIdentity(GLenum matrixMode);
|
||||
void glshim_glMatrixRotatef(GLenum matrixMode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
|
||||
void glshim_glMatrixRotated(GLenum matrixMode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
|
||||
void glshim_glMatrixScalef(GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z);
|
||||
void glshim_glMatrixScaled(GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z);
|
||||
void glshim_glMatrixTranslatef(GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z);
|
||||
void glshim_glMatrixTranslated(GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z);
|
||||
void glshim_glMatrixOrtho(GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f);
|
||||
void glshim_glMatrixFrustum(GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f);
|
||||
void glshim_glMatrixPush(GLenum matrixMode);
|
||||
void glshim_glMatrixPop(GLenum matrixMode);
|
||||
void gl4es_glMatrixLoadf(GLenum matrixMode, const GLfloat *m);
|
||||
void gl4es_glMatrixLoadd(GLenum matrixMode, const GLdouble *m);
|
||||
void gl4es_glMatrixMultf(GLenum matrixMode, const GLfloat *m);
|
||||
void gl4es_glMatrixMultd(GLenum matrixMode, const GLdouble *m);
|
||||
void gl4es_glMatrixLoadIdentity(GLenum matrixMode);
|
||||
void gl4es_glMatrixRotatef(GLenum matrixMode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
|
||||
void gl4es_glMatrixRotated(GLenum matrixMode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
|
||||
void gl4es_glMatrixScalef(GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z);
|
||||
void gl4es_glMatrixScaled(GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z);
|
||||
void gl4es_glMatrixTranslatef(GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z);
|
||||
void gl4es_glMatrixTranslated(GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z);
|
||||
void gl4es_glMatrixOrtho(GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f);
|
||||
void gl4es_glMatrixFrustum(GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f);
|
||||
void gl4es_glMatrixPush(GLenum matrixMode);
|
||||
void gl4es_glMatrixPop(GLenum matrixMode);
|
||||
|
||||
void glshim_glTextureParameteri(GLuint texture, GLenum target, GLenum pname, GLint param);
|
||||
void glshim_glTextureParameteriv(GLuint texture, GLenum target, GLenum pname, const GLint *param);
|
||||
void glshim_glTextureParameterf(GLuint texture, GLenum target, GLenum pname, GLfloat param);
|
||||
void glshim_glTextureParameterfv(GLuint texture, GLenum target, GLenum pname, const GLfloat *param);
|
||||
void glshim_glTextureImage1D(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void glshim_glTextureImage2D(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void glshim_glTextureSubImage1D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void glshim_glTextureSubImage2D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void glshim_glCopyTextureImage1D(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
|
||||
void glshim_glCopyTextureImage2D(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
|
||||
void glshim_glCopyTextureSubImage1D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
|
||||
void glshim_glCopyTextureSubImage2D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
void glshim_glGetTextureImage(GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
|
||||
void glshim_glGetTextureParameterfv(GLuint texture, GLenum target, GLenum pname, GLfloat *params);
|
||||
void glshim_glGetTextureParameteriv(GLuint texture, GLenum target, GLenum pname, GLint *params);
|
||||
void glshim_glGetTextureLevelParameterfv(GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params);
|
||||
void glshim_glGetTextureLevelParameteriv(GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params);
|
||||
void gl4es_glTextureParameteri(GLuint texture, GLenum target, GLenum pname, GLint param);
|
||||
void gl4es_glTextureParameteriv(GLuint texture, GLenum target, GLenum pname, const GLint *param);
|
||||
void gl4es_glTextureParameterf(GLuint texture, GLenum target, GLenum pname, GLfloat param);
|
||||
void gl4es_glTextureParameterfv(GLuint texture, GLenum target, GLenum pname, const GLfloat *param);
|
||||
void gl4es_glTextureImage1D(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void gl4es_glTextureImage2D(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void gl4es_glTextureSubImage1D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void gl4es_glTextureSubImage2D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void gl4es_glCopyTextureImage1D(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
|
||||
void gl4es_glCopyTextureImage2D(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
|
||||
void gl4es_glCopyTextureSubImage1D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
|
||||
void gl4es_glCopyTextureSubImage2D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
void gl4es_glGetTextureImage(GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
|
||||
void gl4es_glGetTextureParameterfv(GLuint texture, GLenum target, GLenum pname, GLfloat *params);
|
||||
void gl4es_glGetTextureParameteriv(GLuint texture, GLenum target, GLenum pname, GLint *params);
|
||||
void gl4es_glGetTextureLevelParameterfv(GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params);
|
||||
void gl4es_glGetTextureLevelParameteriv(GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params);
|
||||
|
||||
void glshim_glTextureImage3D(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void glshim_glTextureSubImage3D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void glshim_glCopyTextureSubImage3D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
void gl4es_glTextureImage3D(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void gl4es_glTextureSubImage3D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void gl4es_glCopyTextureSubImage3D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
|
||||
void glshim_glBindMultiTexture(GLenum texunit, GLenum target, GLuint texture);
|
||||
void glshim_glMultiTexCoordPointer(GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
void glshim_glMultiTexEnvf(GLenum texunit, GLenum target, GLenum pname, GLfloat param);
|
||||
void glshim_glMultiTexEnvfv(GLenum texunit, GLenum target, GLenum pname, const GLfloat *params);
|
||||
void glshim_glMultiTexEnvi(GLenum texunit, GLenum target, GLenum pname, GLint param);
|
||||
void glshim_glMultiTexEnviv(GLenum texunit, GLenum target, GLenum pname, const GLint *params);
|
||||
void glshim_glMultiTexGend(GLenum texunit, GLenum coord, GLenum pname, GLdouble param);
|
||||
void glshim_glMultiTexGendv(GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params);
|
||||
void glshim_glMultiTexGenf(GLenum texunit, GLenum coord, GLenum pname, GLfloat param);
|
||||
void glshim_glMultiTexGenfv(GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params);
|
||||
void glshim_glMultiTexGeni(GLenum texunit, GLenum coord, GLenum pname, GLint param);
|
||||
void glshim_glMultiTexGeniv(GLenum texunit, GLenum coord, GLenum pname, const GLint *params);
|
||||
void glshim_glGetMultiTexEnvfv(GLenum texunit, GLenum target, GLenum pname, GLfloat *params);
|
||||
void glshim_glGetMultiTexEnviv(GLenum texunit, GLenum target, GLenum pname, GLint *params);
|
||||
void glshim_glGetMultiTexGendv(GLenum texunit, GLenum coord, GLenum pname, GLdouble *params);
|
||||
void glshim_glGetMultiTexGenfv(GLenum texunit, GLenum coord, GLenum pname, GLfloat *params);
|
||||
void glshim_glGetMultiTexGeniv(GLenum texunit, GLenum coord, GLenum pname, GLint *params);
|
||||
void glshim_glMultiTexParameteri(GLenum texunit, GLenum target, GLenum pname, GLint param);
|
||||
void glshim_glMultiTexParameteriv(GLenum texunit, GLenum target, GLenum pname, const GLint *param);
|
||||
void glshim_glMultiTexParameterf(GLenum texunit, GLenum target, GLenum pname, GLfloat param);
|
||||
void glshim_glMultiTexParameterfv(GLenum texunit, GLenum target, GLenum pname, const GLfloat *param);
|
||||
void glshim_glMultiTexImage1D(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void glshim_glMultiTexImage2D(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void glshim_glMultiTexSubImage1D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void glshim_glMultiTexSubImage2D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void glshim_glCopyMultiTexImage1D(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
|
||||
void glshim_glCopyMultiTexImage2D(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
|
||||
void glshim_glCopyMultiTexSubImage1D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
|
||||
void glshim_glCopyMultiTexSubImage2D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
void glshim_glGetMultiTexImage(GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
|
||||
void glshim_glGetMultiTexParameterfv(GLenum texunit, GLenum target, GLenum pname, GLfloat *params);
|
||||
void glshim_glGetMultiTexParameteriv(GLenum texunit, GLenum target, GLenum pname, GLint *params);
|
||||
void glshim_glGetMultiTexLevelParameterfv(GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params);
|
||||
void glshim_glGetMultiTexLevelParameteriv(GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params);
|
||||
void glshim_glMultiTexImage3D(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void glshim_glMultiTexSubImage3D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void glshim_glCopyMultiTexSubImage3D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
void gl4es_glBindMultiTexture(GLenum texunit, GLenum target, GLuint texture);
|
||||
void gl4es_glMultiTexCoordPointer(GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
void gl4es_glMultiTexEnvf(GLenum texunit, GLenum target, GLenum pname, GLfloat param);
|
||||
void gl4es_glMultiTexEnvfv(GLenum texunit, GLenum target, GLenum pname, const GLfloat *params);
|
||||
void gl4es_glMultiTexEnvi(GLenum texunit, GLenum target, GLenum pname, GLint param);
|
||||
void gl4es_glMultiTexEnviv(GLenum texunit, GLenum target, GLenum pname, const GLint *params);
|
||||
void gl4es_glMultiTexGend(GLenum texunit, GLenum coord, GLenum pname, GLdouble param);
|
||||
void gl4es_glMultiTexGendv(GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params);
|
||||
void gl4es_glMultiTexGenf(GLenum texunit, GLenum coord, GLenum pname, GLfloat param);
|
||||
void gl4es_glMultiTexGenfv(GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params);
|
||||
void gl4es_glMultiTexGeni(GLenum texunit, GLenum coord, GLenum pname, GLint param);
|
||||
void gl4es_glMultiTexGeniv(GLenum texunit, GLenum coord, GLenum pname, const GLint *params);
|
||||
void gl4es_glGetMultiTexEnvfv(GLenum texunit, GLenum target, GLenum pname, GLfloat *params);
|
||||
void gl4es_glGetMultiTexEnviv(GLenum texunit, GLenum target, GLenum pname, GLint *params);
|
||||
void gl4es_glGetMultiTexGendv(GLenum texunit, GLenum coord, GLenum pname, GLdouble *params);
|
||||
void gl4es_glGetMultiTexGenfv(GLenum texunit, GLenum coord, GLenum pname, GLfloat *params);
|
||||
void gl4es_glGetMultiTexGeniv(GLenum texunit, GLenum coord, GLenum pname, GLint *params);
|
||||
void gl4es_glMultiTexParameteri(GLenum texunit, GLenum target, GLenum pname, GLint param);
|
||||
void gl4es_glMultiTexParameteriv(GLenum texunit, GLenum target, GLenum pname, const GLint *param);
|
||||
void gl4es_glMultiTexParameterf(GLenum texunit, GLenum target, GLenum pname, GLfloat param);
|
||||
void gl4es_glMultiTexParameterfv(GLenum texunit, GLenum target, GLenum pname, const GLfloat *param);
|
||||
void gl4es_glMultiTexImage1D(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void gl4es_glMultiTexImage2D(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void gl4es_glMultiTexSubImage1D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void gl4es_glMultiTexSubImage2D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void gl4es_glCopyMultiTexImage1D(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
|
||||
void gl4es_glCopyMultiTexImage2D(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
|
||||
void gl4es_glCopyMultiTexSubImage1D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
|
||||
void gl4es_glCopyMultiTexSubImage2D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
void gl4es_glGetMultiTexImage(GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
|
||||
void gl4es_glGetMultiTexParameterfv(GLenum texunit, GLenum target, GLenum pname, GLfloat *params);
|
||||
void gl4es_glGetMultiTexParameteriv(GLenum texunit, GLenum target, GLenum pname, GLint *params);
|
||||
void gl4es_glGetMultiTexLevelParameterfv(GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params);
|
||||
void gl4es_glGetMultiTexLevelParameteriv(GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params);
|
||||
void gl4es_glMultiTexImage3D(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void gl4es_glMultiTexSubImage3D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void gl4es_glCopyMultiTexSubImage3D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
|
||||
void glshim_glCompressedTextureImage3D(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
|
||||
void glshim_glCompressedTextureImage2D(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
|
||||
void glshim_glCompressedTextureImage1D(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
|
||||
void glshim_glCompressedTextureSubImage3D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
|
||||
void glshim_glCompressedTextureSubImage2D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
|
||||
void glshim_glCompressedTextureSubImage1D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
|
||||
void glshim_glGetCompressedTextureImage(GLuint texture, GLenum target, GLint level, GLvoid *img);
|
||||
void gl4es_glCompressedTextureImage3D(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
|
||||
void gl4es_glCompressedTextureImage2D(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
|
||||
void gl4es_glCompressedTextureImage1D(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
|
||||
void gl4es_glCompressedTextureSubImage3D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
|
||||
void gl4es_glCompressedTextureSubImage2D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
|
||||
void gl4es_glCompressedTextureSubImage1D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
|
||||
void gl4es_glGetCompressedTextureImage(GLuint texture, GLenum target, GLint level, GLvoid *img);
|
||||
|
||||
void glshim_glCompressedMultiTexImage3D(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
|
||||
void glshim_glCompressedMultiTexImage2D(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
|
||||
void glshim_glCompressedMultiTexImage1D(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
|
||||
void glshim_glCompressedMultiTexSubImage3D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
|
||||
void glshim_glCompressedMultiTexSubImage2D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
|
||||
void glshim_glCompressedMultiTexSubImage1D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
|
||||
void glshim_glGetCompressedMultiTexImage(GLenum texunit, GLenum target, GLint level, GLvoid *img);
|
||||
void gl4es_glCompressedMultiTexImage3D(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
|
||||
void gl4es_glCompressedMultiTexImage2D(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
|
||||
void gl4es_glCompressedMultiTexImage1D(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
|
||||
void gl4es_glCompressedMultiTexSubImage3D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
|
||||
void gl4es_glCompressedMultiTexSubImage2D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
|
||||
void gl4es_glCompressedMultiTexSubImage1D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
|
||||
void gl4es_glGetCompressedMultiTexImage(GLenum texunit, GLenum target, GLint level, GLvoid *img);
|
||||
|
||||
void glshim_glMatrixLoadTransposef(GLenum matrixMode, const GLfloat *m);
|
||||
void glshim_glMatrixLoadTransposed(GLenum matrixMode, const GLdouble *m);
|
||||
void glshim_glMatrixMultTransposef(GLenum matrixMode, const GLfloat *m);
|
||||
void glshim_glMatrixMultTransposed(GLenum matrixMode, const GLdouble *m);
|
||||
void gl4es_glMatrixLoadTransposef(GLenum matrixMode, const GLfloat *m);
|
||||
void gl4es_glMatrixLoadTransposed(GLenum matrixMode, const GLdouble *m);
|
||||
void gl4es_glMatrixMultTransposef(GLenum matrixMode, const GLfloat *m);
|
||||
void gl4es_glMatrixMultTransposed(GLenum matrixMode, const GLdouble *m);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -61,7 +61,7 @@ static inline map_state_t **get_map_pointer(GLenum target) {
|
||||
case_state(dims, GL_MAP##dims##_VERTEX_4, vertex4); \
|
||||
}
|
||||
|
||||
void glshim_glMap1d(GLenum target, GLdouble u1, GLdouble u2,
|
||||
void gl4es_glMap1d(GLenum target, GLdouble u1, GLdouble u2,
|
||||
GLint ustride, GLint uorder, const GLdouble *points) {
|
||||
noerrorShim();
|
||||
map_statef_t *map = malloc(sizeof(map_statef_t));
|
||||
@@ -71,7 +71,7 @@ void glshim_glMap1d(GLenum target, GLdouble u1, GLdouble u2,
|
||||
map->points = copy_eval_double(target, ustride, uorder, 0, 1, points);
|
||||
}
|
||||
|
||||
void glshim_glMap1f(GLenum target, GLfloat u1, GLfloat u2,
|
||||
void gl4es_glMap1f(GLenum target, GLfloat u1, GLfloat u2,
|
||||
GLint ustride, GLint uorder, const GLfloat *points) {
|
||||
noerrorShim();
|
||||
map_statef_t *map = malloc(sizeof(map_statef_t));
|
||||
@@ -81,7 +81,7 @@ void glshim_glMap1f(GLenum target, GLfloat u1, GLfloat u2,
|
||||
map->points = points;
|
||||
}
|
||||
|
||||
void glshim_glMap2d(GLenum target, GLdouble u1, GLdouble u2,
|
||||
void gl4es_glMap2d(GLenum target, GLdouble u1, GLdouble u2,
|
||||
GLint ustride, GLint uorder, GLdouble v1, GLdouble v2,
|
||||
GLint vstride, GLint vorder, const GLdouble *points) {
|
||||
noerrorShim();
|
||||
@@ -93,7 +93,7 @@ void glshim_glMap2d(GLenum target, GLdouble u1, GLdouble u2,
|
||||
map->points = copy_eval_double(target, ustride, uorder, vstride, vorder, points);
|
||||
}
|
||||
|
||||
void glshim_glMap2f(GLenum target, GLfloat u1, GLfloat u2,
|
||||
void gl4es_glMap2f(GLenum target, GLfloat u1, GLfloat u2,
|
||||
GLint ustride, GLint uorder, GLfloat v1, GLfloat v2,
|
||||
GLint vstride, GLint vorder, const GLfloat *points) {
|
||||
noerrorShim();
|
||||
@@ -119,7 +119,7 @@ void glshim_glMap2f(GLenum target, GLfloat u1, GLfloat u2,
|
||||
map_statef_t *map = (map_statef_t *)_map; \
|
||||
GLfloat out[4]; \
|
||||
code \
|
||||
glshim_##func##v(out); \
|
||||
gl4es_##func##v(out); \
|
||||
} \
|
||||
}}
|
||||
|
||||
@@ -134,7 +134,7 @@ void glshim_glMap2f(GLenum target, GLfloat u1, GLfloat u2,
|
||||
p_map(d, vertex3, glVertex3f, code); \
|
||||
p_map(d, vertex4, glVertex4f, code);
|
||||
|
||||
void glshim_glEvalCoord1f(GLfloat u) {
|
||||
void gl4es_glEvalCoord1f(GLfloat u) {
|
||||
noerrorShim();
|
||||
iter_maps(1,
|
||||
GLfloat uu = (u - map->u._1) * map->u.d;
|
||||
@@ -142,7 +142,7 @@ void glshim_glEvalCoord1f(GLfloat u) {
|
||||
)
|
||||
}
|
||||
|
||||
void glshim_glEvalCoord2f(GLfloat u, GLfloat v) {
|
||||
void gl4es_glEvalCoord2f(GLfloat u, GLfloat v) {
|
||||
noerrorShim();
|
||||
iter_maps(2,
|
||||
GLfloat uu = (u - map->u._1) * map->u.d;
|
||||
@@ -157,7 +157,7 @@ void glshim_glEvalCoord2f(GLfloat u, GLfloat v) {
|
||||
#undef p_map
|
||||
#undef iter_maps
|
||||
|
||||
void glshim_glMapGrid1f(GLint un, GLfloat u1, GLfloat u2) {
|
||||
void gl4es_glMapGrid1f(GLint un, GLfloat u1, GLfloat u2) {
|
||||
noerrorShim();
|
||||
// TODO: double support?
|
||||
map_statef_t *map;
|
||||
@@ -171,7 +171,7 @@ void glshim_glMapGrid1f(GLint un, GLfloat u1, GLfloat u2) {
|
||||
map->u._2 = u2;
|
||||
}
|
||||
|
||||
void glshim_glMapGrid2f(GLint un, GLfloat u1, GLfloat u2,
|
||||
void gl4es_glMapGrid2f(GLint un, GLfloat u1, GLfloat u2,
|
||||
GLint vn, GLfloat v1, GLfloat v2) {
|
||||
noerrorShim();
|
||||
// TODO: double support?
|
||||
@@ -214,7 +214,7 @@ static inline GLenum eval_mesh_prep(map_statef_t **map, GLenum mode) {
|
||||
}
|
||||
}
|
||||
|
||||
void glshim_glEvalMesh1(GLenum mode, GLint i1, GLint i2) {
|
||||
void gl4es_glEvalMesh1(GLenum mode, GLint i1, GLint i2) {
|
||||
noerrorShim();
|
||||
map_statef_t *map;
|
||||
GLenum renderMode = eval_mesh_prep(&map, mode);
|
||||
@@ -224,14 +224,14 @@ void glshim_glEvalMesh1(GLenum mode, GLint i1, GLint i2) {
|
||||
GLfloat u, du, u1;
|
||||
du = map->u.d;
|
||||
GLint i;
|
||||
glshim_glBegin(renderMode);
|
||||
gl4es_glBegin(renderMode);
|
||||
for (u = u1, i = i1; i <= i2; i++, u += du) {
|
||||
glshim_glEvalCoord1f(u);
|
||||
gl4es_glEvalCoord1f(u);
|
||||
}
|
||||
glshim_glEnd();
|
||||
gl4es_glEnd();
|
||||
}
|
||||
|
||||
void glshim_glEvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2) {
|
||||
void gl4es_glEvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2) {
|
||||
noerrorShim();
|
||||
map_statef_t *map;
|
||||
GLenum renderMode = eval_mesh_prep(&map, mode);
|
||||
@@ -242,40 +242,40 @@ void glshim_glEvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2) {
|
||||
du = map->u.d;
|
||||
dv = map->v.d;
|
||||
GLint i, j;
|
||||
glshim_glBegin(renderMode);
|
||||
gl4es_glBegin(renderMode);
|
||||
for (v = v1, j = j1; j <= j2; j++, v += dv) {
|
||||
for (u = u1, i = i1; i <= i2; i++, u += du) {
|
||||
glshim_glEvalCoord2f(u, v);
|
||||
gl4es_glEvalCoord2f(u, v);
|
||||
if (mode == GL_FILL)
|
||||
glshim_glEvalCoord2f(u, v + dv);
|
||||
gl4es_glEvalCoord2f(u, v + dv);
|
||||
}
|
||||
}
|
||||
glshim_glEnd();
|
||||
gl4es_glEnd();
|
||||
if (mode == GL_LINE) {
|
||||
glshim_glBegin(renderMode);
|
||||
gl4es_glBegin(renderMode);
|
||||
for (u = u1, i = i1; i <= i2; i++, u += du) {
|
||||
for (v = v1, j = j1; j <= j2; j++, v += dv) {
|
||||
glshim_glEvalCoord2f(u, v);
|
||||
gl4es_glEvalCoord2f(u, v);
|
||||
}
|
||||
}
|
||||
glshim_glEnd();
|
||||
gl4es_glEnd();
|
||||
}
|
||||
}
|
||||
|
||||
void glshim_glEvalPoint1(GLint i) {
|
||||
void gl4es_glEvalPoint1(GLint i) {
|
||||
map_statef_t *map;
|
||||
if (eval_mesh_prep(&map, 0))
|
||||
glshim_glEvalCoord1f(i + map->u.d);
|
||||
gl4es_glEvalCoord1f(i + map->u.d);
|
||||
}
|
||||
|
||||
void glshim_glEvalPoint2(GLint i, GLint j) {
|
||||
void gl4es_glEvalPoint2(GLint i, GLint j) {
|
||||
map_statef_t *map;
|
||||
if (eval_mesh_prep(&map, 0))
|
||||
glshim_glEvalCoord2f(i + map->u.d, j + map->v.d);
|
||||
gl4es_glEvalCoord2f(i + map->u.d, j + map->v.d);
|
||||
}
|
||||
|
||||
#define GL_GET_MAP(t, type) \
|
||||
void glshim_glGetMap##t##v(GLenum target, GLenum query, type *v) { \
|
||||
void gl4es_glGetMap##t##v(GLenum target, GLenum query, type *v) { \
|
||||
noerrorShim(); \
|
||||
map_statef_t *map = *(map_statef_t **)get_map_pointer(target); \
|
||||
if (map) { \
|
||||
@@ -317,18 +317,18 @@ GL_GET_MAP(d, GLdouble)
|
||||
#undef GL_GET_MAP
|
||||
|
||||
//Direct wrapper
|
||||
void glMap1d(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points) AliasExport("glshim_glMap1d");
|
||||
void glMap1f(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points) AliasExport("glshim_glMap1f");
|
||||
void glMap2d(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points) AliasExport("glshim_glMap2d");
|
||||
void glMap2f(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points) AliasExport("glshim_glMap2f");
|
||||
void glEvalCoord1f(GLfloat u) AliasExport("glshim_glEvalCoord1f");
|
||||
void glEvalCoord2f(GLfloat u, GLfloat v) AliasExport("glshim_glEvalCoord2f");
|
||||
void glEvalMesh1(GLenum mode, GLint i1, GLint i2) AliasExport("glshim_glEvalMesh1");
|
||||
void glEvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2) AliasExport("glshim_glEvalMesh2");
|
||||
void glEvalPoint1(GLint i) AliasExport("glshim_glEvalPoint1");
|
||||
void glEvalPoint2(GLint i, GLint j) AliasExport("glshim_glEvalPoint2");
|
||||
void glMapGrid1f(GLint un, GLfloat u1, GLfloat u2) AliasExport("glshim_glMapGrid1f");
|
||||
void glMapGrid2f(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2) AliasExport("glshim_glMapGrid2f");
|
||||
void glGetMapdv(GLenum target, GLenum query, GLdouble *v) AliasExport("glshim_glGetMapdv");
|
||||
void glGetMapfv(GLenum target, GLenum query, GLfloat *v) AliasExport("glshim_glGetMapfv");
|
||||
void glGetMapiv(GLenum target, GLenum query, GLint *v) AliasExport("glshim_glGetMapiv");
|
||||
void glMap1d(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points) AliasExport("gl4es_glMap1d");
|
||||
void glMap1f(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points) AliasExport("gl4es_glMap1f");
|
||||
void glMap2d(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points) AliasExport("gl4es_glMap2d");
|
||||
void glMap2f(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points) AliasExport("gl4es_glMap2f");
|
||||
void glEvalCoord1f(GLfloat u) AliasExport("gl4es_glEvalCoord1f");
|
||||
void glEvalCoord2f(GLfloat u, GLfloat v) AliasExport("gl4es_glEvalCoord2f");
|
||||
void glEvalMesh1(GLenum mode, GLint i1, GLint i2) AliasExport("gl4es_glEvalMesh1");
|
||||
void glEvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2) AliasExport("gl4es_glEvalMesh2");
|
||||
void glEvalPoint1(GLint i) AliasExport("gl4es_glEvalPoint1");
|
||||
void glEvalPoint2(GLint i, GLint j) AliasExport("gl4es_glEvalPoint2");
|
||||
void glMapGrid1f(GLint un, GLfloat u1, GLfloat u2) AliasExport("gl4es_glMapGrid1f");
|
||||
void glMapGrid2f(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2) AliasExport("gl4es_glMapGrid2f");
|
||||
void glGetMapdv(GLenum target, GLenum query, GLdouble *v) AliasExport("gl4es_glGetMapdv");
|
||||
void glGetMapfv(GLenum target, GLenum query, GLfloat *v) AliasExport("gl4es_glGetMapfv");
|
||||
void glGetMapiv(GLenum target, GLenum query, GLint *v) AliasExport("gl4es_glGetMapiv");
|
||||
|
||||
@@ -3,27 +3,27 @@
|
||||
#ifndef GL_MAP_H
|
||||
#define GL_MAP_H
|
||||
|
||||
void glshim_glMap1d(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points);
|
||||
void glshim_glMap1f(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points);
|
||||
void glshim_glMap2d(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points);
|
||||
void glshim_glMap2f(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points);
|
||||
void gl4es_glMap1d(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points);
|
||||
void gl4es_glMap1f(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points);
|
||||
void gl4es_glMap2d(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points);
|
||||
void gl4es_glMap2f(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points);
|
||||
|
||||
void glshim_glEvalCoord1d(GLdouble u);
|
||||
void glshim_glEvalCoord1f(GLfloat u);
|
||||
void glshim_glEvalCoord2d(GLdouble u, GLdouble v);
|
||||
void glshim_glEvalCoord2f(GLfloat u, GLfloat v);
|
||||
void gl4es_glEvalCoord1d(GLdouble u);
|
||||
void gl4es_glEvalCoord1f(GLfloat u);
|
||||
void gl4es_glEvalCoord2d(GLdouble u, GLdouble v);
|
||||
void gl4es_glEvalCoord2f(GLfloat u, GLfloat v);
|
||||
|
||||
void glshim_glEvalMesh1(GLenum mode, GLint i1, GLint i2);
|
||||
void glshim_glEvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2);
|
||||
void glshim_glEvalPoint1(GLint i);
|
||||
void glshim_glEvalPoint2(GLint i, GLint j);
|
||||
void glshim_glMapGrid1d(GLint un, GLdouble u1, GLdouble u2);
|
||||
void glshim_glMapGrid1f(GLint un, GLfloat u1, GLfloat u2);
|
||||
void glshim_glMapGrid2d(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2);
|
||||
void glshim_glMapGrid2f(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2);
|
||||
void glshim_glGetMapdv(GLenum target, GLenum query, GLdouble *v);
|
||||
void glshim_glGetMapfv(GLenum target, GLenum query, GLfloat *v);
|
||||
void glshim_glGetMapiv(GLenum target, GLenum query, GLint *v);
|
||||
void gl4es_glEvalMesh1(GLenum mode, GLint i1, GLint i2);
|
||||
void gl4es_glEvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2);
|
||||
void gl4es_glEvalPoint1(GLint i);
|
||||
void gl4es_glEvalPoint2(GLint i, GLint j);
|
||||
void gl4es_glMapGrid1d(GLint un, GLdouble u1, GLdouble u2);
|
||||
void gl4es_glMapGrid1f(GLint un, GLfloat u1, GLfloat u2);
|
||||
void gl4es_glMapGrid2d(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2);
|
||||
void gl4es_glMapGrid2f(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2);
|
||||
void gl4es_glGetMapdv(GLenum target, GLenum query, GLdouble *v);
|
||||
void gl4es_glGetMapfv(GLenum target, GLenum query, GLfloat *v);
|
||||
void gl4es_glGetMapiv(GLenum target, GLenum query, GLint *v);
|
||||
|
||||
typedef struct {
|
||||
GLenum type;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "framebuffers.h"
|
||||
#include "debug.h"
|
||||
#include "../glx/hardext.h"
|
||||
#include "init.h"
|
||||
#ifndef ANDROID
|
||||
#include <execinfo.h>
|
||||
#endif
|
||||
@@ -20,8 +21,6 @@ int mainfbo_height = 480;
|
||||
int mainfbo_nwidth = 1024;
|
||||
int mainfbo_nheight = 512;
|
||||
|
||||
extern bool g_recyclefbo;
|
||||
|
||||
GLuint fbo_read = 0; // if not 0, that's the READ only Framebuffer attached
|
||||
GLuint fbo_draw = 0; // if not 0, that's the DRAW only Framebuffer attached
|
||||
|
||||
@@ -53,11 +52,11 @@ void readfboEnd() {
|
||||
gles_glBindFramebuffer(GL_FRAMEBUFFER, fbo);
|
||||
}
|
||||
|
||||
void glshim_glGenFramebuffers(GLsizei n, GLuint *ids) {
|
||||
void gl4es_glGenFramebuffers(GLsizei n, GLuint *ids) {
|
||||
LOAD_GLES_OES(glGenFramebuffers);
|
||||
//printf("glGenFramebuffers(%i, %p)\n", n, ids);
|
||||
GLsizei m = 0;
|
||||
while(g_recyclefbo && (nbr_fbos>0) && (n-m>0)) {
|
||||
while(globals4es.recyclefbo && (nbr_fbos>0) && (n-m>0)) {
|
||||
//printf("Recycled 1 FBO\n");
|
||||
ids[m++] = old_fbos[--nbr_fbos];
|
||||
}
|
||||
@@ -68,10 +67,10 @@ void glshim_glGenFramebuffers(GLsizei n, GLuint *ids) {
|
||||
gles_glGenFramebuffers(n-m, ids+m);
|
||||
}
|
||||
|
||||
void glshim_glDeleteFramebuffers(GLsizei n, GLuint *framebuffers) {
|
||||
void gl4es_glDeleteFramebuffers(GLsizei n, GLuint *framebuffers) {
|
||||
//printf("glDeleteFramebuffers(%i, %p), framebuffers[0]=%u\n", n, framebuffers, framebuffers[0]);
|
||||
if (glstate->gl_batch) flush();
|
||||
if (g_recyclefbo) {
|
||||
if (globals4es.recyclefbo) {
|
||||
//printf("Recycling %i FBOs\n", n);
|
||||
noerrorShim();
|
||||
if(cap_fbos == 0) {
|
||||
@@ -91,7 +90,7 @@ void glshim_glDeleteFramebuffers(GLsizei n, GLuint *framebuffers) {
|
||||
}
|
||||
}
|
||||
|
||||
GLboolean glshim_glIsFramebuffer(GLuint framebuffer) {
|
||||
GLboolean gl4es_glIsFramebuffer(GLuint framebuffer) {
|
||||
//printf("glIsFramebuffer(%u)\n", framebuffer);
|
||||
if (glstate->gl_batch) flush();
|
||||
LOAD_GLES_OES(glIsFramebuffer);
|
||||
@@ -102,7 +101,7 @@ GLboolean glshim_glIsFramebuffer(GLuint framebuffer) {
|
||||
|
||||
GLenum fb_status;
|
||||
|
||||
GLenum glshim_glCheckFramebufferStatus(GLenum target) {
|
||||
GLenum gl4es_glCheckFramebufferStatus(GLenum target) {
|
||||
if (glstate->gl_batch) flush();
|
||||
//#define BEFORE 1
|
||||
#ifdef BEFORE
|
||||
@@ -119,7 +118,7 @@ GLenum glshim_glCheckFramebufferStatus(GLenum target) {
|
||||
return result;
|
||||
}
|
||||
|
||||
void glshim_glBindFramebuffer(GLenum target, GLuint framebuffer) {
|
||||
void gl4es_glBindFramebuffer(GLenum target, GLuint framebuffer) {
|
||||
//printf("glBindFramebuffer(%s, %u), list=%s\n", PrintEnum(target), framebuffer, glstate->list.active?"active":"none");
|
||||
//PUSH_IF_COMPILING(glBindFramebuffer);
|
||||
if (glstate->gl_batch) flush();
|
||||
@@ -164,7 +163,7 @@ void glshim_glBindFramebuffer(GLenum target, GLuint framebuffer) {
|
||||
}
|
||||
|
||||
|
||||
void glshim_glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {
|
||||
void gl4es_glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {
|
||||
static GLuint scrap_tex = 0;
|
||||
static int scrap_width = 0;
|
||||
static int scrap_height = 0;
|
||||
@@ -237,12 +236,12 @@ void glshim_glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum text
|
||||
if (level!=0) return;
|
||||
// let's create a renderbuffer and attach it instead of the (presumably) depth texture
|
||||
GLuint render_depth; // memory leak here...
|
||||
glshim_glGenRenderbuffers(1, &render_depth);
|
||||
glshim_glBindRenderbuffer(GL_RENDERBUFFER, render_depth);
|
||||
glshim_glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, twidth, theight);
|
||||
glshim_glBindRenderbuffer(GL_RENDERBUFFER, 0);
|
||||
gl4es_glGenRenderbuffers(1, &render_depth);
|
||||
gl4es_glBindRenderbuffer(GL_RENDERBUFFER, render_depth);
|
||||
gl4es_glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, twidth, theight);
|
||||
gl4es_glBindRenderbuffer(GL_RENDERBUFFER, 0);
|
||||
errorGL();
|
||||
glshim_glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, render_depth);
|
||||
gl4es_glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, render_depth);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -252,7 +251,7 @@ void glshim_glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum text
|
||||
if (level!=0) {
|
||||
//bind a scrap texture, we don't want level != 0 binding on GLES
|
||||
if(!scrap_tex)
|
||||
glshim_glGenTextures(1, &scrap_tex);
|
||||
gl4es_glGenTextures(1, &scrap_tex);
|
||||
if ((scrap_width!=twidth) || (scrap_height!=theight)) {
|
||||
scrap_width = twidth;
|
||||
scrap_height = theight;
|
||||
@@ -269,15 +268,15 @@ void glshim_glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum text
|
||||
gles_glFramebufferTexture2D(target, attachment, textarget, texture, 0);
|
||||
}
|
||||
|
||||
void glshim_glFramebufferTexture1D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {
|
||||
glshim_glFramebufferTexture2D(target, attachment, GL_TEXTURE_2D, texture, level);
|
||||
void gl4es_glFramebufferTexture1D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {
|
||||
gl4es_glFramebufferTexture2D(target, attachment, GL_TEXTURE_2D, texture, level);
|
||||
}
|
||||
void glshim_glFramebufferTexture3D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer) {
|
||||
void gl4es_glFramebufferTexture3D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer) {
|
||||
(void)layer;
|
||||
glshim_glFramebufferTexture2D(target, attachment, GL_TEXTURE_2D, texture, level);
|
||||
gl4es_glFramebufferTexture2D(target, attachment, GL_TEXTURE_2D, texture, level);
|
||||
}
|
||||
|
||||
void glshim_glGenRenderbuffers(GLsizei n, GLuint *renderbuffers) {
|
||||
void gl4es_glGenRenderbuffers(GLsizei n, GLuint *renderbuffers) {
|
||||
LOAD_GLES_OES(glGenRenderbuffers);
|
||||
//printf("glGenRenderbuffers(%i, %p)\n", n, renderbuffers);
|
||||
|
||||
@@ -285,7 +284,7 @@ void glshim_glGenRenderbuffers(GLsizei n, GLuint *renderbuffers) {
|
||||
gles_glGenRenderbuffers(n, renderbuffers);
|
||||
}
|
||||
|
||||
void glshim_glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) {
|
||||
void gl4es_glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) {
|
||||
LOAD_GLES_OES(glFramebufferRenderbuffer);
|
||||
LOAD_GLES_OES(glGetFramebufferAttachmentParameteriv);
|
||||
//printf("glFramebufferRenderbuffer(%s, %s, %s, %u)\n", PrintEnum(target), PrintEnum(attachment), PrintEnum(renderbuffertarget), renderbuffer);
|
||||
@@ -319,7 +318,7 @@ void glshim_glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum r
|
||||
gles_glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
|
||||
}
|
||||
|
||||
void glshim_glDeleteRenderbuffers(GLsizei n, GLuint *renderbuffers) {
|
||||
void gl4es_glDeleteRenderbuffers(GLsizei n, GLuint *renderbuffers) {
|
||||
if (glstate->gl_batch) flush();
|
||||
LOAD_GLES_OES(glDeleteRenderbuffers);
|
||||
|
||||
@@ -345,7 +344,7 @@ void glshim_glDeleteRenderbuffers(GLsizei n, GLuint *renderbuffers) {
|
||||
gles_glDeleteRenderbuffers(n, renderbuffers);
|
||||
}
|
||||
|
||||
void glshim_glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) {
|
||||
void gl4es_glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) {
|
||||
LOAD_GLES_OES(glRenderbufferStorage);
|
||||
LOAD_GLES_OES(glGenRenderbuffers);
|
||||
LOAD_GLES_OES(glBindRenderbuffer);
|
||||
@@ -397,11 +396,11 @@ void glshim_glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei
|
||||
gles_glRenderbufferStorage(target, internalformat, width, height);
|
||||
}
|
||||
|
||||
void glshim_glRenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) { //STUB
|
||||
glshim_glRenderbufferStorage(target, internalformat, width, height);
|
||||
void gl4es_glRenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) { //STUB
|
||||
gl4es_glRenderbufferStorage(target, internalformat, width, height);
|
||||
}
|
||||
|
||||
void glshim_glBindRenderbuffer(GLenum target, GLuint renderbuffer) {
|
||||
void gl4es_glBindRenderbuffer(GLenum target, GLuint renderbuffer) {
|
||||
if (glstate->gl_batch) flush();
|
||||
LOAD_GLES_OES(glBindRenderbuffer);
|
||||
//printf("glBindRenderbuffer(%s, %u), binded Fbo=%u\n", PrintEnum(target), renderbuffer, current_fb);
|
||||
@@ -412,7 +411,7 @@ void glshim_glBindRenderbuffer(GLenum target, GLuint renderbuffer) {
|
||||
gles_glBindRenderbuffer(target, renderbuffer);
|
||||
}
|
||||
|
||||
GLboolean glshim_glIsRenderbuffer(GLuint renderbuffer) {
|
||||
GLboolean gl4es_glIsRenderbuffer(GLuint renderbuffer) {
|
||||
//printf("glIsRenderbuffer(%u)\n", renderbuffer);
|
||||
if (glstate->gl_batch) flush();
|
||||
LOAD_GLES_OES(glIsRenderbuffer);
|
||||
@@ -421,7 +420,7 @@ GLboolean glshim_glIsRenderbuffer(GLuint renderbuffer) {
|
||||
return gles_glIsRenderbuffer(renderbuffer);
|
||||
}
|
||||
|
||||
void glshim_glGenerateMipmap(GLenum target) {
|
||||
void gl4es_glGenerateMipmap(GLenum target) {
|
||||
//printf("glGenerateMipmap(0x%04X)\n", target);
|
||||
LOAD_GLES_OES(glGenerateMipmap);
|
||||
|
||||
@@ -429,14 +428,14 @@ void glshim_glGenerateMipmap(GLenum target) {
|
||||
return gles_glGenerateMipmap(target);
|
||||
}
|
||||
|
||||
void glshim_glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint *params) {
|
||||
void gl4es_glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint *params) {
|
||||
//printf("glGetFramebufferAttachmentParameteriv(%s, %s, %s, %p)\n", PrintEnum(target), PrintEnum(attachment), PrintEnum(pname), params);
|
||||
LOAD_GLES_OES(glGetFramebufferAttachmentParameteriv);
|
||||
|
||||
// hack to return DEPTH size
|
||||
if(target==GL_FRAMEBUFFER && attachment==GL_DEPTH_ATTACHMENT && pname==GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE && hardext.depthtex==0) {
|
||||
noerrorShim();
|
||||
glshim_glGetFramebufferAttachmentParameteriv(target, attachment, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, params);
|
||||
gl4es_glGetFramebufferAttachmentParameteriv(target, attachment, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, params);
|
||||
if (params)
|
||||
*params = 16; //Depth buffer is 16 on GLES. No check for 24 bits here...
|
||||
return;
|
||||
@@ -446,7 +445,7 @@ void glshim_glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachme
|
||||
return gles_glGetFramebufferAttachmentParameteriv(target, attachment, pname, params);
|
||||
}
|
||||
|
||||
void glshim_glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint * params) {
|
||||
void gl4es_glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint * params) {
|
||||
//printf("glGetRenderbufferParameteriv(%s, %s, %p)\n", PrintEnum(target), PrintEnum(pname), params);
|
||||
LOAD_GLES_OES(glGetRenderbufferParameteriv);
|
||||
|
||||
@@ -568,9 +567,9 @@ void blitMainFBO() {
|
||||
int old_tex = glstate->texture.active;
|
||||
int old_client = glstate->texture.client;
|
||||
if (glstate->texture.active != 0)
|
||||
glshim_glActiveTexture(GL_TEXTURE0);
|
||||
gl4es_glActiveTexture(GL_TEXTURE0);
|
||||
if (glstate->texture.client != 0)
|
||||
glshim_glClientActiveTexture(GL_TEXTURE0);
|
||||
gl4es_glClientActiveTexture(GL_TEXTURE0);
|
||||
// bind the FBO texture
|
||||
gles_glEnable(GL_TEXTURE_2D);
|
||||
gles_glBindTexture(GL_TEXTURE_2D, mainfbo_tex);
|
||||
@@ -593,17 +592,17 @@ void blitMainFBO() {
|
||||
LOAD_GLES(glPushMatrix);
|
||||
LOAD_GLES(glPopMatrix);
|
||||
|
||||
glshim_glPushAttrib(GL_TEXTURE_BIT | GL_ENABLE_BIT | GL_TRANSFORM_BIT | GL_COLOR_BUFFER_BIT | GL_CURRENT_BIT);
|
||||
gl4es_glPushAttrib(GL_TEXTURE_BIT | GL_ENABLE_BIT | GL_TRANSFORM_BIT | GL_COLOR_BUFFER_BIT | GL_CURRENT_BIT);
|
||||
|
||||
glshim_glMatrixMode(GL_TEXTURE);
|
||||
gl4es_glMatrixMode(GL_TEXTURE);
|
||||
gles_glPushMatrix();
|
||||
glshim_glLoadIdentity();
|
||||
glshim_glMatrixMode(GL_PROJECTION);
|
||||
gl4es_glLoadIdentity();
|
||||
gl4es_glMatrixMode(GL_PROJECTION);
|
||||
gles_glPushMatrix();
|
||||
glshim_glLoadIdentity();
|
||||
glshim_glMatrixMode(GL_MODELVIEW);
|
||||
gl4es_glLoadIdentity();
|
||||
gl4es_glMatrixMode(GL_MODELVIEW);
|
||||
gles_glPushMatrix();
|
||||
glshim_glLoadIdentity();
|
||||
gl4es_glLoadIdentity();
|
||||
GLfloat vert[] = {
|
||||
-1, -1,
|
||||
+1, -1,
|
||||
@@ -619,13 +618,13 @@ void blitMainFBO() {
|
||||
0, sh
|
||||
};
|
||||
|
||||
glshim_glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT);
|
||||
gl4es_glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT);
|
||||
|
||||
glshim_glDisable(GL_DEPTH_TEST);
|
||||
glshim_glDisable(GL_LIGHTING);
|
||||
glshim_glDisable(GL_CULL_FACE);
|
||||
glshim_glDisable(GL_ALPHA_TEST);
|
||||
glshim_glDisable(GL_BLEND);
|
||||
gl4es_glDisable(GL_DEPTH_TEST);
|
||||
gl4es_glDisable(GL_LIGHTING);
|
||||
gl4es_glDisable(GL_CULL_FACE);
|
||||
gl4es_glDisable(GL_ALPHA_TEST);
|
||||
gl4es_glDisable(GL_BLEND);
|
||||
|
||||
// glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
|
||||
@@ -641,7 +640,7 @@ void blitMainFBO() {
|
||||
gles_glTexCoordPointer(2, GL_FLOAT, 0, tex);
|
||||
for (int a=1; a <MAX_TEX; a++)
|
||||
if(glstate->clientstate.tex_coord_array[a]) {
|
||||
glshim_glClientActiveTexture(GL_TEXTURE0 + a);
|
||||
gl4es_glClientActiveTexture(GL_TEXTURE0 + a);
|
||||
gles_glDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glstate->clientstate.tex_coord_array[a] = 0;
|
||||
}
|
||||
@@ -655,18 +654,18 @@ void blitMainFBO() {
|
||||
}
|
||||
|
||||
|
||||
glshim_glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
gl4es_glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
|
||||
gles_glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
|
||||
// All the previous states are Pushed / Poped anyway...
|
||||
glshim_glPopClientAttrib();
|
||||
glshim_glMatrixMode(GL_MODELVIEW);
|
||||
gl4es_glPopClientAttrib();
|
||||
gl4es_glMatrixMode(GL_MODELVIEW);
|
||||
gles_glPopMatrix();
|
||||
glshim_glMatrixMode(GL_PROJECTION);
|
||||
gl4es_glMatrixMode(GL_PROJECTION);
|
||||
gles_glPopMatrix();
|
||||
glshim_glMatrixMode(GL_TEXTURE);
|
||||
gl4es_glMatrixMode(GL_TEXTURE);
|
||||
gles_glPopMatrix();
|
||||
glshim_glPopAttrib();
|
||||
gl4es_glPopAttrib();
|
||||
}
|
||||
#endif
|
||||
// put back viewport
|
||||
@@ -679,9 +678,9 @@ void blitMainFBO() {
|
||||
if (!glstate->enable.texture_2d[0])
|
||||
gles_glDisable(GL_TEXTURE_2D);
|
||||
if (old_tex != 0)
|
||||
glshim_glActiveTexture(GL_TEXTURE0 + old_tex);
|
||||
gl4es_glActiveTexture(GL_TEXTURE0 + old_tex);
|
||||
if (old_client != 0)
|
||||
glshim_glClientActiveTexture(GL_TEXTURE0 + old_client);
|
||||
gl4es_glClientActiveTexture(GL_TEXTURE0 + old_client);
|
||||
}
|
||||
|
||||
void bindMainFBO() {
|
||||
@@ -730,11 +729,11 @@ void deleteMainFBO() {
|
||||
// all done...
|
||||
}
|
||||
|
||||
void glshim_glFramebufferTextureLayer( GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) {
|
||||
glshim_glFramebufferTexture2D(target, attachment, GL_TEXTURE_2D, texture, level); // Force Texture2D, ignore layer...
|
||||
void gl4es_glFramebufferTextureLayer( GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) {
|
||||
gl4es_glFramebufferTexture2D(target, attachment, GL_TEXTURE_2D, texture, level); // Force Texture2D, ignore layer...
|
||||
}
|
||||
|
||||
void glshim_glBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) {
|
||||
void gl4es_glBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) {
|
||||
// TODO!
|
||||
// create a temp texture
|
||||
// glCopyPixel of read FBO
|
||||
@@ -746,43 +745,43 @@ printf("glBlitFramebuffer(%d, %d, %d, %d, %d, %d, %d, %d, 0x%04X, 0x%04X)\n",
|
||||
|
||||
// direct wrapper
|
||||
|
||||
void glGenFramebuffers(GLsizei n, GLuint *ids) AliasExport("glshim_glGenFramebuffers");
|
||||
void glDeleteFramebuffers(GLsizei n, GLuint *framebuffers) AliasExport("glshim_glDeleteFramebuffers");
|
||||
GLboolean glIsFramebuffer(GLuint framebuffer) AliasExport("glshim_glIsFramebuffer");
|
||||
GLenum glCheckFramebufferStatus(GLenum target) AliasExport("glshim_glCheckFramebufferStatus");
|
||||
void glBindFramebuffer(GLenum target, GLuint framebuffer) AliasExport("glshim_glBindFramebuffer");
|
||||
void glFramebufferTexture1D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) AliasExport("glshim_glFramebufferTexture1D");
|
||||
void glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) AliasExport("glshim_glFramebufferTexture2D");
|
||||
void glFramebufferTexture3D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer) AliasExport("glshim_glFramebufferTexture3D");
|
||||
void glGenRenderbuffers(GLsizei n, GLuint *renderbuffers) AliasExport("glshim_glGenRenderbuffers");
|
||||
void glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) AliasExport("glshim_glFramebufferRenderbuffer");
|
||||
void glDeleteRenderbuffers(GLsizei n, GLuint *renderbuffers) AliasExport("glshim_glDeleteRenderbuffers");
|
||||
void glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) AliasExport("glshim_glRenderbufferStorage");
|
||||
void glBindRenderbuffer(GLenum target, GLuint renderbuffer) AliasExport("glshim_glBindRenderbuffer");
|
||||
GLboolean glIsRenderbuffer(GLuint renderbuffer) AliasExport("glshim_glIsRenderbuffer");
|
||||
void glGenerateMipmap(GLenum target) AliasExport("glshim_glGenerateMipmap");
|
||||
void glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint *params) AliasExport("glshim_glGetFramebufferAttachmentParameteriv");
|
||||
void glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint * params) AliasExport("glshim_glGetRenderbufferParameteriv");
|
||||
void glFramebufferTextureLayer( GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) AliasExport("glshim_glFramebufferTextureLayer");
|
||||
void glBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) AliasExport("glshim_glBlitFramebuffer");
|
||||
void glGenFramebuffers(GLsizei n, GLuint *ids) AliasExport("gl4es_glGenFramebuffers");
|
||||
void glDeleteFramebuffers(GLsizei n, GLuint *framebuffers) AliasExport("gl4es_glDeleteFramebuffers");
|
||||
GLboolean glIsFramebuffer(GLuint framebuffer) AliasExport("gl4es_glIsFramebuffer");
|
||||
GLenum glCheckFramebufferStatus(GLenum target) AliasExport("gl4es_glCheckFramebufferStatus");
|
||||
void glBindFramebuffer(GLenum target, GLuint framebuffer) AliasExport("gl4es_glBindFramebuffer");
|
||||
void glFramebufferTexture1D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) AliasExport("gl4es_glFramebufferTexture1D");
|
||||
void glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) AliasExport("gl4es_glFramebufferTexture2D");
|
||||
void glFramebufferTexture3D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer) AliasExport("gl4es_glFramebufferTexture3D");
|
||||
void glGenRenderbuffers(GLsizei n, GLuint *renderbuffers) AliasExport("gl4es_glGenRenderbuffers");
|
||||
void glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) AliasExport("gl4es_glFramebufferRenderbuffer");
|
||||
void glDeleteRenderbuffers(GLsizei n, GLuint *renderbuffers) AliasExport("gl4es_glDeleteRenderbuffers");
|
||||
void glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) AliasExport("gl4es_glRenderbufferStorage");
|
||||
void glBindRenderbuffer(GLenum target, GLuint renderbuffer) AliasExport("gl4es_glBindRenderbuffer");
|
||||
GLboolean glIsRenderbuffer(GLuint renderbuffer) AliasExport("gl4es_glIsRenderbuffer");
|
||||
void glGenerateMipmap(GLenum target) AliasExport("gl4es_glGenerateMipmap");
|
||||
void glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint *params) AliasExport("gl4es_glGetFramebufferAttachmentParameteriv");
|
||||
void glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint * params) AliasExport("gl4es_glGetRenderbufferParameteriv");
|
||||
void glFramebufferTextureLayer( GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) AliasExport("gl4es_glFramebufferTextureLayer");
|
||||
void glBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) AliasExport("gl4es_glBlitFramebuffer");
|
||||
|
||||
// EXT direct wrapper
|
||||
void glGenFramebuffersEXT(GLsizei n, GLuint *ids) AliasExport("glshim_glGenFramebuffers");
|
||||
void glDeleteFramebuffersEXT(GLsizei n, GLuint *framebuffers) AliasExport("glshim_glDeleteFramebuffers");
|
||||
GLboolean glIsFramebufferEXT(GLuint framebuffer) AliasExport("glshim_glIsFramebuffer");
|
||||
GLenum glCheckFramebufferStatusEXT(GLenum target) AliasExport("glshim_glCheckFramebufferStatus");
|
||||
void glBindFramebufferEXT(GLenum target, GLuint framebuffer) AliasExport("glshim_glBindFramebuffer");
|
||||
void glFramebufferTexture1DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) AliasExport("glshim_glFramebufferTexture1D");
|
||||
void glFramebufferTexture2DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) AliasExport("glshim_glFramebufferTexture2D");
|
||||
void glFramebufferTexture3DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer) AliasExport("glshim_glFramebufferTexture3D");
|
||||
void glGenRenderbuffersEXT(GLsizei n, GLuint *renderbuffers) AliasExport("glshim_glGenRenderbuffers");
|
||||
void glFramebufferRenderbufferEXT(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) AliasExport("glshim_glFramebufferRenderbuffer");
|
||||
void glDeleteRenderbuffersEXT(GLsizei n, GLuint *renderbuffers) AliasExport("glshim_glDeleteRenderbuffers");
|
||||
void glRenderbufferStorageEXT(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) AliasExport("glshim_glRenderbufferStorage");
|
||||
void glBindRenderbufferEXT(GLenum target, GLuint renderbuffer) AliasExport("glshim_glBindRenderbuffer");
|
||||
GLboolean glIsRenderbufferEXT(GLuint renderbuffer) AliasExport("glshim_glIsRenderbuffer");
|
||||
void glGenerateMipmapEXT(GLenum target) AliasExport("glshim_glGenerateMipmap");
|
||||
void glGetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, GLenum pname, GLint *params) AliasExport("glshim_glGetFramebufferAttachmentParameteriv");
|
||||
void glGetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint * params) AliasExport("glshim_glGetRenderbufferParameteriv");
|
||||
void glFramebufferTextureLayerEXT( GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) AliasExport("glshim_glFramebufferTextureLayer");
|
||||
void glBlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) AliasExport("glshim_glBlitFramebuffer");
|
||||
void glGenFramebuffersEXT(GLsizei n, GLuint *ids) AliasExport("gl4es_glGenFramebuffers");
|
||||
void glDeleteFramebuffersEXT(GLsizei n, GLuint *framebuffers) AliasExport("gl4es_glDeleteFramebuffers");
|
||||
GLboolean glIsFramebufferEXT(GLuint framebuffer) AliasExport("gl4es_glIsFramebuffer");
|
||||
GLenum glCheckFramebufferStatusEXT(GLenum target) AliasExport("gl4es_glCheckFramebufferStatus");
|
||||
void glBindFramebufferEXT(GLenum target, GLuint framebuffer) AliasExport("gl4es_glBindFramebuffer");
|
||||
void glFramebufferTexture1DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) AliasExport("gl4es_glFramebufferTexture1D");
|
||||
void glFramebufferTexture2DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) AliasExport("gl4es_glFramebufferTexture2D");
|
||||
void glFramebufferTexture3DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer) AliasExport("gl4es_glFramebufferTexture3D");
|
||||
void glGenRenderbuffersEXT(GLsizei n, GLuint *renderbuffers) AliasExport("gl4es_glGenRenderbuffers");
|
||||
void glFramebufferRenderbufferEXT(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) AliasExport("gl4es_glFramebufferRenderbuffer");
|
||||
void glDeleteRenderbuffersEXT(GLsizei n, GLuint *renderbuffers) AliasExport("gl4es_glDeleteRenderbuffers");
|
||||
void glRenderbufferStorageEXT(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) AliasExport("gl4es_glRenderbufferStorage");
|
||||
void glBindRenderbufferEXT(GLenum target, GLuint renderbuffer) AliasExport("gl4es_glBindRenderbuffer");
|
||||
GLboolean glIsRenderbufferEXT(GLuint renderbuffer) AliasExport("gl4es_glIsRenderbuffer");
|
||||
void glGenerateMipmapEXT(GLenum target) AliasExport("gl4es_glGenerateMipmap");
|
||||
void glGetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, GLenum pname, GLint *params) AliasExport("gl4es_glGetFramebufferAttachmentParameteriv");
|
||||
void glGetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint * params) AliasExport("gl4es_glGetRenderbufferParameteriv");
|
||||
void glFramebufferTextureLayerEXT( GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) AliasExport("gl4es_glFramebufferTextureLayer");
|
||||
void glBlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) AliasExport("gl4es_glBlitFramebuffer");
|
||||
|
||||
@@ -3,28 +3,28 @@
|
||||
#ifndef GL_FRAMEBUFFERS_H
|
||||
#define GL_FRAMEBUFFERS_H
|
||||
|
||||
void glshim_glGenerateMipmap(GLenum target);
|
||||
void glshim_glGenFramebuffers(GLsizei n, GLuint *ids);
|
||||
void glshim_glDeleteFramebuffers(GLsizei n, GLuint *framebuffers);
|
||||
GLboolean glshim_glIsFramebuffer(GLuint framebuffer);
|
||||
GLenum glshim_glCheckFramebufferStatus(GLenum target);
|
||||
void glshim_glBindFramebuffer(GLenum target, GLuint framebuffer);
|
||||
void glshim_glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
||||
void glshim_glGenRenderbuffers(GLsizei n, GLuint *renderbuffers);
|
||||
void glshim_glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
|
||||
void glshim_glDeleteRenderbuffers(GLsizei n, GLuint *renderbuffers);
|
||||
void glshim_glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
void glshim_glBindRenderbuffer(GLenum target, GLuint renderbuffer);
|
||||
GLboolean glshim_glIsRenderbuffer(GLuint renderbuffer);
|
||||
void glshim_glGenerateMipmap(GLenum target);
|
||||
void glshim_glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint *params);
|
||||
void glshim_glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint * params);
|
||||
void gl4es_glGenerateMipmap(GLenum target);
|
||||
void gl4es_glGenFramebuffers(GLsizei n, GLuint *ids);
|
||||
void gl4es_glDeleteFramebuffers(GLsizei n, GLuint *framebuffers);
|
||||
GLboolean gl4es_glIsFramebuffer(GLuint framebuffer);
|
||||
GLenum gl4es_glCheckFramebufferStatus(GLenum target);
|
||||
void gl4es_glBindFramebuffer(GLenum target, GLuint framebuffer);
|
||||
void gl4es_glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
||||
void gl4es_glGenRenderbuffers(GLsizei n, GLuint *renderbuffers);
|
||||
void gl4es_glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
|
||||
void gl4es_glDeleteRenderbuffers(GLsizei n, GLuint *renderbuffers);
|
||||
void gl4es_glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
void gl4es_glBindRenderbuffer(GLenum target, GLuint renderbuffer);
|
||||
GLboolean gl4es_glIsRenderbuffer(GLuint renderbuffer);
|
||||
void gl4es_glGenerateMipmap(GLenum target);
|
||||
void gl4es_glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint *params);
|
||||
void gl4es_glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint * params);
|
||||
|
||||
void glshim_glFramebufferTexture1D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); // naive Wrap
|
||||
void glshim_glFramebufferTexture3D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer); // naive Wrap
|
||||
void glshim_glRenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); //STUB
|
||||
void glshim_glFramebufferTextureLayer( GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); // naive Wrap
|
||||
void glshim_glBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
|
||||
void gl4es_glFramebufferTexture1D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); // naive Wrap
|
||||
void gl4es_glFramebufferTexture3D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer); // naive Wrap
|
||||
void gl4es_glRenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); //STUB
|
||||
void gl4es_glFramebufferTextureLayer( GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); // naive Wrap
|
||||
void gl4es_glBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
|
||||
|
||||
// Need to keep track of Renderbuffer that are created as DEPTH_STENCIL, to create 2 seperate buffers...
|
||||
typedef struct {
|
||||
|
||||
493
project/jni/gl4es/src/gl/getter.c
Executable file
493
project/jni/gl4es/src/gl/getter.c
Executable file
@@ -0,0 +1,493 @@
|
||||
#include "gl.h"
|
||||
#include "init.h"
|
||||
#include "texgen.h"
|
||||
#include "../glx/hardext.h"
|
||||
#include "gl4eshint.h"
|
||||
|
||||
GLenum gl4es_glGetError() {
|
||||
LOAD_GLES(glGetError);
|
||||
if(globals4es.noerror)
|
||||
return GL_NO_ERROR;
|
||||
if (glstate->shim_error) {
|
||||
GLenum tmp = glstate->last_error;
|
||||
glstate->last_error = GL_NO_ERROR;
|
||||
return tmp;
|
||||
}
|
||||
return gles_glGetError();
|
||||
}
|
||||
GLenum glGetError() AliasExport("gl4es_glGetError");
|
||||
|
||||
void gl4es_glGetPointerv(GLenum pname, GLvoid* *params) {
|
||||
noerrorShim();
|
||||
if (glstate->list.active && (glstate->gl_batch && !glstate->list.compiling)) flush();
|
||||
switch(pname) {
|
||||
case GL_COLOR_ARRAY_POINTER:
|
||||
*params = (void*)glstate->vao->pointers.color.pointer;
|
||||
break;
|
||||
case GL_EDGE_FLAG_ARRAY_POINTER:
|
||||
*params = NULL;
|
||||
break;
|
||||
case GL_FEEDBACK_BUFFER_POINTER:
|
||||
*params = NULL;
|
||||
break;
|
||||
case GL_INDEX_ARRAY_POINTER:
|
||||
*params = NULL;
|
||||
case GL_NORMAL_ARRAY_POINTER:
|
||||
*params = (void*)glstate->vao->pointers.normal.pointer;
|
||||
break;
|
||||
case GL_TEXTURE_COORD_ARRAY_POINTER:
|
||||
*params = (void*)glstate->vao->pointers.tex_coord[glstate->texture.client].pointer;
|
||||
break;
|
||||
case GL_SELECTION_BUFFER_POINTER:
|
||||
*params = glstate->selectbuf.buffer;
|
||||
break;
|
||||
case GL_VERTEX_ARRAY_POINTER :
|
||||
*params = (void*)glstate->vao->pointers.vertex.pointer;
|
||||
break;
|
||||
default:
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
}
|
||||
}
|
||||
void glGetPointerv(GLenum pname, GLvoid* *params) AliasExport("gl4es_glGetPointerv");
|
||||
|
||||
const GLubyte *gl4es_glGetString(GLenum name) {
|
||||
// LOAD_GLES(glGetString);
|
||||
const GLubyte *str;
|
||||
errorShim(GL_NO_ERROR);
|
||||
static GLubyte *extensions = NULL;
|
||||
if(!extensions) {
|
||||
extensions = (GLubyte*)malloc(5000); // arbitrary size...
|
||||
strcpy(extensions,
|
||||
"GL_EXT_abgr "
|
||||
"GL_EXT_packed_pixels "
|
||||
"GL_EXT_compiled_vertex_array "
|
||||
"GL_ARB_vertex_buffer_object "
|
||||
"GL_ARB_vertex_array_object "
|
||||
"GL_ARB_vertex_buffer "
|
||||
"GL_EXT_vertex_array "
|
||||
"GL_EXT_secondary_color "
|
||||
"GL_EXT_texture_env_combine "
|
||||
"GL_ARB_multitexture "
|
||||
"GL_ARB_texture_env_add "
|
||||
"GL_ARB_texture_border_clamp "
|
||||
"GL_ARB_point_parameters "
|
||||
"GL_EXT_texture_env_add "
|
||||
"GL_ARB_texture_env_combine "
|
||||
"GL_ARB_texture_env_crossbar "
|
||||
"GL_ARB_texture_env_dot3 "
|
||||
"GL_ARB_texture_mirrored_repeat "
|
||||
"GL_SGIS_generate_mipmap "
|
||||
"GL_EXT_packed_depth_stencil "
|
||||
"GL_EXT_draw_range_elements "
|
||||
"GL_EXT_bgra "
|
||||
"GL_ARB_texture_compression "
|
||||
"GL_EXT_texture_compression_s3tc "
|
||||
"GL_OES_texture_compression_S3TC "
|
||||
"GL_EXT_texture_compression_dxt3 "
|
||||
"GL_EXT_texture_compression_dxt5 "
|
||||
"GL_EXT_texture_compression_dxt1 "
|
||||
"GL_ARB_point_parameters "
|
||||
"GL_EXT_point_parameters "
|
||||
"GL_EXT_stencil_wrap "
|
||||
"GL_SGIS_texture_edge_clamp "
|
||||
"GL_EXT_texture_edge_clamp "
|
||||
"GL_EXT_direct_state_access "
|
||||
"GL_EXT_multi_draw_arrays "
|
||||
"GL_SUN_multi_draw_arrays "
|
||||
"GL_ARB_multisample "
|
||||
"GL_EXT_texture_object "
|
||||
"GL_EXT_polygon_offset "
|
||||
"GL_GL4ES_hint "
|
||||
// "GL_EXT_blend_logic_op "
|
||||
// "GL_ARB_texture_cube_map "
|
||||
);
|
||||
if(globals4es.npot>=1)
|
||||
strcat(extensions, "GL_APPLE_texture_2D_limited_npot ");
|
||||
if(globals4es.npot>=2)
|
||||
strcat(extensions, "GL_ARB_texture_non_power_of_two ");
|
||||
if(hardext.blendcolor)
|
||||
strcat(extensions, "GL_EXT_blend_color ");
|
||||
if(hardext.blendminmax)
|
||||
strcat(extensions, "GL_EXT_blend_minmax ");
|
||||
if(hardext.blendeq)
|
||||
strcat(extensions, "GL_EXT_blend_equation_separate ");
|
||||
if(hardext.blendfunc)
|
||||
strcat(extensions, "GL_EXT_blend_func_separate ");
|
||||
if(hardext.blendsub)
|
||||
strcat(extensions, "GL_EXT_blend_subtract ");
|
||||
if(hardext.fbo)
|
||||
strcat(extensions,
|
||||
"GL_ARB_framebuffer_object "
|
||||
"GL_EXT_framebuffer_object "
|
||||
"GL_EXT_packed_depth_stencil "
|
||||
"GL_ARB_draw_buffers ");
|
||||
if(hardext.pointsprite)
|
||||
strcat(extensions, "GL_ARB_point_sprite ");
|
||||
}
|
||||
switch (name) {
|
||||
case GL_VERSION:
|
||||
return (GLubyte *)globals4es.version;
|
||||
case GL_EXTENSIONS:
|
||||
return extensions;
|
||||
case GL_VENDOR:
|
||||
return (GLubyte *)"ptitSeb";
|
||||
case GL_RENDERER:
|
||||
return (GLubyte *)"GLES_CM wrapper";
|
||||
case GL_SHADING_LANGUAGE_VERSION:
|
||||
return (GLubyte *)"";
|
||||
default:
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
return (str)?str:(GLubyte*)"";
|
||||
}
|
||||
}
|
||||
const GLubyte *glGetString(GLenum name) AliasExport("gl4es_glGetString");
|
||||
|
||||
#define TOP(A) (glstate->A->stack+(glstate->A->top*16))
|
||||
|
||||
// glGet
|
||||
void gl4es_glGetIntegerv(GLenum pname, GLint *params) {
|
||||
if (params==NULL) {
|
||||
errorShim(GL_INVALID_OPERATION);
|
||||
return;
|
||||
}
|
||||
GLint dummy;
|
||||
LOAD_GLES(glGetIntegerv);
|
||||
if (glstate->list.active && (glstate->gl_batch && !glstate->list.compiling)) flush();
|
||||
noerrorShim();
|
||||
switch (pname) {
|
||||
case GL_MAX_ELEMENTS_INDICES:
|
||||
*params = 1024;
|
||||
break;
|
||||
case GL_MAX_ELEMENTS_VERTICES:
|
||||
*params = 4096;
|
||||
break;
|
||||
case GL_AUX_BUFFERS:
|
||||
*params = 0;
|
||||
break;
|
||||
case GL_MAX_DRAW_BUFFERS_ARB: // fake...
|
||||
*params = 1;
|
||||
break;
|
||||
case GL_UNPACK_ROW_LENGTH:
|
||||
*params = glstate->texture.unpack_row_length;
|
||||
break;
|
||||
case GL_UNPACK_SKIP_PIXELS:
|
||||
*params = glstate->texture.unpack_skip_pixels;
|
||||
break;
|
||||
case GL_UNPACK_SKIP_ROWS:
|
||||
*params = glstate->texture.unpack_skip_rows;
|
||||
break;
|
||||
case GL_UNPACK_LSB_FIRST:
|
||||
*params = glstate->texture.unpack_lsb_first;
|
||||
break;
|
||||
case GL_UNPACK_IMAGE_HEIGHT:
|
||||
*params = glstate->texture.unpack_image_height;
|
||||
break;
|
||||
case GL_PACK_ROW_LENGTH:
|
||||
*params = glstate->texture.pack_row_length;
|
||||
break;
|
||||
case GL_PACK_SKIP_PIXELS:
|
||||
*params = glstate->texture.pack_skip_pixels;
|
||||
break;
|
||||
case GL_PACK_SKIP_ROWS:
|
||||
*params = glstate->texture.pack_skip_rows;
|
||||
break;
|
||||
case GL_PACK_LSB_FIRST:
|
||||
*params = glstate->texture.pack_lsb_first;
|
||||
break;
|
||||
case GL_PACK_IMAGE_HEIGHT:
|
||||
*params = glstate->texture.pack_image_height;
|
||||
break;
|
||||
case GL_UNPACK_SWAP_BYTES:
|
||||
case GL_PACK_SWAP_BYTES:
|
||||
//Fake, *TODO* ?
|
||||
*params = 0;
|
||||
break;
|
||||
case GL_ZOOM_X:
|
||||
*params = glstate->raster.raster_zoomx;
|
||||
break;
|
||||
case GL_ZOOM_Y:
|
||||
*params = glstate->raster.raster_zoomy;
|
||||
break;
|
||||
case GL_RED_SCALE:
|
||||
*params = glstate->raster.raster_scale[0];
|
||||
break;
|
||||
case GL_RED_BIAS:
|
||||
*params = glstate->raster.raster_bias[0];
|
||||
break;
|
||||
case GL_GREEN_SCALE:
|
||||
case GL_BLUE_SCALE:
|
||||
case GL_ALPHA_SCALE:
|
||||
*params = glstate->raster.raster_scale[(pname-GL_GREEN_SCALE)/2+1];
|
||||
break;
|
||||
case GL_GREEN_BIAS:
|
||||
case GL_BLUE_BIAS:
|
||||
case GL_ALPHA_BIAS:
|
||||
*params = glstate->raster.raster_bias[(pname-GL_GREEN_BIAS)/2+1];
|
||||
break;
|
||||
case GL_POINT_SIZE_RANGE:
|
||||
gles_glGetIntegerv(GL_POINT_SIZE_MIN, params);
|
||||
gles_glGetIntegerv(GL_POINT_SIZE_MAX, params+1);
|
||||
break;
|
||||
case GL_RENDER_MODE:
|
||||
*params = (glstate->render_mode)?glstate->render_mode:GL_RENDER;
|
||||
break;
|
||||
case GL_NAME_STACK_DEPTH:
|
||||
*params = glstate->namestack.top;
|
||||
break;
|
||||
case GL_MAX_NAME_STACK_DEPTH:
|
||||
*params = 1024;
|
||||
break;
|
||||
case GL_MAX_TEXTURE_IMAGE_UNITS:
|
||||
/*gles_glGetIntegerv(GL_MAX_TEXTURE_UNITS, params);*/
|
||||
*params = 4;
|
||||
break;
|
||||
case GL_NUM_COMPRESSED_TEXTURE_FORMATS:
|
||||
gles_glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, params);
|
||||
(*params)+=4; // adding fake DXTc
|
||||
break;
|
||||
case GL_COMPRESSED_TEXTURE_FORMATS:
|
||||
gles_glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &dummy);
|
||||
// get standard ones
|
||||
gles_glGetIntegerv(GL_COMPRESSED_TEXTURE_FORMATS, params);
|
||||
// add fake DXTc
|
||||
params[dummy++]=GL_COMPRESSED_RGB_S3TC_DXT1_EXT;
|
||||
params[dummy++]=GL_COMPRESSED_RGBA_S3TC_DXT1_EXT;
|
||||
params[dummy++]=GL_COMPRESSED_RGBA_S3TC_DXT3_EXT;
|
||||
params[dummy++]=GL_COMPRESSED_RGBA_S3TC_DXT5_EXT;
|
||||
break;
|
||||
case GL_MAX_MODELVIEW_STACK_DEPTH:
|
||||
*params=MAX_STACK_MODELVIEW;
|
||||
break;
|
||||
case GL_MAX_PROJECTION_STACK_DEPTH:
|
||||
*params=MAX_STACK_PROJECTION;
|
||||
break;
|
||||
case GL_MAX_TEXTURE_STACK_DEPTH:
|
||||
*params=MAX_STACK_TEXTURE;
|
||||
break;
|
||||
case GL_MODELVIEW_STACK_DEPTH:
|
||||
*params=(glstate->modelview_matrix)?(glstate->modelview_matrix->top+1):1;
|
||||
break;
|
||||
case GL_PROJECTION_STACK_DEPTH:
|
||||
*params=(glstate->projection_matrix)?(glstate->projection_matrix->top+1):1;
|
||||
break;
|
||||
case GL_TEXTURE_STACK_DEPTH:
|
||||
*params=(glstate->texture_matrix)?(glstate->texture_matrix[glstate->texture.active]->top+1):1;
|
||||
break;
|
||||
case GL_MAX_LIST_NESTING:
|
||||
*params=64; // fake, no limit in fact
|
||||
break;
|
||||
case GL_ARRAY_BUFFER_BINDING:
|
||||
*params=(glstate->vao->vertex)?glstate->vao->vertex->buffer:0;
|
||||
break;
|
||||
case GL_ELEMENT_ARRAY_BUFFER_BINDING:
|
||||
*params=(glstate->vao->elements)?glstate->vao->elements->buffer:0;
|
||||
break;
|
||||
case GL_PIXEL_PACK_BUFFER_BINDING:
|
||||
*params=(glstate->vao->pack)?glstate->vao->pack->buffer:0;
|
||||
break;
|
||||
case GL_PIXEL_UNPACK_BUFFER_BINDING:
|
||||
*params=(glstate->vao->unpack)?glstate->vao->unpack->buffer:0;
|
||||
break;
|
||||
case GL_MATRIX_MODE:
|
||||
*params=glstate->matrix_mode;
|
||||
break;
|
||||
case GL_SHRINK_HINT_GL4ES:
|
||||
*params=globals4es.texshrink;
|
||||
break;
|
||||
case GL_ALPHAHACK_HINT_GL4ES:
|
||||
*params=globals4es.alphahack;
|
||||
break;
|
||||
case GL_RECYCLEFBO_HINT_GL4ES:
|
||||
*params=globals4es.recyclefbo;
|
||||
break;
|
||||
case GL_MIPMAP_HINT_GL4ES:
|
||||
*params=globals4es.automipmap;
|
||||
break;
|
||||
case GL_TEXDUMP_HINT_GL4ES:
|
||||
*params=globals4es.texdump;
|
||||
break;
|
||||
case GL_COPY_HINT_GL4ES:
|
||||
*params=globals4es.copytex;
|
||||
break;
|
||||
case GL_NOLUMAPHA_HINT_GL4ES:
|
||||
*params=globals4es.nolumalpha;
|
||||
break;
|
||||
case GL_BLENDHACK_HINT_GL4ES:
|
||||
*params=globals4es.blendhack;
|
||||
break;
|
||||
case GL_BATCH_HINT_GL4ES:
|
||||
*params=globals4es.batch;
|
||||
break;
|
||||
case GL_NOERROR_HINT_GL4ES:
|
||||
*params=globals4es.noerror;
|
||||
break;
|
||||
default:
|
||||
errorGL();
|
||||
gles_glGetIntegerv(pname, params);
|
||||
}
|
||||
}
|
||||
void glGetIntegerv(GLenum pname, GLint *params) AliasExport("gl4es_glGetIntegerv");
|
||||
|
||||
void gl4es_glGetFloatv(GLenum pname, GLfloat *params) {
|
||||
LOAD_GLES(glGetFloatv);
|
||||
if (glstate->list.active && (glstate->gl_batch && !glstate->list.compiling)) flush();
|
||||
noerrorShim();
|
||||
switch (pname) {
|
||||
case GL_MAX_ELEMENTS_INDICES:
|
||||
*params = 1024;
|
||||
break;
|
||||
case GL_MAX_ELEMENTS_VERTICES:
|
||||
*params = 4096;
|
||||
break;
|
||||
case GL_AUX_BUFFERS:
|
||||
*params = 0;
|
||||
break;
|
||||
case GL_UNPACK_ROW_LENGTH:
|
||||
*params = glstate->texture.unpack_row_length;
|
||||
break;
|
||||
case GL_UNPACK_SKIP_PIXELS:
|
||||
*params = glstate->texture.unpack_skip_pixels;
|
||||
break;
|
||||
case GL_UNPACK_SKIP_ROWS:
|
||||
*params = glstate->texture.unpack_skip_rows;
|
||||
break;
|
||||
case GL_UNPACK_LSB_FIRST:
|
||||
*params = glstate->texture.unpack_lsb_first;
|
||||
break;
|
||||
case GL_PACK_ROW_LENGTH:
|
||||
*params = glstate->texture.pack_row_length;
|
||||
break;
|
||||
case GL_PACK_SKIP_PIXELS:
|
||||
*params = glstate->texture.pack_skip_pixels;
|
||||
break;
|
||||
case GL_PACK_SKIP_ROWS:
|
||||
*params = glstate->texture.pack_skip_rows;
|
||||
break;
|
||||
case GL_PACK_LSB_FIRST:
|
||||
*params = glstate->texture.pack_lsb_first;
|
||||
break;
|
||||
case GL_ZOOM_X:
|
||||
*params = glstate->raster.raster_zoomx;
|
||||
break;
|
||||
case GL_ZOOM_Y:
|
||||
*params = glstate->raster.raster_zoomy;
|
||||
break;
|
||||
case GL_RED_SCALE:
|
||||
*params = glstate->raster.raster_scale[0];
|
||||
break;
|
||||
case GL_RED_BIAS:
|
||||
*params = glstate->raster.raster_bias[0];
|
||||
break;
|
||||
case GL_GREEN_SCALE:
|
||||
case GL_BLUE_SCALE:
|
||||
case GL_ALPHA_SCALE:
|
||||
*params = glstate->raster.raster_scale[(pname-GL_GREEN_SCALE)/2+1];
|
||||
break;
|
||||
case GL_GREEN_BIAS:
|
||||
case GL_BLUE_BIAS:
|
||||
case GL_ALPHA_BIAS:
|
||||
*params = glstate->raster.raster_bias[(pname-GL_GREEN_BIAS)/2+1];
|
||||
break;
|
||||
case GL_POINT_SIZE_RANGE:
|
||||
gles_glGetFloatv(GL_POINT_SIZE_MIN, params);
|
||||
gles_glGetFloatv(GL_POINT_SIZE_MAX, params+1);
|
||||
break;
|
||||
case GL_RENDER_MODE:
|
||||
*params = (glstate->render_mode)?glstate->render_mode:GL_RENDER;
|
||||
break;
|
||||
case GL_NAME_STACK_DEPTH:
|
||||
*params = glstate->namestack.top;
|
||||
break;
|
||||
case GL_MAX_NAME_STACK_DEPTH:
|
||||
*params = 1024;
|
||||
break;
|
||||
case GL_MAX_MODELVIEW_STACK_DEPTH:
|
||||
*params=MAX_STACK_MODELVIEW;
|
||||
break;
|
||||
case GL_MAX_PROJECTION_STACK_DEPTH:
|
||||
*params=MAX_STACK_PROJECTION;
|
||||
break;
|
||||
case GL_MAX_TEXTURE_STACK_DEPTH:
|
||||
*params=MAX_STACK_TEXTURE;
|
||||
break;
|
||||
case GL_MODELVIEW_STACK_DEPTH:
|
||||
*params=(glstate->modelview_matrix)?(glstate->modelview_matrix->top+1):1;
|
||||
break;
|
||||
case GL_PROJECTION_STACK_DEPTH:
|
||||
*params=(glstate->projection_matrix)?(glstate->projection_matrix->top+1):1;
|
||||
break;
|
||||
case GL_TEXTURE_STACK_DEPTH:
|
||||
*params=(glstate->texture_matrix)?(glstate->texture_matrix[glstate->texture.active]->top+1):1;
|
||||
break;
|
||||
case GL_MAX_LIST_NESTING:
|
||||
*params=64; // fake, no limit in fact
|
||||
break;
|
||||
case GL_ARRAY_BUFFER_BINDING:
|
||||
*params=(glstate->vao->vertex)?glstate->vao->vertex->buffer:0;
|
||||
break;
|
||||
case GL_ELEMENT_ARRAY_BUFFER_BINDING:
|
||||
*params=(glstate->vao->elements)?glstate->vao->elements->buffer:0;
|
||||
break;
|
||||
case GL_PIXEL_PACK_BUFFER_BINDING:
|
||||
*params=(glstate->vao->pack)?glstate->vao->pack->buffer:0;
|
||||
break;
|
||||
case GL_PIXEL_UNPACK_BUFFER_BINDING:
|
||||
*params=(glstate->vao->unpack)?glstate->vao->unpack->buffer:0;
|
||||
break;
|
||||
case GL_TRANSPOSE_PROJECTION_MATRIX:
|
||||
matrix_transpose(TOP(projection_matrix), params);
|
||||
break;
|
||||
case GL_TRANSPOSE_MODELVIEW_MATRIX:
|
||||
matrix_transpose(TOP(modelview_matrix), params);
|
||||
break;
|
||||
case GL_TRANSPOSE_TEXTURE_MATRIX:
|
||||
matrix_transpose(TOP(texture_matrix[glstate->texture.active]), params);
|
||||
break;
|
||||
case GL_MATRIX_MODE:
|
||||
*params=glstate->matrix_mode;
|
||||
break;
|
||||
case GL_PROJECTION_MATRIX:
|
||||
memcpy(params, TOP(projection_matrix), 16*sizeof(GLfloat));
|
||||
break;
|
||||
case GL_MODELVIEW_MATRIX:
|
||||
memcpy(params, TOP(modelview_matrix), 16*sizeof(GLfloat));
|
||||
break;
|
||||
case GL_TEXTURE_MATRIX:
|
||||
memcpy(params, TOP(texture_matrix[glstate->texture.active]), 16*sizeof(GLfloat));
|
||||
break;
|
||||
case GL_SHRINK_HINT_GL4ES:
|
||||
*params=globals4es.texshrink;
|
||||
break;
|
||||
case GL_ALPHAHACK_HINT_GL4ES:
|
||||
*params=globals4es.alphahack;
|
||||
break;
|
||||
case GL_RECYCLEFBO_HINT_GL4ES:
|
||||
*params=globals4es.recyclefbo;
|
||||
break;
|
||||
case GL_MIPMAP_HINT_GL4ES:
|
||||
*params=globals4es.automipmap;
|
||||
break;
|
||||
case GL_TEXDUMP_HINT_GL4ES:
|
||||
*params=globals4es.texdump;
|
||||
break;
|
||||
case GL_COPY_HINT_GL4ES:
|
||||
*params=globals4es.copytex;
|
||||
break;
|
||||
case GL_NOLUMAPHA_HINT_GL4ES:
|
||||
*params=globals4es.nolumalpha;
|
||||
break;
|
||||
case GL_BLENDHACK_HINT_GL4ES:
|
||||
*params=globals4es.blendhack;
|
||||
break;
|
||||
case GL_BATCH_HINT_GL4ES:
|
||||
*params=globals4es.batch;
|
||||
break;
|
||||
case GL_NOERROR_HINT_GL4ES:
|
||||
*params=globals4es.noerror;
|
||||
break;
|
||||
default:
|
||||
errorGL();
|
||||
gles_glGetFloatv(pname, params);
|
||||
}
|
||||
}
|
||||
void glGetFloatv(GLenum pname, GLfloat *params) AliasExport("gl4es_glGetFloatv");
|
||||
File diff suppressed because it is too large
Load Diff
@@ -365,65 +365,61 @@ static inline const GLboolean valid_vertex_type(GLenum type) {
|
||||
#include "array.h"
|
||||
#include "framebuffers.h"
|
||||
|
||||
const GLubyte *glshim_glGetString(GLenum name);
|
||||
void glshim_glGetIntegerv(GLenum pname, GLint *params);
|
||||
void glshim_glGetFloatv(GLenum pname, GLfloat *params);
|
||||
void glshim_glEnable(GLenum cap);
|
||||
void glshim_glDisable(GLenum cap);
|
||||
void glshim_glEnableClientState(GLenum cap);
|
||||
void glshim_glDisableClientState(GLenum cap);
|
||||
GLboolean glshim_glIsEnabled(GLenum cap);
|
||||
void glshim_glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
|
||||
void glshim_glDrawArrays(GLenum mode, GLint first, GLsizei count);
|
||||
void glshim_glInterleavedArrays(GLenum format, GLsizei stride, const GLvoid *pointer);
|
||||
void glshim_glBegin(GLenum mode);
|
||||
void glshim_glEnd();
|
||||
void glshim_glNormal3f(GLfloat nx, GLfloat ny, GLfloat nz);
|
||||
void glshim_glVertex4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
||||
void glshim_glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
|
||||
void glshim_glSecondaryColor3f(GLfloat r, GLfloat g, GLfloat b);
|
||||
void glshim_glMaterialfv(GLenum face, GLenum pname, const GLfloat *params);
|
||||
void glshim_glMaterialf(GLenum face, GLenum pname, const GLfloat param);
|
||||
void glshim_glTexCoord4f(GLfloat s, GLfloat t, GLfloat r, GLfloat q);
|
||||
void glshim_glMultiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
|
||||
void glshim_glArrayElement(GLint i);
|
||||
void glshim_glLockArrays(GLint first, GLsizei count);
|
||||
void glshim_glUnlockArrays();
|
||||
GLuint glshim_glGenLists(GLsizei range);
|
||||
void glshim_glNewList(GLuint list, GLenum mode);
|
||||
void glshim_glEndList();
|
||||
void glshim_glCallList(GLuint list);
|
||||
void glshim_glCallLists(GLsizei n, GLenum type, const GLvoid *lists);
|
||||
void glshim_glDeleteLists(GLuint list, GLsizei range);
|
||||
void glshim_glListBase(GLuint base);
|
||||
GLboolean glshim_glIsList(GLuint list);
|
||||
void glshim_glPolygonMode(GLenum face, GLenum mode);
|
||||
void glshim_glPushMatrix();
|
||||
void glshim_glPopMatrix();
|
||||
GLenum glshim_glGetError();
|
||||
const GLubyte *gl4es_glGetString(GLenum name);
|
||||
void gl4es_glGetIntegerv(GLenum pname, GLint *params);
|
||||
void gl4es_glGetFloatv(GLenum pname, GLfloat *params);
|
||||
void gl4es_glEnable(GLenum cap);
|
||||
void gl4es_glDisable(GLenum cap);
|
||||
void gl4es_glEnableClientState(GLenum cap);
|
||||
void gl4es_glDisableClientState(GLenum cap);
|
||||
GLboolean gl4es_glIsEnabled(GLenum cap);
|
||||
void gl4es_glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
|
||||
void gl4es_glDrawArrays(GLenum mode, GLint first, GLsizei count);
|
||||
void gl4es_glInterleavedArrays(GLenum format, GLsizei stride, const GLvoid *pointer);
|
||||
void gl4es_glBegin(GLenum mode);
|
||||
void gl4es_glEnd();
|
||||
void gl4es_glNormal3f(GLfloat nx, GLfloat ny, GLfloat nz);
|
||||
void gl4es_glVertex4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
||||
void gl4es_glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
|
||||
void gl4es_glSecondaryColor3f(GLfloat r, GLfloat g, GLfloat b);
|
||||
void gl4es_glMaterialfv(GLenum face, GLenum pname, const GLfloat *params);
|
||||
void gl4es_glMaterialf(GLenum face, GLenum pname, const GLfloat param);
|
||||
void gl4es_glTexCoord4f(GLfloat s, GLfloat t, GLfloat r, GLfloat q);
|
||||
void gl4es_glMultiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
|
||||
void gl4es_glArrayElement(GLint i);
|
||||
void gl4es_glLockArrays(GLint first, GLsizei count);
|
||||
void gl4es_glUnlockArrays();
|
||||
GLuint gl4es_glGenLists(GLsizei range);
|
||||
void gl4es_glNewList(GLuint list, GLenum mode);
|
||||
void gl4es_glEndList();
|
||||
void gl4es_glCallList(GLuint list);
|
||||
void gl4es_glCallLists(GLsizei n, GLenum type, const GLvoid *lists);
|
||||
void gl4es_glDeleteLists(GLuint list, GLsizei range);
|
||||
void gl4es_glListBase(GLuint base);
|
||||
GLboolean gl4es_glIsList(GLuint list);
|
||||
void gl4es_glPolygonMode(GLenum face, GLenum mode);
|
||||
GLenum gl4es_glGetError();
|
||||
|
||||
void glshim_glPointParameteri(GLenum pname, GLint param);
|
||||
void glshim_glPointParameteriv(GLenum pname, const GLint * params);
|
||||
void gl4es_glPointParameteri(GLenum pname, GLint param);
|
||||
void gl4es_glPointParameteriv(GLenum pname, const GLint * params);
|
||||
|
||||
|
||||
void glshim_glSecondaryColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
void glshim_glIndexPointer(GLenum type, GLsizei stride, const GLvoid * pointer);
|
||||
void glshim_glEdgeFlagPointer(GLsizei stride, const GLvoid * pointer);
|
||||
void glshim_glGetPointerv(GLenum pname, GLvoid* *params);
|
||||
void glshim_glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
|
||||
void glshim_glBlendFuncSeparate(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
|
||||
void glshim_glBlendEquationSeparate(GLenum modeRGB, GLenum modeA);
|
||||
void glshim_glBlendFunc(GLenum sfactor, GLenum dfactor);
|
||||
void glshim_glFlush();
|
||||
void glshim_glFinish();
|
||||
void glshim_glLoadMatrixf(const GLfloat * m);
|
||||
void glshim_glMultMatrixf(const GLfloat * m);
|
||||
void glshim_glFogfv(GLenum pname, const GLfloat* params);
|
||||
void gl4es_glSecondaryColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
void gl4es_glIndexPointer(GLenum type, GLsizei stride, const GLvoid * pointer);
|
||||
void gl4es_glEdgeFlagPointer(GLsizei stride, const GLvoid * pointer);
|
||||
void gl4es_glGetPointerv(GLenum pname, GLvoid* *params);
|
||||
void gl4es_glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
|
||||
void gl4es_glBlendFuncSeparate(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
|
||||
void gl4es_glBlendEquationSeparate(GLenum modeRGB, GLenum modeA);
|
||||
void gl4es_glBlendFunc(GLenum sfactor, GLenum dfactor);
|
||||
void gl4es_glFlush();
|
||||
void gl4es_glFinish();
|
||||
void gl4es_glFogfv(GLenum pname, const GLfloat* params);
|
||||
|
||||
void glshim_glStencilMaskSeparate(GLenum face, GLuint mask);
|
||||
void gl4es_glStencilMaskSeparate(GLenum face, GLuint mask);
|
||||
|
||||
void glshim_glMultiDrawArrays(GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
|
||||
void glshim_glMultiDrawElements( GLenum mode, GLsizei *count, GLenum type, const void * const *indices, GLsizei primcount);
|
||||
void gl4es_glMultiDrawArrays(GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
|
||||
void gl4es_glMultiDrawElements( GLenum mode, GLsizei *count, GLenum type, const void * const *indices, GLsizei primcount);
|
||||
|
||||
|
||||
void flush();
|
||||
@@ -432,12 +428,10 @@ void init_batch();
|
||||
#include "state.h"
|
||||
extern glstate_t *glstate;
|
||||
|
||||
GLuint gl_batch; // 0 = off, 1 = on
|
||||
|
||||
static inline void errorGL() { // next glGetError will be from GL
|
||||
glstate->shim_error = 0;
|
||||
}
|
||||
static inline void errorShim(GLenum error) { // next glGetError will be "error" from glShim
|
||||
static inline void errorShim(GLenum error) { // next glGetError will be "error" from gl4es
|
||||
glstate->shim_error = 1;
|
||||
glstate->last_error = error;
|
||||
}
|
||||
|
||||
77
project/jni/gl4es/src/gl/hint.c
Executable file
77
project/jni/gl4es/src/gl/hint.c
Executable file
@@ -0,0 +1,77 @@
|
||||
#include "hint.h"
|
||||
#include <gl4eshint.h>
|
||||
#include "init.h"
|
||||
|
||||
void gl4es_glHint(GLenum pname, GLenum mode) {
|
||||
if(glstate->gl_batch) flush();
|
||||
LOAD_GLES(glHint);
|
||||
noerrorShim();
|
||||
switch(pname) {
|
||||
case GL_SHRINK_HINT_GL4ES:
|
||||
if (mode<=10)
|
||||
globals4es.texshrink = mode;
|
||||
else
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
break;
|
||||
case GL_ALPHAHACK_HINT_GL4ES:
|
||||
if (mode<=1)
|
||||
globals4es.alphahack = mode;
|
||||
else
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
break;
|
||||
case GL_RECYCLEFBO_HINT_GL4ES:
|
||||
if (mode<=1)
|
||||
globals4es.recyclefbo = mode;
|
||||
else
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
break;
|
||||
case GL_MIPMAP_HINT_GL4ES:
|
||||
if (mode<=4)
|
||||
globals4es.automipmap = mode;
|
||||
else
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
break;
|
||||
case GL_TEXDUMP_HINT_GL4ES:
|
||||
if (mode<=1)
|
||||
globals4es.texdump = mode;
|
||||
else
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
break;
|
||||
case GL_COPY_HINT_GL4ES:
|
||||
if (mode<=1)
|
||||
globals4es.copytex = mode;
|
||||
else
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
break;
|
||||
case GL_NOLUMAPHA_HINT_GL4ES:
|
||||
if (mode<=1)
|
||||
globals4es.nolumalpha = mode;
|
||||
else
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
break;
|
||||
case GL_BLENDHACK_HINT_GL4ES:
|
||||
if (mode<=1)
|
||||
globals4es.blendhack = mode;
|
||||
else
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
break;
|
||||
case GL_BATCH_HINT_GL4ES:
|
||||
if (mode<=1) {
|
||||
globals4es.batch = 0; flush();
|
||||
globals4es.batch = mode;
|
||||
if (mode) init_batch();
|
||||
} else
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
break;
|
||||
case GL_NOERROR_HINT_GL4ES:
|
||||
if (mode<=1)
|
||||
globals4es.noerror = mode;
|
||||
else
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
break;
|
||||
default:
|
||||
errorGL();
|
||||
gles_glHint(pname, mode);
|
||||
}
|
||||
}
|
||||
void glHint(GLenum pname, GLenum mode) AliasExport("gl4es_glHint");
|
||||
3
project/jni/gl4es/src/gl/hint.h
Executable file
3
project/jni/gl4es/src/gl/hint.h
Executable file
@@ -0,0 +1,3 @@
|
||||
#include "gl.h"
|
||||
|
||||
void gl4es_glHint(GLenum pname, GLenum mode);
|
||||
256
project/jni/gl4es/src/gl/init.c
Executable file
256
project/jni/gl4es/src/gl/init.c
Executable file
@@ -0,0 +1,256 @@
|
||||
#include <unistd.h>
|
||||
#include "init.h"
|
||||
#include "gl.h"
|
||||
#include "debug.h"
|
||||
#include "../glx/hardext.h"
|
||||
#include "../../version.h"
|
||||
#include "../glx/streaming.h"
|
||||
#ifndef ANDROID
|
||||
#include <execinfo.h>
|
||||
#endif
|
||||
|
||||
void gl_init();
|
||||
|
||||
globals4es_t globals4es;
|
||||
|
||||
#define SHUT(a) if(!globals4es.nobanner) a
|
||||
|
||||
#ifdef PANDORA
|
||||
static void fast_math() {
|
||||
// enable Cortex A8 RunFast
|
||||
int v = 0;
|
||||
__asm__ __volatile__ (
|
||||
"vmrs %0, fpscr\n"
|
||||
"orr %0, #((1<<25)|(1<<24))\n" // default NaN, flush-to-zero
|
||||
"vmsr fpscr, %0\n"
|
||||
//"vmrs %0, fpscr\n"
|
||||
: "=&r"(v));
|
||||
}
|
||||
#endif
|
||||
|
||||
void load_libs();
|
||||
void glx_init();
|
||||
|
||||
__attribute__((constructor))
|
||||
void initialize_gl4es() {
|
||||
// default init of globals
|
||||
memset(&globals4es, 0, sizeof(globals4es));
|
||||
globals4es.mergelist = 1;
|
||||
globals4es.queries = 1;
|
||||
// overides by env. variables
|
||||
char *env_nobanner = getenv("LIBGL_NOBANNER");
|
||||
if (env_nobanner && strcmp(env_nobanner, "1") == 0)
|
||||
globals4es.nobanner = 1;
|
||||
|
||||
SHUT(LOGD("LIBGL: Initialising gl4es\n"));
|
||||
|
||||
char *env_batch = getenv("LIBGL_BATCH");
|
||||
if (env_batch && strcmp(env_batch, "1") == 0) {
|
||||
globals4es.batch = 1;
|
||||
SHUT(LOGD("LIBGL: Batch mode enabled\n"));
|
||||
}
|
||||
if (env_batch && strcmp(env_batch, "0") == 0) {
|
||||
globals4es.batch = 0;
|
||||
SHUT(LOGD("LIBGL: Batch mode disabled\n"));
|
||||
}
|
||||
if (env_batch && strcmp(env_batch, "2") == 0) {
|
||||
globals4es.batch = 0;
|
||||
globals4es.mergelist = 0;
|
||||
SHUT(LOGD("LIBGL: Batch mode disabled, merging of list disabled too\n"));
|
||||
}
|
||||
|
||||
SHUT(LOGD("LIBGL: v%d.%d.%d built on %s %s\n", MAJOR, MINOR, REVISION, __DATE__, __TIME__));
|
||||
#define env(name, global, message) \
|
||||
char *env_##name = getenv(#name); \
|
||||
if (env_##name && strcmp(env_##name, "1") == 0) { \
|
||||
SHUT(LOGD("LIBGL: " message "\n")); \
|
||||
global = true; \
|
||||
}
|
||||
|
||||
env(LIBGL_XREFRESH, globals4es.xrefresh, "xrefresh will be called on cleanup");
|
||||
env(LIBGL_STACKTRACE, globals4es.stacktrace, "stacktrace will be printed on crash");
|
||||
|
||||
char *env_fb = getenv("LIBGL_FB");
|
||||
if (env_fb && strcmp(env_fb, "1") == 0) {
|
||||
SHUT(LOGD("LIBGL: framebuffer output enabled\n"));
|
||||
globals4es.usefb = 1;
|
||||
}
|
||||
if (env_fb && strcmp(env_fb, "2") == 0) {
|
||||
SHUT(LOGD("LIBGL: using framebuffer + fbo\n"));
|
||||
globals4es.usefb = true;
|
||||
globals4es.usefbo = true;
|
||||
}
|
||||
#ifndef ANDROID
|
||||
if (env_fb && strcmp(env_fb, "3") == 0) {
|
||||
SHUT(LOGD("LIBGL: using pbuffer\n"));
|
||||
globals4es.usefb = 1;
|
||||
globals4es.usepbuffer = true;
|
||||
}
|
||||
#endif
|
||||
env(LIBGL_FPS, globals4es.showfps, "fps counter enabled");
|
||||
#ifdef USE_FBIO
|
||||
env(LIBGL_VSYNC, globals4es.vsync, "vsync enabled");
|
||||
#endif
|
||||
#ifdef PANDORA
|
||||
char *env_gamma = getenv("LIBGL_GAMMA");
|
||||
if (env_gamma) {
|
||||
globals4es.gamma=atof(env_gamma);
|
||||
SHUT(LOGD("LIBGL: Set gamma to %.2f\n", globals4es.gamma));
|
||||
}
|
||||
#endif
|
||||
|
||||
load_libs();
|
||||
gl_init();
|
||||
glx_init();
|
||||
|
||||
int gl4es_notest = 0;
|
||||
char *env_notest = getenv("LIBGL_NOTEST");
|
||||
if (env_notest && strcmp(env_notest, "1") == 0) {
|
||||
gl4es_notest = 1;
|
||||
}
|
||||
GetHardwareExtensions(gl4es_notest);
|
||||
|
||||
env(LIBGL_RECYCLEFBO, globals4es.recyclefbo, "Recycling of FBO enabled");
|
||||
// Texture hacks
|
||||
char *env_mipmap = getenv("LIBGL_MIPMAP");
|
||||
if (env_mipmap && strcmp(env_mipmap, "1") == 0) {
|
||||
globals4es.automipmap = 1;
|
||||
SHUT(LOGD("LIBGL: AutoMipMap forced\n"));
|
||||
}
|
||||
if (env_mipmap && strcmp(env_mipmap, "2") == 0) {
|
||||
globals4es.automipmap = 2;
|
||||
SHUT(LOGD("LIBGL: guess AutoMipMap\n"));
|
||||
}
|
||||
if (env_mipmap && strcmp(env_mipmap, "3") == 0) {
|
||||
globals4es.automipmap = 3;
|
||||
SHUT(LOGD("LIBGL: ignore MipMap\n"));
|
||||
}
|
||||
if (env_mipmap && strcmp(env_mipmap, "4") == 0) {
|
||||
globals4es.automipmap = 4;
|
||||
SHUT(LOGD("LIBGL: ignore AutoMipMap on non-squared textures\n"));
|
||||
}
|
||||
char *env_texcopy = getenv("LIBGL_TEXCOPY");
|
||||
if (env_texcopy && strcmp(env_texcopy, "1") == 0) {
|
||||
globals4es.texcopydata = 1;
|
||||
SHUT(LOGD("LIBGL: Texture copy enabled\n"));
|
||||
}
|
||||
char *env_shrink = getenv("LIBGL_SHRINK");
|
||||
if (env_shrink && strcmp(env_shrink, "1") == 0) {
|
||||
globals4es.texshrink = 1;
|
||||
SHUT(LOGD("LIBGL: Texture shink, mode 1 selected (everything / 2)\n"));
|
||||
}
|
||||
if (env_shrink && strcmp(env_shrink, "2") == 0) {
|
||||
globals4es.texshrink = 2;
|
||||
SHUT(LOGD("LIBGL: Texture shink, mode 2 selected (only > 512 /2 )\n"));
|
||||
}
|
||||
if (env_shrink && strcmp(env_shrink, "3") == 0) {
|
||||
globals4es.texshrink = 3;
|
||||
SHUT(LOGD("LIBGL: Texture shink, mode 3 selected (only > 256 /2 )\n"));
|
||||
}
|
||||
if (env_shrink && strcmp(env_shrink, "4") == 0) {
|
||||
globals4es.texshrink = 4;
|
||||
SHUT(LOGD("LIBGL: Texture shink, mode 4 selected (only > 256 /2, >=1024 /4 )\n"));
|
||||
}
|
||||
if (env_shrink && strcmp(env_shrink, "5") == 0) {
|
||||
globals4es.texshrink = 5;
|
||||
SHUT(LOGD("LIBGL: Texture shink, mode 5 selected (every > 256 is downscaled to 256 ), but not for empty texture\n"));
|
||||
}
|
||||
if (env_shrink && strcmp(env_shrink, "6") == 0) {
|
||||
globals4es.texshrink = 6;
|
||||
SHUT(LOGD("LIBGL: Texture shink, mode 6 selected (only > 128 /2, >=512 is downscaled to 256 ), but not for empty texture\n"));
|
||||
}
|
||||
if (env_shrink && strcmp(env_shrink, "7") == 0) {
|
||||
globals4es.texshrink = 7;
|
||||
SHUT(LOGD("LIBGL: Texture shink, mode 7 selected (only > 512 /2 ), but not for empty texture\n"));
|
||||
}
|
||||
if (env_shrink && strcmp(env_shrink, "8") == 0) {
|
||||
globals4es.texshrink = 8;
|
||||
SHUT(LOGD("LIBGL: Texture shink, mode 8 selected (advertise 8192 max texture size, but >2048 are shrinked to 2048)\n"));
|
||||
}
|
||||
if (env_shrink && strcmp(env_shrink, "9") == 0) {
|
||||
globals4es.texshrink = 9;
|
||||
SHUT(LOGD("LIBGL: Texture shink, mode 9 selected (advertise 8192 max texture size, but >4096 are quadshrinked and > 512 are shrinked), but not for empty texture\n"));
|
||||
}
|
||||
if (env_shrink && strcmp(env_shrink, "10") == 0) {
|
||||
globals4es.texshrink = 10;
|
||||
SHUT(LOGD("LIBGL: Texture shink, mode 10 selected (advertise 8192 max texture size, but >2048 are quadshrinked and > 512 are shrinked), but not for empty texture\n"));
|
||||
}
|
||||
char *env_dump = getenv("LIBGL_TEXDUMP");
|
||||
if (env_dump && strcmp(env_dump, "1") == 0) {
|
||||
globals4es.texdump = 1;
|
||||
SHUT(LOGD("LIBGL: Texture dump enabled\n"));
|
||||
}
|
||||
char *env_alpha = getenv("LIBGL_ALPHAHACK");
|
||||
if (env_alpha && strcmp(env_alpha, "1") == 0) {
|
||||
globals4es.alphahack = 1;
|
||||
SHUT(LOGD("LIBGL: Alpha Hack enabled\n"));
|
||||
}
|
||||
#ifdef TEXSTREAM
|
||||
char *env_stream = getenv("LIBGL_STREAM");
|
||||
if (env_stream && strcmp(env_stream, "1") == 0) {
|
||||
globals4es.texstream = InitStreamingCache();
|
||||
SHUT(LOGD("LIBGL: Streaming texture %s\n",(globals4es.texstream)?"enabled":"not available"));
|
||||
//FreeStreamed(AddStreamed(1024, 512, 0));
|
||||
}
|
||||
if (env_stream && strcmp(env_stream, "2") == 0) {
|
||||
globals4es.texstream = InitStreamingCache()?2:0;
|
||||
SHUT(LOGD("LIBGL: Streaming texture %s\n",(globals4es.texstream)?"forced":"not available"));
|
||||
//FreeStreamed(AddStreamed(1024, 512, 0));
|
||||
}
|
||||
#endif
|
||||
char *env_copy = getenv("LIBGL_COPY");
|
||||
if (env_copy && strcmp(env_copy, "1") == 0) {
|
||||
SHUT(LOGD("LIBGL: No glCopyTexImage2D / glCopyTexSubImage2D hack\n"));
|
||||
globals4es.copytex = 1;
|
||||
}
|
||||
char *env_lumalpha = getenv("LIBGL_NOLUMALPHA");
|
||||
if (env_lumalpha && strcmp(env_lumalpha, "1") == 0) {
|
||||
globals4es.nolumalpha = 1;
|
||||
SHUT(LOGD("LIBGL: GL_LUMINANCE_ALPHA hardware support disabled\n"));
|
||||
}
|
||||
|
||||
env(LIBGL_BLENDHACK, globals4es.blendhack, "Change Blend GL_SRC_ALPHA, GL_ONE to GL_ONE, GL_ONE");
|
||||
env(LIBGL_BLENDCOLOR, globals4es.blendcolor, "Export a (faked) glBlendColor");
|
||||
env(LIBGL_NOERROR, globals4es.noerror, "glGetError() always return GL_NOERROR");
|
||||
env(LIBGL_SILENTSTUB, globals4es.silentstub, "Stub/non present functions are not printed");
|
||||
|
||||
char *env_version = getenv("LIBGL_VERSION");
|
||||
if (env_version) {
|
||||
SHUT(LOGD("LIBGL: Overide version string with \"%s\" (should be in the form of \"1.x\")\n", env_version));
|
||||
}
|
||||
snprintf(globals4es.version, 49, "%s gl4es wrapper", (env_version)?env_version:"1.5");
|
||||
|
||||
char *env_srgb = getenv("LIBGL_SRGB");
|
||||
if (env_srgb && strcmp(env_srgb, "1") == 0 && hardext.srgb) {
|
||||
globals4es.glx_surface_srgb = 2;
|
||||
SHUT(LOGD("LIBGL: enabling sRGB support\n"));
|
||||
}
|
||||
char *env_fastmath = getenv("LIBGL_FASTMATH");
|
||||
if (env_fastmath && strcmp(env_fastmath, "1") == 0) {
|
||||
#ifdef PANDORA
|
||||
SHUT(LOGD("LIBGL: Enable FastMath for cortex-a8\n"));
|
||||
fast_math();
|
||||
#else
|
||||
SHUT(LOGD("LIBGL: No FastMath on this platform\n"));
|
||||
#endif
|
||||
}
|
||||
char *env_npot = getenv("LIBGL_NPOT");
|
||||
globals4es.npot = hardext.npot;
|
||||
if (env_npot && strcmp(env_npot, "1") == 0 && globals4es.npot<1) {
|
||||
globals4es.npot = 1;
|
||||
SHUT(LOGD("LIBGL: Expose limited NPOT extension\n"));
|
||||
}
|
||||
if (env_npot && strcmp(env_npot, "2") == 0 && globals4es.npot<2) {
|
||||
globals4es.npot = 2;
|
||||
SHUT(LOGD("LIBGL: Expose GL_ARB_texture_non_power_of_two extension\n"));
|
||||
}
|
||||
char *env_queries = getenv("LIBGL_GLQUERIES");
|
||||
if (env_queries && strcmp(env_queries, "0") == 0) {
|
||||
globals4es.queries = 0;
|
||||
SHUT(LOGD("LIBGL: Dont't expose fake glQueries functions\n"));
|
||||
}
|
||||
|
||||
char cwd[1024];
|
||||
if (getcwd(cwd, sizeof(cwd))!= NULL)
|
||||
SHUT(LOGD("LIBGL: Current folder is:%s\n", cwd));
|
||||
}
|
||||
44
project/jni/gl4es/src/gl/init.h
Executable file
44
project/jni/gl4es/src/gl/init.h
Executable file
@@ -0,0 +1,44 @@
|
||||
#ifndef _GL4ES_INIT_H_
|
||||
#define _GL4ES_INIT_H_
|
||||
|
||||
#if defined(PANDORA) || defined(ODROID)
|
||||
#define USE_FBIO 1
|
||||
#endif
|
||||
|
||||
typedef struct _globals4es {
|
||||
int nobanner;
|
||||
int batch;
|
||||
int mergelist;
|
||||
int xrefresh;
|
||||
int stacktrace;
|
||||
int usefb;
|
||||
int usefbo;
|
||||
int recyclefbo;
|
||||
int usepbuffer;
|
||||
int showfps;
|
||||
int vsync;
|
||||
int automipmap;
|
||||
int texcopydata;
|
||||
int tested_env;
|
||||
int texshrink;
|
||||
int texdump;
|
||||
int alphahack;
|
||||
int texstream;
|
||||
int copytex;
|
||||
int nolumalpha;
|
||||
int blendhack;
|
||||
int blendcolor;
|
||||
int noerror;
|
||||
int npot;
|
||||
int queries;
|
||||
int silentstub;
|
||||
int glx_surface_srgb;
|
||||
#ifdef PANDORA
|
||||
float gamma;
|
||||
#endif
|
||||
char version[50];
|
||||
} globals4es_t;
|
||||
|
||||
extern globals4es_t globals4es;
|
||||
|
||||
#endif
|
||||
@@ -1,12 +1,12 @@
|
||||
#include "light.h"
|
||||
|
||||
#ifndef USE_ES2
|
||||
void glshim_glLightModelf(GLenum pname, GLfloat param) {
|
||||
void gl4es_glLightModelf(GLenum pname, GLfloat param) {
|
||||
//printf("%sglLightModelf(%04X, %.2f)\n", (state.list.compiling)?"list":"", pname, param);
|
||||
if (glstate->list.compiling && glstate->list.active) {
|
||||
GLfloat dummy[4];
|
||||
dummy[0]=param;
|
||||
glshim_glLightModelfv(pname, dummy);
|
||||
gl4es_glLightModelfv(pname, dummy);
|
||||
return;
|
||||
}
|
||||
LOAD_GLES(glLightModelf);
|
||||
@@ -23,7 +23,7 @@ void glshim_glLightModelf(GLenum pname, GLfloat param) {
|
||||
}
|
||||
}
|
||||
|
||||
void glshim_glLightModelfv(GLenum pname, const GLfloat* params) {
|
||||
void gl4es_glLightModelfv(GLenum pname, const GLfloat* params) {
|
||||
//printf("%sglLightModelfv(%04X, [%.2f, %.2f, %.2f, %.2f])\n", (state.list.compiling)?"list":"", pname, params[0], params[1], params[2], params[3]);
|
||||
if (glstate->list.compiling && glstate->list.active) {
|
||||
NewStage(glstate->list.active, STAGE_LIGHTMODEL);
|
||||
@@ -49,7 +49,7 @@ void glshim_glLightModelfv(GLenum pname, const GLfloat* params) {
|
||||
}
|
||||
}
|
||||
|
||||
void glshim_glLightfv(GLenum light, GLenum pname, const GLfloat* params) {
|
||||
void gl4es_glLightfv(GLenum light, GLenum pname, const GLfloat* params) {
|
||||
//printf("%sglLightfv(%04X, %04X, %p=[%.2f, %.2f, %.2f, %.2f])\n", (glstate->list.compiling)?"list":"", light, pname, params, (params)?params[0]:0.0f, (params)?params[1]:0.0f, (params)?params[2]:0.0f, (params)?params[3]:0.0f);
|
||||
if (glstate->list.compiling && glstate->list.active) {
|
||||
NewStage(glstate->list.active, STAGE_LIGHT);
|
||||
@@ -62,15 +62,15 @@ void glshim_glLightfv(GLenum light, GLenum pname, const GLfloat* params) {
|
||||
errorGL();
|
||||
}
|
||||
|
||||
void glshim_glLightf(GLenum light, GLenum pname, const GLfloat params) {
|
||||
void gl4es_glLightf(GLenum light, GLenum pname, const GLfloat params) {
|
||||
GLfloat dummy[4];
|
||||
dummy[0]=params;
|
||||
glshim_glLightfv(light, pname, dummy);
|
||||
gl4es_glLightfv(light, pname, dummy);
|
||||
errorGL();
|
||||
}
|
||||
|
||||
void glLightModelf(GLenum pname, GLfloat param) AliasExport("glshim_glLightModelf");
|
||||
void glLightModelfv(GLenum pname, const GLfloat* params) AliasExport("glshim_glLightModelfv");
|
||||
void glLightfv(GLenum light, GLenum pname, const GLfloat* params) AliasExport("glshim_glLightfv");
|
||||
void glLightf(GLenum light, GLenum pname, const GLfloat params) AliasExport("glshim_glLightf");
|
||||
void glLightModelf(GLenum pname, GLfloat param) AliasExport("gl4es_glLightModelf");
|
||||
void glLightModelfv(GLenum pname, const GLfloat* params) AliasExport("gl4es_glLightModelfv");
|
||||
void glLightfv(GLenum light, GLenum pname, const GLfloat* params) AliasExport("gl4es_glLightfv");
|
||||
void glLightf(GLenum light, GLenum pname, const GLfloat params) AliasExport("gl4es_glLightf");
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "gl.h"
|
||||
|
||||
void glshim_glLightModelf(GLenum pname, GLfloat param);
|
||||
void glshim_glLightModelfv(GLenum pname, const GLfloat* params);
|
||||
void glshim_glLightfv(GLenum light, GLenum pname, const GLfloat* params);
|
||||
void glshim_glLightf(GLenum light, GLenum pname, const GLfloat params);
|
||||
void gl4es_glLightModelf(GLenum pname, GLfloat param);
|
||||
void gl4es_glLightModelfv(GLenum pname, const GLfloat* params);
|
||||
void gl4es_glLightfv(GLenum light, GLenum pname, const GLfloat* params);
|
||||
void gl4es_glLightf(GLenum light, GLenum pname, const GLfloat params);
|
||||
|
||||
@@ -5,7 +5,7 @@ GLushort stipplePattern = 0xFFFF;
|
||||
GLubyte *stippleData = NULL;
|
||||
GLuint stippleTexture = 0;
|
||||
|
||||
void glshim_glLineStipple(GLuint factor, GLushort pattern) {
|
||||
void gl4es_glLineStipple(GLuint factor, GLushort pattern) {
|
||||
stippleFactor = factor;
|
||||
stipplePattern = pattern;
|
||||
if (stippleData != NULL) {
|
||||
@@ -16,24 +16,24 @@ void glshim_glLineStipple(GLuint factor, GLushort pattern) {
|
||||
stippleData[i] = (stipplePattern >> i) & 1 ? 255 : 0;
|
||||
}
|
||||
|
||||
glshim_glPushAttrib(GL_TEXTURE_BIT);
|
||||
gl4es_glPushAttrib(GL_TEXTURE_BIT);
|
||||
if (! stippleTexture)
|
||||
glshim_glGenTextures(1, &stippleTexture);
|
||||
gl4es_glGenTextures(1, &stippleTexture);
|
||||
|
||||
glshim_glBindTexture(GL_TEXTURE_2D, stippleTexture);
|
||||
glshim_glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
glshim_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glshim_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
gl4es_glBindTexture(GL_TEXTURE_2D, stippleTexture);
|
||||
gl4es_glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
gl4es_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
gl4es_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
|
||||
glshim_glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA,
|
||||
gl4es_glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA,
|
||||
16, 1, 0, GL_ALPHA, GL_UNSIGNED_BYTE, stippleData);
|
||||
glshim_glPopAttrib();
|
||||
gl4es_glPopAttrib();
|
||||
noerrorShim();
|
||||
}
|
||||
void glLineStipple(GLuint factor, GLushort pattern) AliasExport("glshim_glLineStipple");
|
||||
void glLineStipple(GLuint factor, GLushort pattern) AliasExport("gl4es_glLineStipple");
|
||||
|
||||
void bind_stipple_tex() {
|
||||
glshim_glBindTexture(GL_TEXTURE_2D, stippleTexture);
|
||||
gl4es_glBindTexture(GL_TEXTURE_2D, stippleTexture);
|
||||
}
|
||||
|
||||
GLfloat *gen_stipple_tex_coords(GLfloat *vert, int length) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "gl.h"
|
||||
|
||||
void glshim_glLineStipple(GLuint factor, GLushort pattern);
|
||||
void gl4es_glLineStipple(GLuint factor, GLushort pattern);
|
||||
GLfloat *gen_stipple_tex_coords(GLfloat *vert, int length);
|
||||
void bind_stipple_tex();
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "list.h"
|
||||
#include "debug.h"
|
||||
#include "../glx/hardext.h"
|
||||
#include "init.h"
|
||||
|
||||
#define alloc_sublist(n, cap) \
|
||||
(GLfloat *)malloc(n * sizeof(GLfloat) * cap)
|
||||
@@ -82,10 +83,8 @@ int rendermode_dimensions(GLenum mode) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern GLuint gl_mergelist;
|
||||
|
||||
bool islistscompatible_renderlist(renderlist_t *a, renderlist_t *b) {
|
||||
if (!gl_mergelist || !a)
|
||||
if (!globals4es.mergelist || !a)
|
||||
return false;
|
||||
|
||||
// check if 2 "pure rendering" list are compatible for merge
|
||||
@@ -526,11 +525,11 @@ renderlist_t* append_calllist(renderlist_t *list, renderlist_t *a)
|
||||
if(glstate->gl_batch) {
|
||||
for (int i = 0; i < list->calls.len; i++) {
|
||||
packed_call_t *p = list->calls.calls[i];
|
||||
if(p->func == &glshim_glEnable) {
|
||||
if(p->func == &gl4es_glEnable) {
|
||||
int wich_cap = Cap2BatchState(((glEnable_PACKED*)p)->args.a1);
|
||||
if(wich_cap!=ENABLED_LAST) glstate->statebatch.enabled[wich_cap] = 1;
|
||||
}
|
||||
if(p->func == &glshim_glDisable) {
|
||||
if(p->func == &gl4es_glDisable) {
|
||||
int wich_cap = Cap2BatchState(((glDisable_PACKED*)p)->args.a1);
|
||||
if(wich_cap!=ENABLED_LAST) glstate->statebatch.enabled[wich_cap] = 0;
|
||||
}
|
||||
@@ -651,7 +650,7 @@ void free_renderlist(renderlist_t *list) {
|
||||
|
||||
if (list->raster && !(*(list->raster->shared)--)) {
|
||||
if (list->raster->texture)
|
||||
glshim_glDeleteTextures(1, &list->raster->texture);
|
||||
gl4es_glDeleteTextures(1, &list->raster->texture);
|
||||
free(list->raster);
|
||||
}
|
||||
|
||||
@@ -682,7 +681,7 @@ void adjust_renderlist(renderlist_t *list) {
|
||||
gltexture_t *bound = glstate->texture.bound[a];
|
||||
// in case of Texture bounding inside a list
|
||||
if (list->set_texture && (list->tmu == a))
|
||||
bound = glshim_getTexture(list->target_texture, list->texture);
|
||||
bound = gl4es_getTexture(list->target_texture, list->texture);
|
||||
// adjust the tex_coord now
|
||||
if ((list->tex[a]) && (bound) && ((bound->width != bound->nwidth) || (bound->height != bound->nheight))) {
|
||||
tex_coord_npot(list->tex[a], list->len, bound->width, bound->height, bound->nwidth, bound->nheight);
|
||||
@@ -746,7 +745,7 @@ void draw_renderlist(renderlist_t *list) {
|
||||
LOAD_GLES(glDisable);
|
||||
LOAD_GLES(glEnableClientState);
|
||||
LOAD_GLES(glDisableClientState);
|
||||
glshim_glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT);
|
||||
gl4es_glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT);
|
||||
|
||||
GLfloat *final_colors;
|
||||
int old_tex;
|
||||
@@ -757,9 +756,9 @@ void draw_renderlist(renderlist_t *list) {
|
||||
list = end_renderlist(list);
|
||||
// push/pop attributes
|
||||
if (list->pushattribute)
|
||||
glshim_glPushAttrib(list->pushattribute);
|
||||
gl4es_glPushAttrib(list->pushattribute);
|
||||
if (list->popattribute)
|
||||
glshim_glPopAttrib();
|
||||
gl4es_glPopAttrib();
|
||||
call_list_t *cl = &list->calls;
|
||||
if (cl->len > 0) {
|
||||
for (int i = 0; i < cl->len; i++) {
|
||||
@@ -769,37 +768,37 @@ void draw_renderlist(renderlist_t *list) {
|
||||
if (list->fog_op) {
|
||||
switch (list->fog_op) {
|
||||
case 1: // GL_FOG_COLOR
|
||||
glshim_glFogfv(GL_FOG_COLOR, list->fog_val);
|
||||
gl4es_glFogfv(GL_FOG_COLOR, list->fog_val);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (list->matrix_op) {
|
||||
switch (list->matrix_op) {
|
||||
case 1: // load
|
||||
glshim_glLoadMatrixf(list->matrix_val);
|
||||
gl4es_glLoadMatrixf(list->matrix_val);
|
||||
break;
|
||||
case 2: // mult
|
||||
glshim_glMultMatrixf(list->matrix_val);
|
||||
gl4es_glMultMatrixf(list->matrix_val);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (list->set_tmu) {
|
||||
glshim_glActiveTexture(GL_TEXTURE0+list->tmu);
|
||||
gl4es_glActiveTexture(GL_TEXTURE0+list->tmu);
|
||||
}
|
||||
if (list->set_texture) {
|
||||
glshim_glBindTexture(list->target_texture, list->texture);
|
||||
gl4es_glBindTexture(list->target_texture, list->texture);
|
||||
}
|
||||
// raster
|
||||
old_tex = glstate->texture.active;
|
||||
if (list->raster_op) {
|
||||
if (list->raster_op==1) {
|
||||
glshim_glRasterPos3f(list->raster_xyz[0], list->raster_xyz[1], list->raster_xyz[2]);
|
||||
gl4es_glRasterPos3f(list->raster_xyz[0], list->raster_xyz[1], list->raster_xyz[2]);
|
||||
} else if (list->raster_op==2) {
|
||||
glshim_glWindowPos3f(list->raster_xyz[0], list->raster_xyz[1], list->raster_xyz[2]);
|
||||
gl4es_glWindowPos3f(list->raster_xyz[0], list->raster_xyz[1], list->raster_xyz[2]);
|
||||
} else if (list->raster_op==3) {
|
||||
glshim_glPixelZoom(list->raster_xyz[0], list->raster_xyz[1]);
|
||||
gl4es_glPixelZoom(list->raster_xyz[0], list->raster_xyz[1]);
|
||||
} else if ((list->raster_op&0x10000) == 0x10000) {
|
||||
glshim_glPixelTransferf(list->raster_op&0xFFFF, list->raster_xyz[0]);
|
||||
gl4es_glPixelTransferf(list->raster_op&0xFFFF, list->raster_xyz[0]);
|
||||
}
|
||||
}
|
||||
if (list->raster) {
|
||||
@@ -815,10 +814,10 @@ void draw_renderlist(renderlist_t *list) {
|
||||
kh_foreach_value(map, m,
|
||||
switch (m->pname) {
|
||||
case GL_SHININESS:
|
||||
glshim_glMaterialf(GL_FRONT_AND_BACK, m->pname, m->color[0]);
|
||||
gl4es_glMaterialf(GL_FRONT_AND_BACK, m->pname, m->color[0]);
|
||||
break;
|
||||
default:
|
||||
glshim_glMaterialfv(GL_FRONT_AND_BACK, m->pname, m->color);
|
||||
gl4es_glMaterialfv(GL_FRONT_AND_BACK, m->pname, m->color);
|
||||
}
|
||||
)
|
||||
}
|
||||
@@ -828,19 +827,19 @@ void draw_renderlist(renderlist_t *list) {
|
||||
kh_foreach_value(lig, m,
|
||||
switch (m->pname) {
|
||||
default:
|
||||
glshim_glLightfv(m->which, m->pname, m->color);
|
||||
gl4es_glLightfv(m->which, m->pname, m->color);
|
||||
}
|
||||
)
|
||||
}
|
||||
if (list->lightmodel) {
|
||||
glshim_glLightModelfv(list->lightmodelparam, list->lightmodel);
|
||||
gl4es_glLightModelfv(list->lightmodelparam, list->lightmodel);
|
||||
}
|
||||
|
||||
if (list->texenv) {
|
||||
khash_t(texenv) *tgn = list->texenv;
|
||||
rendertexenv_t *m;
|
||||
kh_foreach_value(tgn, m,
|
||||
glshim_glTexEnvfv(m->target, m->pname, m->params);
|
||||
gl4es_glTexEnvfv(m->target, m->pname, m->params);
|
||||
)
|
||||
}
|
||||
|
||||
@@ -848,18 +847,18 @@ void draw_renderlist(renderlist_t *list) {
|
||||
khash_t(texgen) *tgn = list->texgen;
|
||||
rendertexgen_t *m;
|
||||
kh_foreach_value(tgn, m,
|
||||
glshim_glTexGenfv(m->coord, m->pname, m->color);
|
||||
gl4es_glTexGenfv(m->coord, m->pname, m->color);
|
||||
)
|
||||
}
|
||||
|
||||
if (list->polygon_mode) {
|
||||
glshim_glPolygonMode(GL_FRONT_AND_BACK, list->polygon_mode);}
|
||||
gl4es_glPolygonMode(GL_FRONT_AND_BACK, list->polygon_mode);}
|
||||
|
||||
if (! list->len)
|
||||
continue;
|
||||
#ifdef USE_ES2
|
||||
if (list->vert) {
|
||||
glshim_glEnableVertexAttribArray(0);
|
||||
gl4es_glEnableVertexAttribArray(0);
|
||||
gles_glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 0, list->vert);
|
||||
}
|
||||
gles_glDrawArrays(list->mode, 0, list->len);
|
||||
@@ -916,10 +915,10 @@ void draw_renderlist(renderlist_t *list) {
|
||||
// TODO: do we need to support GL_LINE_STRIP?
|
||||
if (list->mode == GL_LINES && glstate->enable.line_stipple) {
|
||||
stipple = true;
|
||||
glshim_glPushAttrib(GL_COLOR_BUFFER_BIT | GL_ENABLE_BIT | GL_TEXTURE_BIT);
|
||||
glshim_glEnable(GL_BLEND);
|
||||
glshim_glEnable(GL_TEXTURE_2D);
|
||||
glshim_glBlendFunc(GL_SRC_ALPHA, GL_ONE);
|
||||
gl4es_glPushAttrib(GL_COLOR_BUFFER_BIT | GL_ENABLE_BIT | GL_TEXTURE_BIT);
|
||||
gl4es_glEnable(GL_BLEND);
|
||||
gl4es_glEnable(GL_TEXTURE_2D);
|
||||
gl4es_glBlendFunc(GL_SRC_ALPHA, GL_ONE);
|
||||
list->tex[0] = gen_stipple_tex_coords(list->vert, list->len);
|
||||
}
|
||||
}
|
||||
@@ -936,7 +935,7 @@ void draw_renderlist(renderlist_t *list) {
|
||||
}
|
||||
old_tex = glstate->texture.client;
|
||||
GLuint cur_tex = old_tex;
|
||||
#define TEXTURE(A) if (cur_tex!=A) {glshim_glClientActiveTexture(A+GL_TEXTURE0); cur_tex=A;}
|
||||
#define TEXTURE(A) if (cur_tex!=A) {gl4es_glClientActiveTexture(A+GL_TEXTURE0); cur_tex=A;}
|
||||
for (int a=0; a<hardext.maxtex; a++) {
|
||||
if ((list->tex[a] || texgened[a])/* && glstate->enable.texture_2d[a]*/) {
|
||||
TEXTURE(a);
|
||||
@@ -1153,7 +1152,7 @@ void draw_renderlist(renderlist_t *list) {
|
||||
}
|
||||
}
|
||||
}
|
||||
#define TEXTURE(A) if (cur_tex!=A) {glshim_glClientActiveTexture(A+GL_TEXTURE0); cur_tex=A;}
|
||||
#define TEXTURE(A) if (cur_tex!=A) {gl4es_glClientActiveTexture(A+GL_TEXTURE0); cur_tex=A;}
|
||||
for (int a=0; a<hardext.maxtex; a++) {
|
||||
if (needclean[a]) {
|
||||
TEXTURE(a);
|
||||
@@ -1175,11 +1174,11 @@ void draw_renderlist(renderlist_t *list) {
|
||||
if (final_colors)
|
||||
free(final_colors);
|
||||
if (stipple) {
|
||||
glshim_glPopAttrib();
|
||||
gl4es_glPopAttrib();
|
||||
}
|
||||
#endif
|
||||
} while ((list = list->next));
|
||||
glshim_glPopClientAttrib();
|
||||
gl4es_glPopClientAttrib();
|
||||
}
|
||||
|
||||
// gl function wrappers
|
||||
|
||||
@@ -11,11 +11,10 @@
|
||||
// will become references to dlopen'd gles and egl
|
||||
extern void *gles, *egl, *bcm_host, *vcos;
|
||||
|
||||
extern void *open_lib(const char **names, const char *override);
|
||||
extern void load_libs();
|
||||
void *open_lib(const char **names, const char *override);
|
||||
|
||||
#ifndef WARN_NULL
|
||||
#define WARN_NULL(name) if (name == NULL) LOGD("libGL: warning, " #name " is NULL\n");
|
||||
#define WARN_NULL(name) if (name == NULL) LOGD("LIBGL: warning, " #name " is NULL\n");
|
||||
#endif
|
||||
|
||||
#ifndef LOAD_RAW
|
||||
@@ -25,9 +24,6 @@ extern void load_libs();
|
||||
static bool first = true; \
|
||||
if (first) { \
|
||||
first = false; \
|
||||
if (lib == NULL) { \
|
||||
load_libs(); \
|
||||
} \
|
||||
if (lib != NULL) { \
|
||||
lib##_##name = (name##_PTR)__VA_ARGS__; \
|
||||
} \
|
||||
|
||||
260
project/jni/gl4es/src/gl/matrix.c
Executable file
260
project/jni/gl4es/src/gl/matrix.c
Executable file
@@ -0,0 +1,260 @@
|
||||
#include "matrix.h"
|
||||
#include "gl.h"
|
||||
#include "debug.h"
|
||||
|
||||
//#define DEBUG
|
||||
#ifdef DEBUG
|
||||
#define DBG(a) a
|
||||
#else
|
||||
#define DBG(a)
|
||||
#endif
|
||||
|
||||
void alloc_matrix(matrixstack_t **matrixstack, int depth) {
|
||||
*matrixstack = (matrixstack_t*)malloc(sizeof(matrixstack_t));
|
||||
(*matrixstack)->top = 0;
|
||||
(*matrixstack)->stack = (GLfloat*)malloc(sizeof(GLfloat)*depth*16);
|
||||
}
|
||||
|
||||
void set_identity(GLfloat* mat) {
|
||||
memset(mat, 0, 16*sizeof(GLfloat));
|
||||
mat[0] = mat[1+4] = mat[2+8] = mat[3+12] = 1.0f;
|
||||
}
|
||||
|
||||
#define TOP(A) (glstate->A->stack+(glstate->A->top*16))
|
||||
|
||||
static GLfloat* update_current_mat() {
|
||||
switch(glstate->matrix_mode) {
|
||||
case GL_MODELVIEW:
|
||||
return TOP(modelview_matrix);
|
||||
case GL_PROJECTION:
|
||||
return TOP(projection_matrix);
|
||||
case GL_TEXTURE:
|
||||
return TOP(texture_matrix[glstate->texture.active]);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void init_matrix(glstate_t* glstate) {
|
||||
alloc_matrix(&glstate->projection_matrix, MAX_STACK_PROJECTION);
|
||||
set_identity(TOP(projection_matrix));
|
||||
alloc_matrix(&glstate->modelview_matrix, MAX_STACK_MODELVIEW);
|
||||
set_identity(TOP(modelview_matrix));
|
||||
glstate->texture_matrix = (matrixstack_t**)malloc(sizeof(matrixstack_t*)*MAX_TEX);
|
||||
for (int i=0; i<MAX_TEX; i++) {
|
||||
alloc_matrix(&glstate->texture_matrix[i], MAX_STACK_TEXTURE);
|
||||
set_identity(TOP(texture_matrix[i]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void gl4es_glMatrixMode(GLenum mode) {
|
||||
DBG(printf("glMatrixMode(%s), list=%p\n", PrintEnum(mode), glstate->list.active);)
|
||||
PUSH_IF_COMPILING(glMatrixMode);
|
||||
LOAD_GLES(glMatrixMode);
|
||||
|
||||
if(!(mode==GL_MODELVIEW || mode==GL_PROJECTION || mode==GL_TEXTURE)) {
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
return;
|
||||
}
|
||||
if(glstate->matrix_mode != mode) {
|
||||
glstate->matrix_mode = mode;
|
||||
gles_glMatrixMode(mode);
|
||||
}
|
||||
}
|
||||
|
||||
void gl4es_glPushMatrix() {
|
||||
DBG(printf("glPushMatrix(), list=%p\n", glstate->list.active);)
|
||||
PUSH_IF_COMPILING(glPushMatrix);
|
||||
// get matrix mode
|
||||
GLint matrix_mode = glstate->matrix_mode;
|
||||
noerrorShim();
|
||||
// go...
|
||||
switch(matrix_mode) {
|
||||
#define P(A, B) if(glstate->A->top<MAX_STACK_##B) { \
|
||||
memcpy(TOP(A)+16, TOP(A), 16*sizeof(GLfloat)); \
|
||||
glstate->A->top++; \
|
||||
} else errorShim(GL_STACK_OVERFLOW)
|
||||
case GL_PROJECTION:
|
||||
P(projection_matrix, PROJECTION);
|
||||
break;
|
||||
case GL_MODELVIEW:
|
||||
P(modelview_matrix, MODELVIEW);
|
||||
break;
|
||||
case GL_TEXTURE:
|
||||
P(texture_matrix[glstate->texture.active], PROJECTION);
|
||||
break;
|
||||
#undef P
|
||||
default:
|
||||
//Warning?
|
||||
errorShim(GL_INVALID_OPERATION);
|
||||
//LOGE("LIBGL: PushMatrix with Unrecognise matrix mode (0x%04X)\n", matrix_mode);
|
||||
//gles_glPushMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
void gl4es_glPopMatrix() {
|
||||
DBG(printf("glPopMatrix(), list=%p\n", glstate->list.active);)
|
||||
PUSH_IF_COMPILING(glPopMatrix);
|
||||
LOAD_GLES(glLoadMatrixf);
|
||||
// get matrix mode
|
||||
GLint matrix_mode = glstate->matrix_mode;
|
||||
// go...
|
||||
noerrorShim();
|
||||
switch(matrix_mode) {
|
||||
#define P(A) if(glstate->A->top) { \
|
||||
--glstate->A->top; \
|
||||
gles_glLoadMatrixf(update_current_mat()); \
|
||||
} else errorShim(GL_STACK_UNDERFLOW)
|
||||
case GL_PROJECTION:
|
||||
P(projection_matrix);
|
||||
break;
|
||||
case GL_MODELVIEW:
|
||||
P(modelview_matrix);
|
||||
break;
|
||||
case GL_TEXTURE:
|
||||
P(texture_matrix[glstate->texture.active]);
|
||||
break;
|
||||
#undef P
|
||||
|
||||
default:
|
||||
//Warning?
|
||||
errorShim(GL_INVALID_OPERATION);
|
||||
//LOGE("LIBGL: PopMatrix with Unrecognise matrix mode (0x%04X)\n", matrix_mode);
|
||||
//gles_glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
void gl4es_glLoadMatrixf(const GLfloat * m) {
|
||||
DBG(printf("glLoadMatrix(%f, %f, %f, %f, %f, %f, %f...), list=%p\n", m[0], m[1], m[2], m[3], m[4], m[5], m[6], glstate->list.active);)
|
||||
LOAD_GLES(glLoadMatrixf);
|
||||
|
||||
if ((glstate->list.compiling || glstate->gl_batch) && glstate->list.active) {
|
||||
NewStage(glstate->list.active, STAGE_MATRIX);
|
||||
glstate->list.active->matrix_op = 1;
|
||||
memcpy(glstate->list.active->matrix_val, m, 16*sizeof(GLfloat));
|
||||
return;
|
||||
}
|
||||
memcpy(update_current_mat(), m, 16*sizeof(GLfloat));
|
||||
gles_glLoadMatrixf(m);
|
||||
}
|
||||
|
||||
void gl4es_glMultMatrixf(const GLfloat * m) {
|
||||
DBG(printf("glMultMatrix(%f, %f, %f, %f, %f, %f, %f...), list=%p\n", m[0], m[1], m[2], m[3], m[4], m[5], m[6], glstate->list.active);)
|
||||
LOAD_GLES(glLoadMatrixf);
|
||||
if ((glstate->list.compiling || glstate->gl_batch) && glstate->list.active) {
|
||||
if(glstate->list.active->stage == STAGE_MATRIX) {
|
||||
// multiply the matrix mith the current one....
|
||||
matrix_mul(glstate->list.active->matrix_val, m, glstate->list.active->matrix_val);
|
||||
return;
|
||||
}
|
||||
NewStage(glstate->list.active, STAGE_MATRIX);
|
||||
glstate->list.active->matrix_op = 2;
|
||||
memcpy(glstate->list.active->matrix_val, m, 16*sizeof(GLfloat));
|
||||
return;
|
||||
}
|
||||
GLfloat *current_mat = update_current_mat();
|
||||
matrix_mul(current_mat, m, current_mat);
|
||||
gles_glLoadMatrixf(current_mat);
|
||||
}
|
||||
|
||||
void gl4es_glLoadIdentity() {
|
||||
DBG(printf("glLoadIdentity(), list=%p\n", glstate->list.active);)
|
||||
LOAD_GLES(glLoadIdentity);
|
||||
if ((glstate->list.compiling || glstate->gl_batch) && glstate->list.active) {
|
||||
NewStage(glstate->list.active, STAGE_MATRIX);
|
||||
glstate->list.active->matrix_op = 1;
|
||||
set_identity(glstate->list.active->matrix_val);
|
||||
return;
|
||||
}
|
||||
|
||||
set_identity(update_current_mat());
|
||||
gles_glLoadIdentity();
|
||||
}
|
||||
|
||||
void gl4es_glTranslatef(GLfloat x, GLfloat y, GLfloat z) {
|
||||
DBG(printf("glTranslatef(%f, %f, %f), list=%p\n", x, y, z, glstate->list.active);)
|
||||
// create a translation matrix than multiply it...
|
||||
GLfloat tmp[16];
|
||||
set_identity(tmp);
|
||||
tmp[12+0] = x;
|
||||
tmp[12+1] = y;
|
||||
tmp[12+2] = z;
|
||||
gl4es_glMultMatrixf(tmp);
|
||||
}
|
||||
|
||||
void gl4es_glScalef(GLfloat x, GLfloat y, GLfloat z) {
|
||||
DBG(printf("glScalef(%f, %f, %f), list=%p\n", x, y, z, glstate->list.active);)
|
||||
// create a scale matrix than multiply it...
|
||||
GLfloat tmp[16];
|
||||
memset(tmp, 0, 16*sizeof(GLfloat));
|
||||
tmp[0+0] = x;
|
||||
tmp[1+4] = y;
|
||||
tmp[2+8] = z;
|
||||
tmp[3+12] = 1.0f;
|
||||
gl4es_glMultMatrixf(tmp);
|
||||
}
|
||||
|
||||
void gl4es_glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z) {
|
||||
DBG(printf("glRotatef(%f, %f, %f, %f), list=%p\n", angle, x, y, z, glstate->list.active);)
|
||||
// create a rotation matrix than multiply it...
|
||||
GLfloat tmp[16];
|
||||
memset(tmp, 0, 16*sizeof(GLfloat));
|
||||
if((x==0 && y==0 && z==0) || angle==0)
|
||||
return; // nothing to do
|
||||
// normalize x y z
|
||||
GLfloat l = 1.0f/sqrtf(x*x+y*y+z*z);
|
||||
x=x*l; y=y*l; z=z*l;
|
||||
// calculate sin/cos
|
||||
angle*=3.1415926535f/180.f;
|
||||
const GLfloat s=sinf(angle);
|
||||
const GLfloat c=cosf(angle);
|
||||
const GLfloat c1 = 1-c;
|
||||
//build the matrix
|
||||
tmp[0+0] = x*x*c1+c; tmp[0+4] = x*y*c1-z*s; tmp[0+8] = x*z*c1+y*s;
|
||||
tmp[1+0] = y*x*c1+z*s; tmp[1+4] = y*y*c1+c; tmp[1+8] = y*z*c1-x*s;
|
||||
tmp[2+0] = x*z*c1-y*s; tmp[2+4] = y*z*c1+x*s; tmp[2+8] = z*z*c1+c;
|
||||
|
||||
tmp[3+12] = 1.0f;
|
||||
// done...
|
||||
gl4es_glMultMatrixf(tmp);
|
||||
}
|
||||
|
||||
void gl4es_glOrthof(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat nearVal, GLfloat farVal) {
|
||||
DBG(printf("glOrthof(%f, %f, %f, %f, %f, %f), list=%p\n", left, right, top, bottom, nearVal, farVal, glstate->list.active);)
|
||||
GLfloat tmp[16];
|
||||
memset(tmp, 0, 16*sizeof(GLfloat));
|
||||
|
||||
tmp[0+0] = 2.0f/(right-left); tmp[0+12] = -(right+left)/(right-left);
|
||||
tmp[1+4] = 2.0f/(top-bottom); tmp[1+12] = -(top+bottom)/(top-bottom);
|
||||
tmp[2+8] =-2.0f/(farVal-nearVal); tmp[2+12] = -(farVal+nearVal)/(farVal-nearVal);
|
||||
tmp[3+12] = 1.0f;
|
||||
|
||||
gl4es_glMultMatrixf(tmp);
|
||||
}
|
||||
|
||||
void gl4es_glFrustumf(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat nearVal, GLfloat farVal) {
|
||||
DBG(printf("glFrustumf(%f, %f, %f, %f, %f, %f) list=%p\n", left, right, top, bottom, nearVal, farVal, glstate->list.active);)
|
||||
GLfloat tmp[16];
|
||||
memset(tmp, 0, 16*sizeof(GLfloat));
|
||||
|
||||
tmp[0+0] = 2.0f*nearVal/(right-left); tmp[0+8] = -(right+left)/(right-left);
|
||||
tmp[1+4] = 2.0f*nearVal/(top-bottom); tmp[1+8] = -(top+bottom)/(top-bottom);
|
||||
tmp[2+8] =-(farVal+nearVal)/(farVal-nearVal); tmp[2+12] = -2.0f*farVal*nearVal/(farVal-nearVal);
|
||||
tmp[3+8] = -1.0f;
|
||||
|
||||
gl4es_glMultMatrixf(tmp);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void glMatrixMode(GLenum mode) AliasExport("gl4es_glMatrixMode");
|
||||
void glPushMatrix() AliasExport("gl4es_glPushMatrix");
|
||||
void glPopMatrix() AliasExport("gl4es_glPopMatrix");
|
||||
void glLoadMatrixf(const GLfloat * m) AliasExport("gl4es_glLoadMatrixf");
|
||||
void glMultMatrixf(const GLfloat * m) AliasExport("gl4es_glMultMatrixf");
|
||||
void glLoadIdentity() AliasExport("gl4es_glLoadIdentity");
|
||||
void glTranslatef(GLfloat x, GLfloat y, GLfloat z) AliasExport("gl4es_glTranslatef");
|
||||
void glScalef(GLfloat x, GLfloat y, GLfloat z) AliasExport("gl4es_glScalef");
|
||||
void glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z) AliasExport("gl4es_glRotatef");
|
||||
void glOrthof(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat nearVal, GLfloat farVal) AliasExport("gl4es_glOrthof");
|
||||
void glFrustumf(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat nearVal, GLfloat farVal) AliasExport("gl4es_glFrustumf");
|
||||
13
project/jni/gl4es/src/gl/matrix.h
Executable file
13
project/jni/gl4es/src/gl/matrix.h
Executable file
@@ -0,0 +1,13 @@
|
||||
#include "gl.h"
|
||||
|
||||
void gl4es_glMatrixMode(GLenum mode);
|
||||
void gl4es_glPushMatrix();
|
||||
void gl4es_glPopMatrix();
|
||||
void gl4es_glLoadMatrixf(const GLfloat * m);
|
||||
void gl4es_glMultMatrixf(const GLfloat * m);
|
||||
void gl4es_glLoadIdentity();
|
||||
void gl4es_glTranslatef(GLfloat x, GLfloat y, GLfloat z);
|
||||
void gl4es_glScalef(GLfloat x, GLfloat y, GLfloat z);
|
||||
void gl4es_glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
|
||||
void gl4es_glOrthof(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat nearVal, GLfloat farVal);
|
||||
void gl4es_glFrustumf(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat nearVal, GLfloat farVal);
|
||||
285
project/jni/gl4es/src/gl/matvec.c
Executable file
285
project/jni/gl4es/src/gl/matvec.c
Executable file
@@ -0,0 +1,285 @@
|
||||
#include "matvec.h"
|
||||
#include "gl.h"
|
||||
|
||||
float FASTMATH dot(const float *a, const float *b) {
|
||||
return a[0]*b[0] + a[1]*b[1] + a[2]*b[2];
|
||||
}
|
||||
|
||||
float FASTMATH dot4(const float *a, const float *b) {
|
||||
#ifdef __ARM_NEON__
|
||||
register float ret;
|
||||
asm volatile (
|
||||
"vld1.f32 {d0-d1}, [%1] \n" //q0 = a(0..3)
|
||||
"vld1.f32 {d2-d3}, [%2] \n" //q1 = b(0..3)
|
||||
"vmul.f32 q0, q0, q1 \n" //q0 = a(0)*b(0),a(1)*b(1),a(2)*b(2),a(3)*b(3)
|
||||
"vadd.f32 d0, d0, d1 \n" //d0 = a(0)*b(0)+a(2)*b(2),a(1)*b(1)+a(3)*b(3)
|
||||
"vpadd.f32 d0,d0 \n" //d0 = a(0)*b(0)+a(2)*b(2)+a(1)*b(1)+a(3)*b(3),a(0)*b(0)+a(2)*b(2)+a(1)*b(1)+a(3)*b(3)
|
||||
"vmov.f32 %0, s0 \n"
|
||||
:"=w"(ret): "r"(a), "r"(b)
|
||||
: "q0", "q1"
|
||||
);
|
||||
return ret;
|
||||
#else
|
||||
return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + a[3]*b[3];
|
||||
#endif
|
||||
}
|
||||
|
||||
void matrix_vector(const float *a, const float *b, float *c) {
|
||||
#ifdef __ARM_NEON__
|
||||
const float* a1 = a+8;
|
||||
asm volatile (
|
||||
"vld4.f32 {d0,d2,d4,d6}, [%1] \n"
|
||||
"vld4.f32 {d1,d3,d5,d7}, [%2] \n" // q0-q3 = a(0,4,8,12/1,5,9,13/2,6,10,14/3,7,11,15)
|
||||
"vld1.f32 {q4}, [%3] \n" // q4 = b
|
||||
"vmul.f32 q0, q0, d8[0] \n" // q0 = a(0,4,8,12)*b[0]
|
||||
"vmla.f32 q0, q1, d8[1] \n" // q0 = q0 + a(1,5,9,13)*b[1]
|
||||
"vmla.f32 q0, q2, d9[0] \n" // q0 = q0 + a(2,6,10,14)*b[2]
|
||||
"vmla.f32 q0, q3, d9[1] \n" // q0 = q0 + a(3,7,11,15)*b[3]
|
||||
"vst1.f32 {q0}, [%0] \n"
|
||||
::"r"(c), "r"(a), "r"(a1), "r"(b)
|
||||
: "q0", "q1", "q2", "q3", "q4", "memory"
|
||||
);
|
||||
#else
|
||||
c[0] = a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];
|
||||
c[1] = a[4] * b[0] + a[5] * b[1] + a[6] * b[2] + a[7] * b[3];
|
||||
c[2] = a[8] * b[0] + a[9] * b[1] + a[10] * b[2] + a[11] * b[3];
|
||||
c[3] = a[12] * b[0] + a[13] * b[1] + a[14] * b[2] + a[15] * b[3];
|
||||
#endif
|
||||
}
|
||||
|
||||
void vector_matrix(const float *a, const float *b, float *c) {
|
||||
#ifdef __ARM_NEON__
|
||||
const float* b2=b+4;
|
||||
const float* b3=b+8;
|
||||
const float* b4=b+12;
|
||||
asm volatile (
|
||||
"vld1.f32 {q0}, [%1] \n" // %q0 = a(0..3)
|
||||
"vld1.f32 {q1}, [%2] \n" // %q1 = b(0..3)
|
||||
"vmul.f32 q1, q1, d0[0] \n" // %q1 = b(0..3)*a[0]
|
||||
"vld1.f32 {q2}, [%3] \n" // %q2 = b(4..7)
|
||||
"vmla.f32 q1, q2, d0[1] \n" // %q1 = %q1 + b(4..7)*a[1]
|
||||
"vld1.f32 {q2}, [%4] \n" // %q2 = b(8..11)
|
||||
"vmla.f32 q1, q2, d1[0] \n" // %q1 = %q1 + b(8..11)*a[2]
|
||||
"vld1.f32 {q2}, [%5] \n" // %q2 = b(12..15)
|
||||
"vmla.f32 q1, q2, d1[1] \n" // %q1 = %q1 + b(12..15)*a[3]
|
||||
"vst1.f32 {q1}, [%0] \n"
|
||||
::"r"(c), "r"(a), "r"(b), "r"(b2), "r"(b3), "r"(b4)
|
||||
: "%2", "q0", "q1", "q2", "memory"
|
||||
);
|
||||
#else
|
||||
c[0] = a[0] * b[0] + a[1] * b[4] + a[2] * b[8] + a[3] * b[12];
|
||||
c[1] = a[0] * b[1] + a[1] * b[5] + a[2] * b[9] + a[3] * b[13];
|
||||
c[2] = a[0] * b[2] + a[1] * b[6] + a[2] * b[10] + a[3] * b[14];
|
||||
c[3] = a[0] * b[3] + a[1] * b[7] + a[2] * b[11] + a[3] * b[15];
|
||||
#endif
|
||||
}
|
||||
|
||||
void vector3_matrix(const float *a, const float *b, float *c) {
|
||||
#ifdef __ARM_NEON__
|
||||
const float* b2=b+4;
|
||||
const float* b3=b+8;
|
||||
const float* b4=b+12;
|
||||
asm volatile (
|
||||
//"vld1.f32 {q0}, [%1] \n" // %q0 = a(0..2)
|
||||
"vld1.32 {d4}, [%1] \n"
|
||||
"flds s10, [%1, #8] \n"
|
||||
"vsub.f32 s11, s11, s11 \n"
|
||||
"vld1.f32 {q1}, [%2] \n" // %q1 = b(0..3)
|
||||
"vmul.f32 q1, q1, d0[0] \n" // %q1 = b(0..3)*a[0]
|
||||
"vld1.f32 {q2}, [%3] \n" // %q2 = b(4..7)
|
||||
"vmla.f32 q1, q2, d0[1] \n" // %q1 = %q1 + b(4..7)*a[1]
|
||||
"vld1.f32 {q2}, [%4] \n" // %q2 = b(8..11)
|
||||
"vmla.f32 q1, q2, d1[0] \n" // %q1 = %q1 + b(8..11)*a[2]
|
||||
"vld1.f32 {q2}, [%5] \n" // %q2 = b(12..15)
|
||||
"vadd.f32 q1, q1, q2 \n" // %q1 = %q1 + b(12..15)
|
||||
"vst1.f32 {q1}, [%0] \n"
|
||||
::"r"(c), "r"(a), "r"(b), "r"(b2), "r"(b3), "r"(b4)
|
||||
: "q0", "q1", "q2", "memory"
|
||||
);
|
||||
#else
|
||||
c[0] = a[0] * b[0] + a[1] * b[4] + a[2] * b[8] + b[12];
|
||||
c[1] = a[0] * b[1] + a[1] * b[5] + a[2] * b[9] + b[13];
|
||||
c[2] = a[0] * b[2] + a[1] * b[6] + a[2] * b[10] + b[14];
|
||||
c[3] = a[0] * b[3] + a[1] * b[7] + a[2] * b[11] + b[15];
|
||||
#endif
|
||||
}
|
||||
|
||||
void vector_normalize(float *a) {
|
||||
#ifdef __ARM_NEON__
|
||||
asm volatile (
|
||||
"vld1.32 {d4}, [%0] \n\t" //d4={x0,y0}
|
||||
"flds s10, [%0, #8] \n\t" //d5[0]={z0}
|
||||
"vsub.f32 s11, s11, s11 \n\t"
|
||||
|
||||
"vmul.f32 d0, d4, d4 \n\t" //d0= d4*d4
|
||||
"vpadd.f32 d0, d0 \n\t" //d0 = d[0] + d[1]
|
||||
"vmla.f32 d0, d5, d5 \n\t" //d0 = d0 + d5*d5
|
||||
|
||||
"vmov.f32 d1, d0 \n\t" //d1 = d0
|
||||
"vrsqrte.f32 d0, d0 \n\t" //d0 = ~ 1.0 / sqrt(d0)
|
||||
"vmul.f32 d2, d0, d1 \n\t" //d2 = d0 * d1
|
||||
"vrsqrts.f32 d3, d2, d0 \n\t" //d3 = (3 - d0 * d2) / 2
|
||||
"vmul.f32 d0, d0, d3 \n\t" //d0 = d0 * d3
|
||||
/* "vmul.f32 d2, d0, d1 \n\t" //d2 = d0 * d1
|
||||
"vrsqrts.f32 d3, d2, d0 \n\t" //d4 = (3 - d0 * d3) / 2
|
||||
"vmul.f32 d0, d0, d3 \n\t" //d0 = d0 * d4 */ // 1 iteration should be enough
|
||||
|
||||
"vmul.f32 q2, q2, d0[0] \n\t" //d0= d2*d4
|
||||
"vst1.32 {d4}, [%0] \n\t" //
|
||||
"fsts s10, [%0, #8] \n\t" //
|
||||
|
||||
:"+&r"(a):
|
||||
: "d0", "d1", "d2", "d3", "d4", "d5", "memory"
|
||||
);
|
||||
#else
|
||||
float det=1.0f/sqrtf(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);
|
||||
a[0]*=det;
|
||||
a[1]*=det;
|
||||
a[2]*=det;
|
||||
#endif
|
||||
}
|
||||
|
||||
void vector4_normalize(float *a) {
|
||||
#ifdef __ARM_NEON__
|
||||
asm volatile (
|
||||
"vld1.32 {q2}, [%0] \n\t" //q2={x0,y0,z0,00}
|
||||
|
||||
"vmul.f32 d0, d4, d4 \n\t" //d0= d4*d4
|
||||
"vpadd.f32 d0, d0 \n\t" //d0 = d[0] + d[1]
|
||||
"vmla.f32 d0, d5, d5 \n\t" //d0 = d0 + d5*d5
|
||||
|
||||
"vmov.f32 d1, d0 \n\t" //d1 = d0
|
||||
"vrsqrte.f32 d0, d0 \n\t" //d0 = ~ 1.0 / sqrt(d0)
|
||||
"vmul.f32 d2, d0, d1 \n\t" //d2 = d0 * d1
|
||||
"vrsqrts.f32 d3, d2, d0 \n\t" //d3 = (3 - d0 * d2) / 2
|
||||
"vmul.f32 d0, d0, d3 \n\t" //d0 = d0 * d3
|
||||
/* "vmul.f32 d2, d0, d1 \n\t" //d2 = d0 * d1
|
||||
"vrsqrts.f32 d3, d2, d0 \n\t" //d4 = (3 - d0 * d3) / 2
|
||||
"vmul.f32 d0, d0, d3 \n\t" //d0 = d0 * d4 */ // 1 iteration should be enough
|
||||
|
||||
"vmul.f32 q2, q2, d0[0] \n\t" //d0= d2*d4
|
||||
"vst1.32 {q2}, [%0] \n\t" //
|
||||
|
||||
:"+&r"(a):
|
||||
: "d0", "d1", "d2", "d3", "d4", "d5", "memory"
|
||||
);
|
||||
#else
|
||||
float det=1.0f/sqrtf(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);
|
||||
a[0]*=det;
|
||||
a[1]*=det;
|
||||
a[2]*=det;
|
||||
// a[3] is ignored and left as 0.0f
|
||||
#endif
|
||||
}
|
||||
|
||||
void FASTMATH matrix_transpose(const float *a, float *b) {
|
||||
// column major -> row major
|
||||
// a(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) -> b(0,4,8,12,1,5,9,13,2,6,10,14,3,7,11,15)
|
||||
#ifdef __ARM_NEON__
|
||||
const float* a1 = a+8;
|
||||
float* b1=b+8;
|
||||
asm volatile (
|
||||
"vld4.f32 {d0,d2,d4,d6}, [%1] \n"
|
||||
"vld4.f32 {d1,d3,d5,d7}, [%2] \n" // %q0-%q3 = a(0,4,8,12/1,5,9,13/2,6,10,14/3,7,11,15)
|
||||
"vst1.f32 {d0-d3}, [%0] \n"
|
||||
"vst1.f32 {d4-d7}, [%3] \n"
|
||||
::"r"(b), "r"(a), "r"(a1), "r"(b1)
|
||||
: "q0", "q1", "q2", "q3", "memory"
|
||||
);
|
||||
#else
|
||||
for (int i=0; i<4; i++)
|
||||
for (int j=0; j<4; j++)
|
||||
b[i*4+j]=a[i+j*4];
|
||||
#endif
|
||||
}
|
||||
|
||||
void matrix_inverse(const float *m, float *r) {
|
||||
|
||||
r[0] = m[5]*m[10]*m[15] - m[5]*m[14]*m[11] - m[6]*m[9]*m[15] + m[6]*m[13]*m[11] + m[7]*m[9]*m[14] - m[7]*m[13]*m[10];
|
||||
r[1] = -m[1]*m[10]*m[15] + m[1]*m[14]*m[11] + m[2]*m[9]*m[15] - m[2]*m[13]*m[11] - m[3]*m[9]*m[14] + m[3]*m[13]*m[10];
|
||||
r[2] = m[1]*m[6]*m[15] - m[1]*m[14]*m[7] - m[2]*m[5]*m[15] + m[2]*m[13]*m[7] + m[3]*m[5]*m[14] - m[3]*m[13]*m[6];
|
||||
r[3] = -m[1]*m[6]*m[11] + m[1]*m[10]*m[7] + m[2]*m[5]*m[11] - m[2]*m[9]*m[7] - m[3]*m[5]*m[10] + m[3]*m[9]*m[6];
|
||||
|
||||
r[4] = -m[4]*m[10]*m[15] + m[4]*m[14]*m[11] + m[6]*m[8]*m[15] - m[6]*m[12]*m[11] - m[7]*m[8]*m[14] + m[7]*m[12]*m[10];
|
||||
r[5] = m[0]*m[10]*m[15] - m[0]*m[14]*m[11] - m[2]*m[8]*m[15] + m[2]*m[12]*m[11] + m[3]*m[8]*m[14] - m[3]*m[12]*m[10];
|
||||
r[6] = -m[0]*m[6]*m[15] + m[0]*m[14]*m[7] + m[2]*m[4]*m[15] - m[2]*m[12]*m[7] - m[3]*m[4]*m[14] + m[3]*m[12]*m[6];
|
||||
r[7] = m[0]*m[6]*m[11] - m[0]*m[10]*m[7] - m[2]*m[4]*m[11] + m[2]*m[8]*m[7] + m[3]*m[4]*m[10] - m[3]*m[8]*m[6];
|
||||
|
||||
r[8] = m[4]*m[9]*m[15] - m[4]*m[13]*m[11] - m[5]*m[8]*m[15] + m[5]*m[12]*m[11] + m[7]*m[8]*m[13] - m[7]*m[12]*m[9];
|
||||
r[9] = -m[0]*m[9]*m[15] + m[0]*m[13]*m[11] + m[1]*m[8]*m[15] - m[1]*m[12]*m[11] - m[3]*m[8]*m[13] + m[3]*m[12]*m[9];
|
||||
r[10] = m[0]*m[5]*m[15] - m[0]*m[13]*m[7] - m[1]*m[4]*m[15] + m[1]*m[12]*m[7] + m[3]*m[4]*m[13] - m[3]*m[12]*m[5];
|
||||
r[11] = -m[0]*m[5]*m[11] + m[0]*m[9]*m[7] + m[1]*m[4]*m[11] - m[1]*m[8]*m[7] - m[3]*m[4]*m[9] + m[3]*m[8]*m[5];
|
||||
|
||||
r[12] = -m[4]*m[9]*m[14] + m[4]*m[13]*m[10] + m[5]*m[8]*m[14] - m[5]*m[12]*m[10] - m[6]*m[8]*m[13] + m[6]*m[12]*m[9];
|
||||
r[13] = m[0]*m[9]*m[14] - m[0]*m[13]*m[10] - m[1]*m[8]*m[14] + m[1]*m[12]*m[10] + m[2]*m[8]*m[13] - m[2]*m[12]*m[9];
|
||||
r[14] = -m[0]*m[5]*m[14] + m[0]*m[13]*m[6] + m[1]*m[4]*m[14] - m[1]*m[12]*m[6] - m[2]*m[4]*m[13] + m[2]*m[12]*m[5];
|
||||
r[15] = m[0]*m[5]*m[10] - m[0]*m[9]*m[6] - m[1]*m[4]*m[10] + m[1]*m[8]*m[6] + m[2]*m[4]*m[9] - m[2]*m[8]*m[5];
|
||||
|
||||
float det = 1.0f/(m[0]*r[0] + m[1]*r[4] + m[2]*r[8] + m[3]*r[12]);
|
||||
for (int i = 0; i < 16; i++) r[i] *= det;
|
||||
}
|
||||
|
||||
void matrix_mul(const float *a, const float *b, float *c) {
|
||||
#ifdef __ARM_NEON__
|
||||
const float* a1 = a+8;
|
||||
const float* b1=b+8;
|
||||
float* c1=c+8;
|
||||
asm volatile (
|
||||
"vld1.32 {d16-d19}, [%2] \n"
|
||||
"vld1.32 {d20-d23}, [%3] \n"
|
||||
"vld1.32 {d0-d3}, [%4] \n"
|
||||
"vld1.32 {d4-d7}, [%5] \n"
|
||||
"vmul.f32 q12, q8, d0[0] \n"
|
||||
"vmul.f32 q13, q8, d2[0] \n"
|
||||
"vmul.f32 q14, q8, d4[0] \n"
|
||||
"vmul.f32 q15, q8, d6[0] \n"
|
||||
"vmla.f32 q12, q9, d0[1] \n"
|
||||
"vmla.f32 q13, q9, d2[1] \n"
|
||||
"vmla.f32 q14, q9, d4[1] \n"
|
||||
"vmla.f32 q15, q9, d6[1] \n"
|
||||
"vmla.f32 q12, q10, d1[0] \n"
|
||||
"vmla.f32 q13, q10, d3[0] \n"
|
||||
"vmla.f32 q14, q10, d5[0] \n"
|
||||
"vmla.f32 q15, q10, d7[0] \n"
|
||||
"vmla.f32 q12, q11, d1[1] \n"
|
||||
"vmla.f32 q13, q11, d3[1] \n"
|
||||
"vmla.f32 q14, q11, d5[1] \n"
|
||||
"vmla.f32 q15, q11, d7[1] \n"
|
||||
"vst1.32 {d24-d27}, [%0] \n"
|
||||
"vst1.32 {d28-d31}, [%1] \n"
|
||||
::"r"(c), "r"(c1), "r"(a), "r"(a1), "r"(b), "r"(b1)
|
||||
: "q0", "q1", "q2", "q3",
|
||||
"q8", "q9", "q10", "q11", "q12", "q13", "q14", "q15", "memory"
|
||||
);
|
||||
#else
|
||||
float a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3],
|
||||
a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7],
|
||||
a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11],
|
||||
a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];
|
||||
|
||||
float b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3];
|
||||
c[0] = b0*a00 + b1*a10 + b2*a20 + b3*a30;
|
||||
c[1] = b0*a01 + b1*a11 + b2*a21 + b3*a31;
|
||||
c[2] = b0*a02 + b1*a12 + b2*a22 + b3*a32;
|
||||
c[3] = b0*a03 + b1*a13 + b2*a23 + b3*a33;
|
||||
|
||||
b0 = b[4]; b1 = b[5]; b2 = b[6]; b3 = b[7];
|
||||
c[4] = b0*a00 + b1*a10 + b2*a20 + b3*a30;
|
||||
c[5] = b0*a01 + b1*a11 + b2*a21 + b3*a31;
|
||||
c[6] = b0*a02 + b1*a12 + b2*a22 + b3*a32;
|
||||
c[7] = b0*a03 + b1*a13 + b2*a23 + b3*a33;
|
||||
|
||||
b0 = b[8]; b1 = b[9]; b2 = b[10]; b3 = b[11];
|
||||
c[8] = b0*a00 + b1*a10 + b2*a20 + b3*a30;
|
||||
c[9] = b0*a01 + b1*a11 + b2*a21 + b3*a31;
|
||||
c[10] = b0*a02 + b1*a12 + b2*a22 + b3*a32;
|
||||
c[11] = b0*a03 + b1*a13 + b2*a23 + b3*a33;
|
||||
|
||||
b0 = b[12]; b1 = b[13]; b2 = b[14]; b3 = b[15];
|
||||
c[12] = b0*a00 + b1*a10 + b2*a20 + b3*a30;
|
||||
c[13] = b0*a01 + b1*a11 + b2*a21 + b3*a31;
|
||||
c[14] = b0*a02 + b1*a12 + b2*a22 + b3*a32;
|
||||
c[15] = b0*a03 + b1*a13 + b2*a23 + b3*a33;
|
||||
#endif
|
||||
}
|
||||
|
||||
18
project/jni/gl4es/src/gl/matvec.h
Executable file
18
project/jni/gl4es/src/gl/matvec.h
Executable file
@@ -0,0 +1,18 @@
|
||||
#ifndef _GL4ES_MATVEC_H_
|
||||
#define _GL4ES_MATVEC_H_
|
||||
#include "gl.h"
|
||||
#include <math.h>
|
||||
|
||||
float dot(const float *a, const float *b) FASTMATH;
|
||||
float dot4(const float *a, const float *b) FASTMATH;
|
||||
void matrix_vector(const float *a, const float *b, float *c);
|
||||
void vector_matrix(const float *a, const float *b, float *c);
|
||||
void vector3_matrix(const float *a, const float *b, float *c);
|
||||
void vector_normalize(float *a);
|
||||
void vector4_normalize(float *a);
|
||||
void matrix_transpose(const float *a, float *b);
|
||||
void matrix_inverse(const float *m, float *r);
|
||||
void matrix_mul(const float *a, const float *b, float *c);
|
||||
|
||||
|
||||
#endif
|
||||
@@ -2,9 +2,8 @@
|
||||
|
||||
static GLuint lastquery = 0;
|
||||
static glquery_t *active_samples_passed = 0;
|
||||
extern int glshim_queries;
|
||||
|
||||
void glshim_glGenQueries(GLsizei n, GLuint * ids) {
|
||||
void gl4es_glGenQueries(GLsizei n, GLuint * ids) {
|
||||
noerrorShim();
|
||||
if (n<1) {
|
||||
errorShim(GL_INVALID_VALUE);
|
||||
@@ -15,7 +14,7 @@ void glshim_glGenQueries(GLsizei n, GLuint * ids) {
|
||||
}
|
||||
}
|
||||
|
||||
GLboolean glshim_glIsQuery(GLuint id) {
|
||||
GLboolean gl4es_glIsQuery(GLuint id) {
|
||||
khash_t(queries) *list = glstate->queries;
|
||||
khint_t k;
|
||||
noerrorShim();
|
||||
@@ -28,7 +27,7 @@ GLboolean glshim_glIsQuery(GLuint id) {
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
void glshim_glDeleteQueries(GLsizei n, const GLuint* ids) {
|
||||
void gl4es_glDeleteQueries(GLsizei n, const GLuint* ids) {
|
||||
khash_t(queries) *list = glstate->queries;
|
||||
if (list) {
|
||||
khint_t k;
|
||||
@@ -50,7 +49,7 @@ void glshim_glDeleteQueries(GLsizei n, const GLuint* ids) {
|
||||
noerrorShim();
|
||||
}
|
||||
|
||||
void glshim_glBeginQuery(GLenum target, GLuint id) {
|
||||
void gl4es_glBeginQuery(GLenum target, GLuint id) {
|
||||
if(target!=GL_SAMPLES_PASSED) {
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
return;
|
||||
@@ -81,7 +80,7 @@ void glshim_glBeginQuery(GLenum target, GLuint id) {
|
||||
noerrorShim();
|
||||
}
|
||||
|
||||
void glshim_glEndQuery(GLenum target) {
|
||||
void gl4es_glEndQuery(GLenum target) {
|
||||
if(target!=GL_SAMPLES_PASSED) {
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
return;
|
||||
@@ -97,7 +96,7 @@ void glshim_glEndQuery(GLenum target) {
|
||||
noerrorShim();
|
||||
}
|
||||
|
||||
void glshim_glGetQueryiv(GLenum target, GLenum pname, GLint* params) {
|
||||
void gl4es_glGetQueryiv(GLenum target, GLenum pname, GLint* params) {
|
||||
if(target!=GL_SAMPLES_PASSED) {
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
return;
|
||||
@@ -115,7 +114,7 @@ void glshim_glGetQueryiv(GLenum target, GLenum pname, GLint* params) {
|
||||
}
|
||||
}
|
||||
|
||||
void glshim_glGetQueryObjectiv(GLuint id, GLenum pname, GLint* params) {
|
||||
void gl4es_glGetQueryObjectiv(GLuint id, GLenum pname, GLint* params) {
|
||||
khint_t k;
|
||||
int ret;
|
||||
glquery_t *query = NULL;
|
||||
@@ -148,7 +147,7 @@ void glshim_glGetQueryObjectiv(GLuint id, GLenum pname, GLint* params) {
|
||||
}
|
||||
}
|
||||
|
||||
void glshim_glGetQueryObjectuiv(GLuint id, GLenum pname, GLuint* params) {
|
||||
void gl4es_glGetQueryObjectuiv(GLuint id, GLenum pname, GLuint* params) {
|
||||
khint_t k;
|
||||
int ret;
|
||||
glquery_t *query = NULL;
|
||||
@@ -183,11 +182,11 @@ void glshim_glGetQueryObjectuiv(GLuint id, GLenum pname, GLuint* params) {
|
||||
|
||||
|
||||
//Direct wrapper
|
||||
void glGenQueries(GLsizei n, GLuint * ids) AliasExport("glshim_glGenQueries");
|
||||
GLboolean glIsQuery(GLuint id) AliasExport("glshim_glIsQuery");
|
||||
void glDeleteQueries(GLsizei n, const GLuint* ids) AliasExport("glshim_glDeleteQueries");
|
||||
void glBeginQuery(GLenum target, GLuint id) AliasExport("glshim_glBeginQuery");
|
||||
void glEndQuery(GLenum target) AliasExport("glshim_glEndQuery");
|
||||
void glGetQueryiv(GLenum target, GLenum pname, GLint* params) AliasExport("glshim_glGetQueryiv");
|
||||
void glGetQueryObjectiv(GLuint id, GLenum pname, GLint* params) AliasExport("glshim_glGetQueryObjectiv");
|
||||
void glGetQueryObjectuiv(GLuint id, GLenum pname, GLuint* params) AliasExport("glshim_glGetQueryObjectuiv");
|
||||
void glGenQueries(GLsizei n, GLuint * ids) AliasExport("gl4es_glGenQueries");
|
||||
GLboolean glIsQuery(GLuint id) AliasExport("gl4es_glIsQuery");
|
||||
void glDeleteQueries(GLsizei n, const GLuint* ids) AliasExport("gl4es_glDeleteQueries");
|
||||
void glBeginQuery(GLenum target, GLuint id) AliasExport("gl4es_glBeginQuery");
|
||||
void glEndQuery(GLenum target) AliasExport("gl4es_glEndQuery");
|
||||
void glGetQueryiv(GLenum target, GLenum pname, GLint* params) AliasExport("gl4es_glGetQueryiv");
|
||||
void glGetQueryObjectiv(GLuint id, GLenum pname, GLint* params) AliasExport("gl4es_glGetQueryObjectiv");
|
||||
void glGetQueryObjectuiv(GLuint id, GLenum pname, GLuint* params) AliasExport("gl4es_glGetQueryObjectuiv");
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
#ifndef GL_QUERIES_H
|
||||
#define GL_QUERIES_H
|
||||
|
||||
void glshim_glBeginQuery(GLenum target, GLuint id);
|
||||
void glshim_glEndQuery(GLenum target);
|
||||
void glshim_glGenQueries(GLsizei n, GLuint * ids);
|
||||
void glshim_glDeleteQueries(GLsizei n, const GLuint* ids);
|
||||
GLboolean glshim_glIsQuery(GLuint id);
|
||||
void glshim_glGetQueryiv(GLenum target, GLenum pname, GLint* params);
|
||||
void glshim_glGetQueryObjectiv(GLuint id, GLenum pname, GLint* params);
|
||||
void glshim_glGetQueryObjectuiv(GLuint id, GLenum pname, GLuint* params);
|
||||
void gl4es_glBeginQuery(GLenum target, GLuint id);
|
||||
void gl4es_glEndQuery(GLenum target);
|
||||
void gl4es_glGenQueries(GLsizei n, GLuint * ids);
|
||||
void gl4es_glDeleteQueries(GLsizei n, const GLuint* ids);
|
||||
GLboolean gl4es_glIsQuery(GLuint id);
|
||||
void gl4es_glGetQueryiv(GLenum target, GLenum pname, GLint* params);
|
||||
void gl4es_glGetQueryObjectiv(GLuint id, GLenum pname, GLint* params);
|
||||
void gl4es_glGetQueryObjectuiv(GLuint id, GLenum pname, GLuint* params);
|
||||
|
||||
typedef struct {
|
||||
GLuint id;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "raster.h"
|
||||
#include "debug.h"
|
||||
#include "init.h"
|
||||
|
||||
static GLubyte *raster = NULL;
|
||||
static GLuint raster_texture=0;
|
||||
@@ -15,7 +16,7 @@ static GLint raster_x1, raster_x2, raster_y1, raster_y2;
|
||||
void matrix_transpose(const GLfloat *a, GLfloat *b);
|
||||
void matrix_vector(const GLfloat *a, const GLfloat *b, GLfloat *c);
|
||||
|
||||
void glshim_glRasterPos3f(GLfloat x, GLfloat y, GLfloat z) {
|
||||
void gl4es_glRasterPos3f(GLfloat x, GLfloat y, GLfloat z) {
|
||||
if ((glstate->list.compiling || glstate->gl_batch) && glstate->list.active) {
|
||||
NewStage(glstate->list.active, STAGE_RASTER);
|
||||
rlRasterOp(glstate->list.active, 1, x, y, z);
|
||||
@@ -25,9 +26,9 @@ void glshim_glRasterPos3f(GLfloat x, GLfloat y, GLfloat z) {
|
||||
// Transform xyz coordinates with current modelview and projection matrix...
|
||||
GLfloat glmatrix[16], projection[16], modelview[16];
|
||||
GLfloat t[4], transl[4] = {x, y, z, 1.0f};
|
||||
glshim_glGetFloatv(GL_PROJECTION_MATRIX, glmatrix);
|
||||
gl4es_glGetFloatv(GL_PROJECTION_MATRIX, glmatrix);
|
||||
matrix_transpose(glmatrix, projection);
|
||||
glshim_glGetFloatv(GL_MODELVIEW_MATRIX, glmatrix);
|
||||
gl4es_glGetFloatv(GL_MODELVIEW_MATRIX, glmatrix);
|
||||
matrix_transpose(glmatrix, modelview);
|
||||
matrix_vector(modelview, transl, t);
|
||||
matrix_vector(projection, t, transl);
|
||||
@@ -39,7 +40,7 @@ void glshim_glRasterPos3f(GLfloat x, GLfloat y, GLfloat z) {
|
||||
glstate->raster.rPos.z = transl[2];
|
||||
}
|
||||
|
||||
void glshim_glWindowPos3f(GLfloat x, GLfloat y, GLfloat z) {
|
||||
void gl4es_glWindowPos3f(GLfloat x, GLfloat y, GLfloat z) {
|
||||
if ((glstate->list.compiling || glstate->gl_batch) && glstate->list.active) {
|
||||
NewStage(glstate->list.active, STAGE_RASTER);
|
||||
rlRasterOp(glstate->list.active, 2, x, y, z);
|
||||
@@ -51,7 +52,7 @@ void glshim_glWindowPos3f(GLfloat x, GLfloat y, GLfloat z) {
|
||||
glstate->raster.rPos.z = z;
|
||||
}
|
||||
|
||||
void glshim_glViewport(GLint x, GLint y, GLsizei width, GLsizei height) {
|
||||
void gl4es_glViewport(GLint x, GLint y, GLsizei width, GLsizei height) {
|
||||
PUSH_IF_COMPILING(glViewport);
|
||||
LOAD_GLES(glViewport);
|
||||
if(glstate->raster.viewport.x!=x || glstate->raster.viewport.y!=y || glstate->raster.viewport.width!=width || glstate->raster.viewport.height!=height) {
|
||||
@@ -74,7 +75,7 @@ void popViewport() {
|
||||
}
|
||||
|
||||
|
||||
void glshim_glPixelZoom(GLfloat xfactor, GLfloat yfactor) {
|
||||
void gl4es_glPixelZoom(GLfloat xfactor, GLfloat yfactor) {
|
||||
if ((glstate->list.compiling || glstate->gl_batch) && glstate->list.active) {
|
||||
NewStage(glstate->list.active, STAGE_RASTER);
|
||||
rlRasterOp(glstate->list.active, 3, xfactor, yfactor, 0.0f);
|
||||
@@ -86,7 +87,7 @@ void glshim_glPixelZoom(GLfloat xfactor, GLfloat yfactor) {
|
||||
//printf("LIBGL: glPixelZoom(%f, %f)\n", xfactor, yfactor);
|
||||
}
|
||||
|
||||
void glshim_glPixelTransferf(GLenum pname, GLfloat param) {
|
||||
void gl4es_glPixelTransferf(GLenum pname, GLfloat param) {
|
||||
if ((glstate->list.compiling || glstate->gl_batch) && glstate->list.active) {
|
||||
NewStage(glstate->list.active, STAGE_RASTER);
|
||||
rlRasterOp(glstate->list.active, pname|0x10000, param, 0.0f, 0.0f);
|
||||
@@ -180,24 +181,24 @@ GLuint raster_to_texture()
|
||||
GLuint state_batch = glstate->gl_batch;
|
||||
glstate->list.compiling = false;
|
||||
glstate->gl_batch = 0;
|
||||
glshim_glPushAttrib(GL_TEXTURE_BIT | GL_ENABLE_BIT );
|
||||
gl4es_glPushAttrib(GL_TEXTURE_BIT | GL_ENABLE_BIT );
|
||||
GLuint old_tex_unit, old_tex;
|
||||
glshim_glGetIntegerv(GL_ACTIVE_TEXTURE, &old_tex_unit);
|
||||
if (old_tex_unit!=GL_TEXTURE0) glshim_glActiveTexture(GL_TEXTURE0);
|
||||
gl4es_glGetIntegerv(GL_ACTIVE_TEXTURE, &old_tex_unit);
|
||||
if (old_tex_unit!=GL_TEXTURE0) gl4es_glActiveTexture(GL_TEXTURE0);
|
||||
old_tex = 0;
|
||||
if (glstate->texture.bound[0])
|
||||
old_tex = glstate->texture.bound[0]->texture;
|
||||
GLuint raster_texture;
|
||||
glshim_glEnable(GL_TEXTURE_2D);
|
||||
gl4es_glEnable(GL_TEXTURE_2D);
|
||||
gles_glGenTextures(1, &raster_texture);
|
||||
gles_glBindTexture(GL_TEXTURE_2D, raster_texture);
|
||||
|
||||
glshim_glPixelStorei(GL_PACK_ALIGNMENT, 1);
|
||||
glshim_glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
glshim_glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
|
||||
glshim_glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
|
||||
glshim_glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
|
||||
glshim_glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
gl4es_glPixelStorei(GL_PACK_ALIGNMENT, 1);
|
||||
gl4es_glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
gl4es_glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
|
||||
gl4es_glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
|
||||
gl4es_glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
|
||||
gl4es_glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
gles_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
gles_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
gles_glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
@@ -212,15 +213,15 @@ GLuint raster_to_texture()
|
||||
|
||||
gles_glBindTexture(GL_TEXTURE_2D, old_tex);
|
||||
if (old_tex_unit!=GL_TEXTURE0)
|
||||
glshim_glActiveTexture(old_tex_unit);
|
||||
glshim_glPopAttrib();
|
||||
gl4es_glActiveTexture(old_tex_unit);
|
||||
gl4es_glPopAttrib();
|
||||
if (old_list) glstate->list.active = old_list;
|
||||
glstate->list.compiling = compiling;
|
||||
glstate->gl_batch = state_batch;
|
||||
return raster_texture;
|
||||
}
|
||||
|
||||
void glshim_glBitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig,
|
||||
void gl4es_glBitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig,
|
||||
GLfloat xmove, GLfloat ymove, const GLubyte *bitmap) {
|
||||
/*printf("glBitmap, xy={%f, %f}, xyorig={%f, %f}, size={%u, %u}, zoom={%f, %f}, viewport={%i, %i, %i, %i}\n",
|
||||
glstate->raster.rPos.x, glstate->raster.rPos.y, xorig, yorig, width, height, glstate->raster.raster_zoomx, glstate->raster.raster_zoomy, glstate->raster.viewport.x, glstate->raster.viewport.y, glstate->raster.viewport.width, glstate->raster.viewport.height);*/
|
||||
@@ -313,7 +314,7 @@ void glshim_glBitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig
|
||||
}
|
||||
}
|
||||
|
||||
void glshim_glDrawPixels(GLsizei width, GLsizei height, GLenum format,
|
||||
void gl4es_glDrawPixels(GLsizei width, GLsizei height, GLenum format,
|
||||
GLenum type, const GLvoid *data) {
|
||||
GLubyte *pixels, *from, *to;
|
||||
GLvoid *dst = NULL;
|
||||
@@ -370,7 +371,7 @@ void glshim_glDrawPixels(GLsizei width, GLsizei height, GLenum format,
|
||||
|
||||
static rasterlist_t rast = {.texture=0, .shared=NULL};
|
||||
rasterlist_t *r;
|
||||
if (glstate->list.compiling || gl_batch) {
|
||||
if (glstate->list.compiling || globals4es.batch) {
|
||||
NewStage(glstate->list.active, STAGE_RASTER);
|
||||
rasterlist_t *r = glstate->list.active->raster = (rasterlist_t*)malloc(sizeof(rasterlist_t));
|
||||
r->shared = (int*)malloc(sizeof(int));
|
||||
@@ -420,21 +421,21 @@ void render_raster_list(rasterlist_t* rast) {
|
||||
GLuint old_cli = glstate->texture.client;
|
||||
if (old_cli!=0) gles_glClientActiveTexture(GL_TEXTURE0);
|
||||
#ifdef USE_DRAWTEX
|
||||
glshim_glPushAttrib(GL_ENABLE_BIT | GL_COLOR_BUFFER_BIT | GL_CURRENT_BIT);
|
||||
gl4es_glPushAttrib(GL_ENABLE_BIT | GL_COLOR_BUFFER_BIT | GL_CURRENT_BIT);
|
||||
|
||||
gltexture_t *old_bind = glstate->texture.bound[0];
|
||||
glshim_glEnable(GL_TEXTURE_2D);
|
||||
gl4es_glEnable(GL_TEXTURE_2D);
|
||||
gles_glBindTexture(GL_TEXTURE_2D, rast->texture);
|
||||
|
||||
if (rast->bitmap) {
|
||||
glshim_glEnable(GL_ALPHA_TEST);
|
||||
glshim_glAlphaFunc(GL_GREATER, 0.0f);
|
||||
gl4es_glEnable(GL_ALPHA_TEST);
|
||||
gl4es_glAlphaFunc(GL_GREATER, 0.0f);
|
||||
} else {
|
||||
glshim_glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
gl4es_glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
}
|
||||
|
||||
gles_glDrawTexf(glstate->raster.rPos.x-rast->xorig, glstate->raster.rPos.y-rast->yorig, glstate->raster.rPos.z, rast->width * rast->zoomx, rast->height * rast->zoomy);
|
||||
if (!glstate->enable.texture_2d[0]) glshim_glDisable(GL_TEXTURE_2D);
|
||||
if (!glstate->enable.texture_2d[0]) gl4es_glDisable(GL_TEXTURE_2D);
|
||||
if (old_tex!=0) gles_glActiveTexture(GL_TEXTURE0+old_tex);
|
||||
if (old_cli!=0) gles_glClientActiveTexture(GL_TEXTURE0+old_cli);
|
||||
if (old_bind == NULL)
|
||||
@@ -442,18 +443,18 @@ void render_raster_list(rasterlist_t* rast) {
|
||||
else
|
||||
gles_glBindTexture(GL_TEXTURE_2D, old_bind->glname);
|
||||
#else
|
||||
glshim_glPushAttrib(GL_TEXTURE_BIT | GL_ENABLE_BIT | GL_TRANSFORM_BIT | GL_COLOR_BUFFER_BIT | GL_CURRENT_BIT);
|
||||
gl4es_glPushAttrib(GL_TEXTURE_BIT | GL_ENABLE_BIT | GL_TRANSFORM_BIT | GL_COLOR_BUFFER_BIT | GL_CURRENT_BIT);
|
||||
GLfloat old_projection[16], old_modelview[16], old_texture[16];
|
||||
|
||||
glshim_glGetFloatv(GL_TEXTURE_MATRIX, old_texture);
|
||||
glshim_glGetFloatv(GL_PROJECTION_MATRIX, old_projection);
|
||||
glshim_glGetFloatv(GL_MODELVIEW_MATRIX, old_modelview);
|
||||
glshim_glMatrixMode(GL_TEXTURE);
|
||||
glshim_glLoadIdentity();
|
||||
glshim_glMatrixMode(GL_PROJECTION);
|
||||
glshim_glLoadIdentity();
|
||||
glshim_glMatrixMode(GL_MODELVIEW);
|
||||
glshim_glLoadIdentity();
|
||||
gl4es_glGetFloatv(GL_TEXTURE_MATRIX, old_texture);
|
||||
gl4es_glGetFloatv(GL_PROJECTION_MATRIX, old_projection);
|
||||
gl4es_glGetFloatv(GL_MODELVIEW_MATRIX, old_modelview);
|
||||
gl4es_glMatrixMode(GL_TEXTURE);
|
||||
gl4es_glLoadIdentity();
|
||||
gl4es_glMatrixMode(GL_PROJECTION);
|
||||
gl4es_glLoadIdentity();
|
||||
gl4es_glMatrixMode(GL_MODELVIEW);
|
||||
gl4es_glLoadIdentity();
|
||||
float w2 = 2.0f / glstate->raster.viewport.width;
|
||||
float h2 = 2.0f / glstate->raster.viewport.height;
|
||||
float raster_x1=glstate->raster.rPos.x-rast->xorig;
|
||||
@@ -475,21 +476,21 @@ void render_raster_list(rasterlist_t* rast) {
|
||||
0, sh
|
||||
};
|
||||
|
||||
glshim_glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT | GL_CLIENT_PIXEL_STORE_BIT);
|
||||
gl4es_glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT | GL_CLIENT_PIXEL_STORE_BIT);
|
||||
|
||||
glshim_glDisable(GL_DEPTH_TEST);
|
||||
glshim_glDisable(GL_LIGHTING);
|
||||
glshim_glDisable(GL_CULL_FACE);
|
||||
gl4es_glDisable(GL_DEPTH_TEST);
|
||||
gl4es_glDisable(GL_LIGHTING);
|
||||
gl4es_glDisable(GL_CULL_FACE);
|
||||
if (rast->bitmap) {
|
||||
glshim_glEnable(GL_ALPHA_TEST);
|
||||
glshim_glAlphaFunc(GL_GREATER, 0.0f);
|
||||
gl4es_glEnable(GL_ALPHA_TEST);
|
||||
gl4es_glAlphaFunc(GL_GREATER, 0.0f);
|
||||
} else {
|
||||
glshim_glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
gl4es_glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
}
|
||||
|
||||
glshim_glEnable(GL_TEXTURE_2D);
|
||||
gl4es_glEnable(GL_TEXTURE_2D);
|
||||
gles_glBindTexture(GL_TEXTURE_2D, rast->texture);
|
||||
glshim_glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
gl4es_glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
|
||||
if(!glstate->clientstate.vertex_array)
|
||||
{
|
||||
@@ -526,25 +527,25 @@ void render_raster_list(rasterlist_t* rast) {
|
||||
// All the previous states are Pushed / Poped anyway...
|
||||
if (old_tex!=0) gles_glActiveTexture(GL_TEXTURE0+old_tex);
|
||||
if (old_cli!=0) gles_glClientActiveTexture(GL_TEXTURE0+old_cli);
|
||||
glshim_glPopClientAttrib();
|
||||
glshim_glMatrixMode(GL_TEXTURE);
|
||||
glshim_glLoadMatrixf(old_texture);
|
||||
glshim_glMatrixMode(GL_MODELVIEW);
|
||||
glshim_glLoadMatrixf(old_modelview);
|
||||
glshim_glMatrixMode(GL_PROJECTION);
|
||||
glshim_glLoadMatrixf(old_projection);
|
||||
gl4es_glPopClientAttrib();
|
||||
gl4es_glMatrixMode(GL_TEXTURE);
|
||||
gl4es_glLoadMatrixf(old_texture);
|
||||
gl4es_glMatrixMode(GL_MODELVIEW);
|
||||
gl4es_glLoadMatrixf(old_modelview);
|
||||
gl4es_glMatrixMode(GL_PROJECTION);
|
||||
gl4es_glLoadMatrixf(old_projection);
|
||||
#endif
|
||||
glshim_glPopAttrib();
|
||||
gl4es_glPopAttrib();
|
||||
}
|
||||
glstate->raster.rPos.x += rast->xmove;
|
||||
glstate->raster.rPos.y += rast->ymove;
|
||||
}
|
||||
|
||||
//Direct wrapper
|
||||
void glBitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap) AliasExport("glshim_glBitmap");
|
||||
void glDrawPixels(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *data) AliasExport("glshim_glDrawPixels");
|
||||
void glRasterPos3f(GLfloat x, GLfloat y, GLfloat z) AliasExport("glshim_glRasterPos3f");
|
||||
void glWindowPos3f(GLfloat x, GLfloat y, GLfloat z) AliasExport("glshim_glWindowPos3f");
|
||||
void glViewport(GLint x, GLint y, GLsizei width, GLsizei height) AliasExport("glshim_glViewport");
|
||||
void glPixelZoom(GLfloat xfactor, GLfloat yfactor) AliasExport("glshim_glPixelZoom");
|
||||
void glPixelTransferf(GLenum pname, GLfloat param) AliasExport("glshim_glPixelTransferf");
|
||||
void glBitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap) AliasExport("gl4es_glBitmap");
|
||||
void glDrawPixels(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *data) AliasExport("gl4es_glDrawPixels");
|
||||
void glRasterPos3f(GLfloat x, GLfloat y, GLfloat z) AliasExport("gl4es_glRasterPos3f");
|
||||
void glWindowPos3f(GLfloat x, GLfloat y, GLfloat z) AliasExport("gl4es_glWindowPos3f");
|
||||
void glViewport(GLint x, GLint y, GLsizei width, GLsizei height) AliasExport("gl4es_glViewport");
|
||||
void glPixelZoom(GLfloat xfactor, GLfloat yfactor) AliasExport("gl4es_glPixelZoom");
|
||||
void glPixelTransferf(GLenum pname, GLfloat param) AliasExport("gl4es_glPixelTransferf");
|
||||
|
||||
@@ -24,18 +24,18 @@ typedef struct {
|
||||
|
||||
int raster_need_transform();
|
||||
|
||||
void glshim_glBitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig,
|
||||
void gl4es_glBitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig,
|
||||
GLfloat xmove, GLfloat ymove, const GLubyte *bitmap);
|
||||
void glshim_glDrawPixels(GLsizei width, GLsizei height, GLenum format,
|
||||
void gl4es_glDrawPixels(GLsizei width, GLsizei height, GLenum format,
|
||||
GLenum type, const GLvoid *data);
|
||||
void glshim_glRasterPos3f(GLfloat x, GLfloat y, GLfloat z);
|
||||
void glshim_glWindowPos3f(GLfloat x, GLfloat y, GLfloat z);
|
||||
void glshim_glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
void gl4es_glRasterPos3f(GLfloat x, GLfloat y, GLfloat z);
|
||||
void gl4es_glWindowPos3f(GLfloat x, GLfloat y, GLfloat z);
|
||||
void gl4es_glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
void render_raster();
|
||||
|
||||
void glshim_glPixelZoom(GLfloat xfactor, GLfloat yfactor);
|
||||
void gl4es_glPixelZoom(GLfloat xfactor, GLfloat yfactor);
|
||||
|
||||
void glshim_glPixelTransferf(GLenum pname, GLfloat param);
|
||||
void gl4es_glPixelTransferf(GLenum pname, GLfloat param);
|
||||
|
||||
void render_raster_list(rasterlist_t* raster);
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "render.h"
|
||||
#include "init.h"
|
||||
|
||||
void push_hit() {
|
||||
// push current hit to hit list, and re-init current hit
|
||||
@@ -35,7 +36,7 @@ void push_hit() {
|
||||
}
|
||||
|
||||
|
||||
GLint glshim_glRenderMode(GLenum mode) {
|
||||
GLint gl4es_glRenderMode(GLenum mode) {
|
||||
int ret = 0;
|
||||
if ((mode==GL_SELECT) || (mode==GL_RENDER)) { // missing GL_FEEDBACK
|
||||
noerrorShim();
|
||||
@@ -66,7 +67,7 @@ GLint glshim_glRenderMode(GLenum mode) {
|
||||
glstate->gl_batch = 0;
|
||||
flush();
|
||||
}
|
||||
if((mode==GL_RENDER) && (glstate->gl_batch==0) && (gl_batch==1)) {
|
||||
if((mode==GL_RENDER) && (glstate->gl_batch==0) && (globals4es.batch==1)) {
|
||||
glstate->gl_batch = 1;
|
||||
flush();
|
||||
}
|
||||
@@ -75,7 +76,7 @@ GLint glshim_glRenderMode(GLenum mode) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
void glshim_glInitNames() {
|
||||
void gl4es_glInitNames() {
|
||||
if (glstate->namestack.names == 0) {
|
||||
glstate->namestack.names = (GLuint*)malloc(1024*sizeof(GLuint));
|
||||
}
|
||||
@@ -83,7 +84,7 @@ void glshim_glInitNames() {
|
||||
noerrorShim();
|
||||
}
|
||||
|
||||
void glshim_glPopName() {
|
||||
void gl4es_glPopName() {
|
||||
noerrorShim();
|
||||
if (glstate->render_mode != GL_SELECT)
|
||||
return;
|
||||
@@ -94,7 +95,7 @@ void glshim_glPopName() {
|
||||
errorShim(GL_STACK_UNDERFLOW);
|
||||
}
|
||||
|
||||
void glshim_glPushName(GLuint name) {
|
||||
void gl4es_glPushName(GLuint name) {
|
||||
noerrorShim();
|
||||
if (glstate->render_mode != GL_SELECT)
|
||||
return;
|
||||
@@ -106,7 +107,7 @@ void glshim_glPushName(GLuint name) {
|
||||
}
|
||||
}
|
||||
|
||||
void glshim_glLoadName(GLuint name) {
|
||||
void gl4es_glLoadName(GLuint name) {
|
||||
noerrorShim();
|
||||
if (glstate->render_mode != GL_SELECT)
|
||||
return;
|
||||
@@ -118,7 +119,7 @@ void glshim_glLoadName(GLuint name) {
|
||||
glstate->namestack.names[glstate->namestack.top-1] = name;
|
||||
}
|
||||
|
||||
void glshim_glSelectBuffer(GLsizei size, GLuint *buffer) {
|
||||
void gl4es_glSelectBuffer(GLsizei size, GLuint *buffer) {
|
||||
noerrorShim();
|
||||
glstate->selectbuf.buffer = buffer;
|
||||
glstate->selectbuf.size = size;
|
||||
@@ -130,9 +131,9 @@ void init_select() {
|
||||
Initialize matrix and array vector for a select_Draw*
|
||||
*/
|
||||
GLfloat tmp[16];
|
||||
glshim_glGetFloatv(GL_PROJECTION_MATRIX, tmp);
|
||||
gl4es_glGetFloatv(GL_PROJECTION_MATRIX, tmp);
|
||||
matrix_transpose(tmp, projection);
|
||||
glshim_glGetFloatv(GL_MODELVIEW_MATRIX, tmp);
|
||||
gl4es_glGetFloatv(GL_MODELVIEW_MATRIX, tmp);
|
||||
matrix_transpose(tmp, modelview);
|
||||
}
|
||||
|
||||
@@ -418,9 +419,9 @@ void select_glDrawElements(const pointer_state_t* vtx, GLenum mode, GLuint count
|
||||
}
|
||||
|
||||
//Direct wrapper
|
||||
GLint glRenderMode(GLenum mode) AliasExport("glshim_glRenderMode");
|
||||
void glInitNames() AliasExport("glshim_glInitNames");
|
||||
void glPopName() AliasExport("glshim_glPopName");
|
||||
void glPushName(GLuint name) AliasExport("glshim_glPushName");
|
||||
void glLoadName(GLuint name) AliasExport("glshim_glLoadName");
|
||||
void glSelectBuffer(GLsizei size, GLuint *buffer) AliasExport("glshim_glSelectBuffer");
|
||||
GLint glRenderMode(GLenum mode) AliasExport("gl4es_glRenderMode");
|
||||
void glInitNames() AliasExport("gl4es_glInitNames");
|
||||
void glPopName() AliasExport("gl4es_glPopName");
|
||||
void glPushName(GLuint name) AliasExport("gl4es_glPushName");
|
||||
void glLoadName(GLuint name) AliasExport("gl4es_glLoadName");
|
||||
void glSelectBuffer(GLsizei size, GLuint *buffer) AliasExport("gl4es_glSelectBuffer");
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
#define RENDER_H
|
||||
#include "gl.h"
|
||||
|
||||
GLint glshim_glRenderMode(GLenum mode);
|
||||
void glshim_glInitNames();
|
||||
void glshim_glPopName();
|
||||
void glshim_glPushName(GLuint name);
|
||||
void glshim_glLoadName(GLuint name);
|
||||
void glshim_glSelectBuffer(GLsizei size, GLuint *buffer);
|
||||
GLint gl4es_glRenderMode(GLenum mode);
|
||||
void gl4es_glInitNames();
|
||||
void gl4es_glPopName();
|
||||
void gl4es_glPushName(GLuint name);
|
||||
void gl4es_glLoadName(GLuint name);
|
||||
void gl4es_glSelectBuffer(GLsizei size, GLuint *buffer);
|
||||
|
||||
void select_glDrawElements(const pointer_state_t* vtx, GLenum mode, GLuint count, GLenum type, GLvoid * indices);
|
||||
void select_glDrawArrays(const pointer_state_t* vtx, GLenum mode, GLuint first, GLuint count);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "stack.h"
|
||||
#include "../glx/hardext.h"
|
||||
|
||||
void glshim_glPushAttrib(GLbitfield mask) {
|
||||
void gl4es_glPushAttrib(GLbitfield mask) {
|
||||
//printf("glPushAttrib(0x%04X)\n", mask);
|
||||
noerrorShim();
|
||||
if ((glstate->list.compiling || glstate->gl_batch) && glstate->list.active) {
|
||||
@@ -30,80 +30,80 @@ void glshim_glPushAttrib(GLbitfield mask) {
|
||||
|
||||
// TODO: will tracking these myself be much faster than glGet?
|
||||
if (mask & GL_COLOR_BUFFER_BIT) {
|
||||
cur->alpha_test = glshim_glIsEnabled(GL_ALPHA_TEST);
|
||||
glshim_glGetIntegerv(GL_ALPHA_TEST_FUNC, &cur->alpha_test_func);
|
||||
glshim_glGetFloatv(GL_ALPHA_TEST_REF, &cur->alpha_test_ref);
|
||||
cur->alpha_test = gl4es_glIsEnabled(GL_ALPHA_TEST);
|
||||
gl4es_glGetIntegerv(GL_ALPHA_TEST_FUNC, &cur->alpha_test_func);
|
||||
gl4es_glGetFloatv(GL_ALPHA_TEST_REF, &cur->alpha_test_ref);
|
||||
|
||||
cur->blend = glshim_glIsEnabled(GL_BLEND);
|
||||
glshim_glGetIntegerv(GL_BLEND_SRC, &cur->blend_src_func);
|
||||
glshim_glGetIntegerv(GL_BLEND_DST, &cur->blend_dst_func);
|
||||
cur->blend = gl4es_glIsEnabled(GL_BLEND);
|
||||
gl4es_glGetIntegerv(GL_BLEND_SRC, &cur->blend_src_func);
|
||||
gl4es_glGetIntegerv(GL_BLEND_DST, &cur->blend_dst_func);
|
||||
|
||||
cur->dither = glshim_glIsEnabled(GL_DITHER);
|
||||
cur->color_logic_op = glshim_glIsEnabled(GL_COLOR_LOGIC_OP);
|
||||
glshim_glGetIntegerv(GL_LOGIC_OP_MODE, &cur->logic_op);
|
||||
cur->dither = gl4es_glIsEnabled(GL_DITHER);
|
||||
cur->color_logic_op = gl4es_glIsEnabled(GL_COLOR_LOGIC_OP);
|
||||
gl4es_glGetIntegerv(GL_LOGIC_OP_MODE, &cur->logic_op);
|
||||
|
||||
glshim_glGetFloatv(GL_COLOR_CLEAR_VALUE, cur->clear_color);
|
||||
glshim_glGetFloatv(GL_COLOR_WRITEMASK, cur->color_mask);
|
||||
gl4es_glGetFloatv(GL_COLOR_CLEAR_VALUE, cur->clear_color);
|
||||
gl4es_glGetFloatv(GL_COLOR_WRITEMASK, cur->color_mask);
|
||||
}
|
||||
|
||||
if (mask & GL_CURRENT_BIT) {
|
||||
glshim_glGetFloatv(GL_CURRENT_COLOR, cur->color);
|
||||
glshim_glGetFloatv(GL_CURRENT_NORMAL, cur->normal);
|
||||
glshim_glGetFloatv(GL_CURRENT_TEXTURE_COORDS, cur->tex);
|
||||
gl4es_glGetFloatv(GL_CURRENT_COLOR, cur->color);
|
||||
gl4es_glGetFloatv(GL_CURRENT_NORMAL, cur->normal);
|
||||
gl4es_glGetFloatv(GL_CURRENT_TEXTURE_COORDS, cur->tex);
|
||||
}
|
||||
|
||||
if (mask & GL_DEPTH_BUFFER_BIT) {
|
||||
cur->depth_test = glshim_glIsEnabled(GL_DEPTH_TEST);
|
||||
glshim_glGetIntegerv(GL_DEPTH_FUNC, &cur->depth_func);
|
||||
glshim_glGetFloatv(GL_DEPTH_CLEAR_VALUE, &cur->clear_depth);
|
||||
glshim_glGetIntegerv(GL_DEPTH_WRITEMASK, &cur->depth_mask);
|
||||
cur->depth_test = gl4es_glIsEnabled(GL_DEPTH_TEST);
|
||||
gl4es_glGetIntegerv(GL_DEPTH_FUNC, &cur->depth_func);
|
||||
gl4es_glGetFloatv(GL_DEPTH_CLEAR_VALUE, &cur->clear_depth);
|
||||
gl4es_glGetIntegerv(GL_DEPTH_WRITEMASK, &cur->depth_mask);
|
||||
}
|
||||
|
||||
if (mask & GL_ENABLE_BIT) {
|
||||
int i;
|
||||
GLint max_clip_planes;
|
||||
|
||||
cur->alpha_test = glshim_glIsEnabled(GL_ALPHA_TEST);
|
||||
cur->autonormal = glshim_glIsEnabled(GL_AUTO_NORMAL);
|
||||
cur->blend = glshim_glIsEnabled(GL_BLEND);
|
||||
cur->alpha_test = gl4es_glIsEnabled(GL_ALPHA_TEST);
|
||||
cur->autonormal = gl4es_glIsEnabled(GL_AUTO_NORMAL);
|
||||
cur->blend = gl4es_glIsEnabled(GL_BLEND);
|
||||
|
||||
glshim_glGetIntegerv(GL_MAX_CLIP_PLANES, &max_clip_planes);
|
||||
gl4es_glGetIntegerv(GL_MAX_CLIP_PLANES, &max_clip_planes);
|
||||
cur->clip_planes_enabled = (GLboolean *)malloc(max_clip_planes * sizeof(GLboolean));
|
||||
for (i = 0; i < max_clip_planes; i++) {
|
||||
*(cur->clip_planes_enabled + i) = glshim_glIsEnabled(GL_CLIP_PLANE0 + i);
|
||||
*(cur->clip_planes_enabled + i) = gl4es_glIsEnabled(GL_CLIP_PLANE0 + i);
|
||||
}
|
||||
|
||||
cur->colormaterial = glshim_glIsEnabled(GL_COLOR_MATERIAL);
|
||||
cur->cull_face = glshim_glIsEnabled(GL_CULL_FACE);
|
||||
cur->depth_test = glshim_glIsEnabled(GL_DEPTH_TEST);
|
||||
cur->dither = glshim_glIsEnabled(GL_DITHER);
|
||||
cur->fog = glshim_glIsEnabled(GL_FOG);
|
||||
cur->colormaterial = gl4es_glIsEnabled(GL_COLOR_MATERIAL);
|
||||
cur->cull_face = gl4es_glIsEnabled(GL_CULL_FACE);
|
||||
cur->depth_test = gl4es_glIsEnabled(GL_DEPTH_TEST);
|
||||
cur->dither = gl4es_glIsEnabled(GL_DITHER);
|
||||
cur->fog = gl4es_glIsEnabled(GL_FOG);
|
||||
|
||||
cur->lights_enabled = (GLboolean *)malloc(hardext.maxlights * sizeof(GLboolean));
|
||||
for (i = 0; i < hardext.maxlights; i++) {
|
||||
*(cur->lights_enabled + i) = glshim_glIsEnabled(GL_LIGHT0 + i);
|
||||
*(cur->lights_enabled + i) = gl4es_glIsEnabled(GL_LIGHT0 + i);
|
||||
}
|
||||
|
||||
cur->lighting = glshim_glIsEnabled(GL_LIGHTING);
|
||||
cur->line_smooth = glshim_glIsEnabled(GL_LINE_SMOOTH);
|
||||
cur->line_stipple = glshim_glIsEnabled(GL_LINE_STIPPLE);
|
||||
cur->color_logic_op = glshim_glIsEnabled(GL_COLOR_LOGIC_OP);
|
||||
cur->lighting = gl4es_glIsEnabled(GL_LIGHTING);
|
||||
cur->line_smooth = gl4es_glIsEnabled(GL_LINE_SMOOTH);
|
||||
cur->line_stipple = gl4es_glIsEnabled(GL_LINE_STIPPLE);
|
||||
cur->color_logic_op = gl4es_glIsEnabled(GL_COLOR_LOGIC_OP);
|
||||
//TODO: GL_INDEX_LOGIC_OP
|
||||
//TODO: GL_MAP1_x
|
||||
//TODO: GL_MAP2_x
|
||||
cur->multisample = glshim_glIsEnabled(GL_MULTISAMPLE);
|
||||
cur->normalize = glshim_glIsEnabled(GL_NORMALIZE);
|
||||
cur->point_smooth = glshim_glIsEnabled(GL_POINT_SMOOTH);
|
||||
cur->multisample = gl4es_glIsEnabled(GL_MULTISAMPLE);
|
||||
cur->normalize = gl4es_glIsEnabled(GL_NORMALIZE);
|
||||
cur->point_smooth = gl4es_glIsEnabled(GL_POINT_SMOOTH);
|
||||
//TODO: GL_POLYGON_OFFSET_LINE
|
||||
cur->polygon_offset_fill = glshim_glIsEnabled(GL_POLYGON_OFFSET_FILL);
|
||||
cur->polygon_offset_fill = gl4es_glIsEnabled(GL_POLYGON_OFFSET_FILL);
|
||||
//TODO: GL_POLYGON_OFFSET_POINT
|
||||
//TODO: GL_POLYGON_SMOOTH
|
||||
//TODO: GL_POLYGON_STIPPLE
|
||||
cur->sample_alpha_to_coverage = glshim_glIsEnabled(GL_SAMPLE_ALPHA_TO_COVERAGE);
|
||||
cur->sample_alpha_to_one = glshim_glIsEnabled(GL_SAMPLE_ALPHA_TO_ONE);
|
||||
cur->sample_coverage = glshim_glIsEnabled(GL_SAMPLE_COVERAGE);
|
||||
cur->scissor_test = glshim_glIsEnabled(GL_SCISSOR_TEST);
|
||||
cur->stencil_test = glshim_glIsEnabled(GL_STENCIL_TEST);
|
||||
cur->sample_alpha_to_coverage = gl4es_glIsEnabled(GL_SAMPLE_ALPHA_TO_COVERAGE);
|
||||
cur->sample_alpha_to_one = gl4es_glIsEnabled(GL_SAMPLE_ALPHA_TO_ONE);
|
||||
cur->sample_coverage = gl4es_glIsEnabled(GL_SAMPLE_COVERAGE);
|
||||
cur->scissor_test = gl4es_glIsEnabled(GL_SCISSOR_TEST);
|
||||
cur->stencil_test = gl4es_glIsEnabled(GL_STENCIL_TEST);
|
||||
int a;
|
||||
for (a=0; a<hardext.maxtex; a++) {
|
||||
cur->texture_1d[a] = glstate->enable.texture_1d[a];
|
||||
@@ -114,40 +114,42 @@ void glshim_glPushAttrib(GLbitfield mask) {
|
||||
cur->texgen_t[a] = glstate->enable.texgen_t[a];
|
||||
cur->texgen_q[a] = glstate->enable.texgen_q[a];
|
||||
}
|
||||
cur->pointsprite = glshim_glIsEnabled(GL_POINT_SPRITE);
|
||||
cur->pointsprite = gl4es_glIsEnabled(GL_POINT_SPRITE);
|
||||
}
|
||||
|
||||
// TODO: GL_EVAL_BIT
|
||||
|
||||
if (mask & GL_FOG_BIT) {
|
||||
cur->fog = glshim_glIsEnabled(GL_FOG);
|
||||
glshim_glGetFloatv(GL_FOG_COLOR, cur->fog_color);
|
||||
glshim_glGetFloatv(GL_FOG_DENSITY, &cur->fog_density);
|
||||
glshim_glGetFloatv(GL_FOG_START, &cur->fog_start);
|
||||
glshim_glGetFloatv(GL_FOG_END, &cur->fog_end);
|
||||
glshim_glGetIntegerv(GL_FOG_MODE, &cur->fog_mode);
|
||||
cur->fog = gl4es_glIsEnabled(GL_FOG);
|
||||
gl4es_glGetFloatv(GL_FOG_COLOR, cur->fog_color);
|
||||
gl4es_glGetFloatv(GL_FOG_DENSITY, &cur->fog_density);
|
||||
gl4es_glGetFloatv(GL_FOG_START, &cur->fog_start);
|
||||
gl4es_glGetFloatv(GL_FOG_END, &cur->fog_end);
|
||||
gl4es_glGetIntegerv(GL_FOG_MODE, &cur->fog_mode);
|
||||
}
|
||||
|
||||
if (mask & GL_HINT_BIT) {
|
||||
glshim_glGetIntegerv(GL_PERSPECTIVE_CORRECTION_HINT, &cur->perspective_hint);
|
||||
glshim_glGetIntegerv(GL_POINT_SMOOTH_HINT, &cur->point_smooth_hint);
|
||||
glshim_glGetIntegerv(GL_LINE_SMOOTH_HINT, &cur->line_smooth_hint);
|
||||
glshim_glGetIntegerv(GL_FOG_HINT, &cur->fog_hint);
|
||||
glshim_glGetIntegerv(GL_GENERATE_MIPMAP_HINT, &cur->mipmap_hint);
|
||||
gl4es_glGetIntegerv(GL_PERSPECTIVE_CORRECTION_HINT, &cur->perspective_hint);
|
||||
gl4es_glGetIntegerv(GL_POINT_SMOOTH_HINT, &cur->point_smooth_hint);
|
||||
gl4es_glGetIntegerv(GL_LINE_SMOOTH_HINT, &cur->line_smooth_hint);
|
||||
gl4es_glGetIntegerv(GL_FOG_HINT, &cur->fog_hint);
|
||||
gl4es_glGetIntegerv(GL_GENERATE_MIPMAP_HINT, &cur->mipmap_hint);
|
||||
for (int i=GL4ES_HINT_FIRST; i<GL4ES_HINT_LAST; i++)
|
||||
gl4es_glGetIntegerv(i, &cur->gles4_hint[i-GL4ES_HINT_FIRST]);
|
||||
}
|
||||
|
||||
if (mask & GL_LIGHTING_BIT) {
|
||||
cur->lighting = glshim_glIsEnabled(GL_LIGHTING);
|
||||
glshim_glGetFloatv(GL_LIGHT_MODEL_AMBIENT, cur->light_model_ambient);
|
||||
glshim_glGetIntegerv(GL_LIGHT_MODEL_TWO_SIDE, &cur->light_model_two_side);
|
||||
cur->lighting = gl4es_glIsEnabled(GL_LIGHTING);
|
||||
gl4es_glGetFloatv(GL_LIGHT_MODEL_AMBIENT, cur->light_model_ambient);
|
||||
gl4es_glGetIntegerv(GL_LIGHT_MODEL_TWO_SIDE, &cur->light_model_two_side);
|
||||
|
||||
int i;
|
||||
int j=0;
|
||||
cur->lights_enabled = (GLboolean *)malloc(hardext.maxlights * sizeof(GLboolean));
|
||||
cur->lights = (GLfloat *)malloc(hardext.maxlights * sizeof(GLfloat)*(10*4));
|
||||
for (i = 0; i < hardext.maxlights; i++) {
|
||||
*(cur->lights_enabled + i) = glshim_glIsEnabled(GL_LIGHT0 + i);
|
||||
#define L(A) glshim_glGetLightfv(GL_LIGHT0 + i, A, cur->lights+j); j+=4
|
||||
*(cur->lights_enabled + i) = gl4es_glIsEnabled(GL_LIGHT0 + i);
|
||||
#define L(A) gl4es_glGetLightfv(GL_LIGHT0 + i, A, cur->lights+j); j+=4
|
||||
L(GL_AMBIENT);
|
||||
L(GL_DIFFUSE);
|
||||
L(GL_SPECULAR);
|
||||
@@ -162,16 +164,16 @@ void glshim_glPushAttrib(GLbitfield mask) {
|
||||
}
|
||||
j=0;
|
||||
cur->materials = (GLfloat *)malloc(1 * sizeof(GLfloat)*(5*4));
|
||||
#define M(A) glshim_glGetMaterialfv(GL_FRONT, A, cur->materials+j); j+=4
|
||||
#define M(A) gl4es_glGetMaterialfv(GL_FRONT, A, cur->materials+j); j+=4
|
||||
M(GL_AMBIENT); M(GL_DIFFUSE); M(GL_SPECULAR); M(GL_EMISSION); M(GL_SHININESS); // handle both face at some point?
|
||||
#undef M
|
||||
glshim_glGetIntegerv(GL_SHADE_MODEL, &cur->shade_model);
|
||||
gl4es_glGetIntegerv(GL_SHADE_MODEL, &cur->shade_model);
|
||||
}
|
||||
|
||||
if (mask & GL_LINE_BIT) {
|
||||
cur->line_smooth = glshim_glIsEnabled(GL_LINE_SMOOTH);
|
||||
cur->line_smooth = gl4es_glIsEnabled(GL_LINE_SMOOTH);
|
||||
// TODO: stipple stuff here
|
||||
glshim_glGetFloatv(GL_LINE_WIDTH, &cur->line_width);
|
||||
gl4es_glGetFloatv(GL_LINE_WIDTH, &cur->line_width);
|
||||
}
|
||||
|
||||
// GL_LIST_BIT
|
||||
@@ -180,10 +182,10 @@ void glshim_glPushAttrib(GLbitfield mask) {
|
||||
}
|
||||
|
||||
if (mask & GL_MULTISAMPLE_BIT) {
|
||||
cur->multisample = glshim_glIsEnabled(GL_MULTISAMPLE);
|
||||
cur->sample_alpha_to_coverage = glshim_glIsEnabled(GL_SAMPLE_ALPHA_TO_COVERAGE);
|
||||
cur->sample_alpha_to_one = glshim_glIsEnabled(GL_SAMPLE_ALPHA_TO_ONE);
|
||||
cur->sample_coverage = glshim_glIsEnabled(GL_SAMPLE_COVERAGE);
|
||||
cur->multisample = gl4es_glIsEnabled(GL_MULTISAMPLE);
|
||||
cur->sample_alpha_to_coverage = gl4es_glIsEnabled(GL_SAMPLE_ALPHA_TO_COVERAGE);
|
||||
cur->sample_alpha_to_one = gl4es_glIsEnabled(GL_SAMPLE_ALPHA_TO_ONE);
|
||||
cur->sample_coverage = gl4es_glIsEnabled(GL_SAMPLE_COVERAGE);
|
||||
}
|
||||
|
||||
// GL_PIXEL_MODE_BIT
|
||||
@@ -191,19 +193,19 @@ void glshim_glPushAttrib(GLbitfield mask) {
|
||||
GLenum pixel_name[] = {GL_RED_BIAS, GL_RED_SCALE, GL_GREEN_BIAS, GL_GREEN_SCALE, GL_BLUE_BIAS, GL_BLUE_SCALE, GL_ALPHA_BIAS, GL_ALPHA_SCALE};
|
||||
int i;
|
||||
for (i=0; i<8; i++)
|
||||
glshim_glGetFloatv(pixel_name[i], &cur->pixel_scale_bias[i]);
|
||||
gl4es_glGetFloatv(pixel_name[i], &cur->pixel_scale_bias[i]);
|
||||
//TODO: GL_DEPTH_BIAS & GL_DEPTH_SCALE (probably difficult)
|
||||
//TODO: GL_INDEX_OFFEST & GL_INDEX_SHIFT
|
||||
//TODO: GL_MAP_COLOR & GL_MAP_STENCIL (probably difficult too)
|
||||
glshim_glGetFloatv(GL_ZOOM_X, &cur->pixel_zoomx);
|
||||
glshim_glGetFloatv(GL_ZOOM_Y, &cur->pixel_zoomy);
|
||||
gl4es_glGetFloatv(GL_ZOOM_X, &cur->pixel_zoomx);
|
||||
gl4es_glGetFloatv(GL_ZOOM_Y, &cur->pixel_zoomy);
|
||||
}
|
||||
|
||||
if (mask & GL_POINT_BIT) {
|
||||
cur->point_smooth = glshim_glIsEnabled(GL_POINT_SMOOTH);
|
||||
glshim_glGetFloatv(GL_POINT_SIZE, &cur->point_size);
|
||||
cur->point_smooth = gl4es_glIsEnabled(GL_POINT_SMOOTH);
|
||||
gl4es_glGetFloatv(GL_POINT_SIZE, &cur->point_size);
|
||||
if(hardext.pointsprite) {
|
||||
cur->pointsprite = glshim_glIsEnabled(GL_POINT_SPRITE);
|
||||
cur->pointsprite = gl4es_glIsEnabled(GL_POINT_SPRITE);
|
||||
int a;
|
||||
for (a=0; a<hardext.maxtex; a++) {
|
||||
cur->pscoordreplace[a] = glstate->texture.pscoordreplace[a];
|
||||
@@ -215,25 +217,25 @@ void glshim_glPushAttrib(GLbitfield mask) {
|
||||
// TODO: GL_POLYGON_STIPPLE_BIT
|
||||
|
||||
if (mask & GL_SCISSOR_BIT) {
|
||||
cur->scissor_test = glshim_glIsEnabled(GL_SCISSOR_TEST);
|
||||
glshim_glGetFloatv(GL_SCISSOR_BOX, cur->scissor_box);
|
||||
cur->scissor_test = gl4es_glIsEnabled(GL_SCISSOR_TEST);
|
||||
gl4es_glGetFloatv(GL_SCISSOR_BOX, cur->scissor_box);
|
||||
}
|
||||
|
||||
// TODO: GL_STENCIL_BUFFER_BIT
|
||||
if (mask & GL_STENCIL_BUFFER_BIT) {
|
||||
cur->stencil_test = glshim_glIsEnabled(GL_STENCIL_TEST);
|
||||
glshim_glGetIntegerv(GL_STENCIL_FUNC, &cur->stencil_func);
|
||||
glshim_glGetIntegerv(GL_STENCIL_VALUE_MASK, &cur->stencil_mask);
|
||||
glshim_glGetIntegerv(GL_STENCIL_REF, &cur->stencil_ref);
|
||||
cur->stencil_test = gl4es_glIsEnabled(GL_STENCIL_TEST);
|
||||
gl4es_glGetIntegerv(GL_STENCIL_FUNC, &cur->stencil_func);
|
||||
gl4es_glGetIntegerv(GL_STENCIL_VALUE_MASK, &cur->stencil_mask);
|
||||
gl4es_glGetIntegerv(GL_STENCIL_REF, &cur->stencil_ref);
|
||||
//TODO: glStencilFuncSeperate
|
||||
|
||||
//TODO: Stencil value mask
|
||||
glshim_glGetIntegerv(GL_STENCIL_FAIL, &cur->stencil_sfail);
|
||||
glshim_glGetIntegerv(GL_STENCIL_PASS_DEPTH_FAIL, &cur->stencil_dpfail);
|
||||
glshim_glGetIntegerv(GL_STENCIL_PASS_DEPTH_PASS, &cur->stencil_dppass);
|
||||
gl4es_glGetIntegerv(GL_STENCIL_FAIL, &cur->stencil_sfail);
|
||||
gl4es_glGetIntegerv(GL_STENCIL_PASS_DEPTH_FAIL, &cur->stencil_dpfail);
|
||||
gl4es_glGetIntegerv(GL_STENCIL_PASS_DEPTH_PASS, &cur->stencil_dppass);
|
||||
//TODO: glStencilOpSeparate
|
||||
|
||||
glshim_glGetIntegerv(GL_STENCIL_CLEAR_VALUE, &cur->stencil_clearvalue);
|
||||
gl4es_glGetIntegerv(GL_STENCIL_CLEAR_VALUE, &cur->stencil_clearvalue);
|
||||
//TODO: Stencil buffer writemask
|
||||
}
|
||||
// GL_TEXTURE_BIT - TODO: incomplete
|
||||
@@ -256,26 +258,26 @@ void glshim_glPushAttrib(GLbitfield mask) {
|
||||
if (!(mask & GL_ENABLE_BIT)) {
|
||||
int i;
|
||||
GLint max_clip_planes;
|
||||
glshim_glGetIntegerv(GL_MAX_CLIP_PLANES, &max_clip_planes);
|
||||
gl4es_glGetIntegerv(GL_MAX_CLIP_PLANES, &max_clip_planes);
|
||||
cur->clip_planes_enabled = (GLboolean *)malloc(max_clip_planes * sizeof(GLboolean));
|
||||
for (i = 0; i < max_clip_planes; i++) {
|
||||
*(cur->clip_planes_enabled + i) = glshim_glIsEnabled(GL_CLIP_PLANE0 + i);
|
||||
*(cur->clip_planes_enabled + i) = gl4es_glIsEnabled(GL_CLIP_PLANE0 + i);
|
||||
}
|
||||
}
|
||||
glshim_glGetIntegerv(GL_MATRIX_MODE, &cur->matrix_mode);
|
||||
cur->rescale_normal_flag = glshim_glIsEnabled(GL_RESCALE_NORMAL);
|
||||
cur->normalize_flag = glshim_glIsEnabled(GL_NORMALIZE);
|
||||
gl4es_glGetIntegerv(GL_MATRIX_MODE, &cur->matrix_mode);
|
||||
cur->rescale_normal_flag = gl4es_glIsEnabled(GL_RESCALE_NORMAL);
|
||||
cur->normalize_flag = gl4es_glIsEnabled(GL_NORMALIZE);
|
||||
}
|
||||
// GL_VIEWPORT_BIT
|
||||
if (mask & GL_VIEWPORT_BIT) {
|
||||
glshim_glGetIntegerv(GL_VIEWPORT, cur->viewport_size);
|
||||
glshim_glGetFloatv(GL_DEPTH_RANGE, cur->depth_range);
|
||||
gl4es_glGetIntegerv(GL_VIEWPORT, cur->viewport_size);
|
||||
gl4es_glGetFloatv(GL_DEPTH_RANGE, cur->depth_range);
|
||||
}
|
||||
|
||||
glstate->stack->len++;
|
||||
}
|
||||
|
||||
void glshim_glPushClientAttrib(GLbitfield mask) {
|
||||
void gl4es_glPushClientAttrib(GLbitfield mask) {
|
||||
noerrorShim();
|
||||
GLuint old_glbatch = glstate->gl_batch;
|
||||
if (glstate->gl_batch) {
|
||||
@@ -295,8 +297,8 @@ void glshim_glPushClientAttrib(GLbitfield mask) {
|
||||
cur->mask = mask;
|
||||
|
||||
if (mask & GL_CLIENT_PIXEL_STORE_BIT) {
|
||||
glshim_glGetIntegerv(GL_PACK_ALIGNMENT, &cur->pack_align);
|
||||
glshim_glGetIntegerv(GL_UNPACK_ALIGNMENT, &cur->unpack_align);
|
||||
gl4es_glGetIntegerv(GL_PACK_ALIGNMENT, &cur->pack_align);
|
||||
gl4es_glGetIntegerv(GL_UNPACK_ALIGNMENT, &cur->unpack_align);
|
||||
cur->unpack_row_length = glstate->texture.unpack_row_length;
|
||||
cur->unpack_skip_pixels = glstate->texture.unpack_skip_pixels;
|
||||
cur->unpack_skip_rows = glstate->texture.unpack_skip_rows;
|
||||
@@ -326,14 +328,14 @@ void glshim_glPushClientAttrib(GLbitfield mask) {
|
||||
if (x) free(x)
|
||||
|
||||
#define enable_disable(pname, enabled) \
|
||||
if (enabled) glshim_glEnable(pname); \
|
||||
else glshim_glDisable(pname)
|
||||
if (enabled) gl4es_glEnable(pname); \
|
||||
else gl4es_glDisable(pname)
|
||||
|
||||
#define v2(c) c[0], c[1]
|
||||
#define v3(c) v2(c), c[2]
|
||||
#define v4(c) v3(c), c[3]
|
||||
|
||||
void glshim_glPopAttrib() {
|
||||
void gl4es_glPopAttrib() {
|
||||
//printf("glPopAttrib()\n");
|
||||
noerrorShim();
|
||||
if ((glstate->list.compiling || glstate->gl_batch) && glstate->list.active) {
|
||||
@@ -350,31 +352,31 @@ void glshim_glPopAttrib() {
|
||||
|
||||
if (cur->mask & GL_COLOR_BUFFER_BIT) {
|
||||
enable_disable(GL_ALPHA_TEST, cur->alpha_test);
|
||||
glshim_glAlphaFunc(cur->alpha_test_func, cur->alpha_test_ref);
|
||||
gl4es_glAlphaFunc(cur->alpha_test_func, cur->alpha_test_ref);
|
||||
|
||||
enable_disable(GL_BLEND, cur->blend);
|
||||
glshim_glBlendFunc(cur->blend_src_func, cur->blend_dst_func);
|
||||
gl4es_glBlendFunc(cur->blend_src_func, cur->blend_dst_func);
|
||||
|
||||
enable_disable(GL_DITHER, cur->dither);
|
||||
enable_disable(GL_COLOR_LOGIC_OP, cur->color_logic_op);
|
||||
glshim_glLogicOp(cur->logic_op);
|
||||
gl4es_glLogicOp(cur->logic_op);
|
||||
|
||||
GLfloat *c;
|
||||
glshim_glClearColor(v4(cur->clear_color));
|
||||
glshim_glColorMask(v4(cur->color_mask));
|
||||
gl4es_glClearColor(v4(cur->clear_color));
|
||||
gl4es_glColorMask(v4(cur->color_mask));
|
||||
}
|
||||
|
||||
if (cur->mask & GL_CURRENT_BIT) {
|
||||
glshim_glColor4f(v4(cur->color));
|
||||
glshim_glNormal3f(v3(cur->normal));
|
||||
glshim_glTexCoord4f(v4(cur->tex));
|
||||
gl4es_glColor4f(v4(cur->color));
|
||||
gl4es_glNormal3f(v3(cur->normal));
|
||||
gl4es_glTexCoord4f(v4(cur->tex));
|
||||
}
|
||||
|
||||
if (cur->mask & GL_DEPTH_BUFFER_BIT) {
|
||||
enable_disable(GL_DEPTH_TEST, cur->depth_test);
|
||||
glshim_glDepthFunc(cur->depth_func);
|
||||
glshim_glClearDepth(cur->clear_depth);
|
||||
glshim_glDepthMask(cur->depth_mask);
|
||||
gl4es_glDepthFunc(cur->depth_func);
|
||||
gl4es_glClearDepth(cur->clear_depth);
|
||||
gl4es_glDepthMask(cur->depth_mask);
|
||||
}
|
||||
|
||||
if (cur->mask & GL_ENABLE_BIT) {
|
||||
@@ -385,7 +387,7 @@ void glshim_glPopAttrib() {
|
||||
enable_disable(GL_BLEND, cur->blend);
|
||||
|
||||
GLint max_clip_planes;
|
||||
glshim_glGetIntegerv(GL_MAX_CLIP_PLANES, &max_clip_planes);
|
||||
gl4es_glGetIntegerv(GL_MAX_CLIP_PLANES, &max_clip_planes);
|
||||
for (i = 0; i < max_clip_planes; i++) {
|
||||
enable_disable(GL_CLIP_PLANE0 + i, *(cur->clip_planes_enabled + i));
|
||||
}
|
||||
@@ -425,15 +427,15 @@ void glshim_glPopAttrib() {
|
||||
int old_tex = glstate->texture.active;
|
||||
for (a=0; a<hardext.maxtex; a++) {
|
||||
if (glstate->enable.texture_1d[a] != cur->texture_1d[a]) {
|
||||
glshim_glActiveTexture(GL_TEXTURE0+a);
|
||||
gl4es_glActiveTexture(GL_TEXTURE0+a);
|
||||
enable_disable(GL_TEXTURE_1D, cur->texture_1d[a]);
|
||||
}
|
||||
if (glstate->enable.texture_2d[a] != cur->texture_2d[a]) {
|
||||
glshim_glActiveTexture(GL_TEXTURE0+a);
|
||||
gl4es_glActiveTexture(GL_TEXTURE0+a);
|
||||
enable_disable(GL_TEXTURE_2D, cur->texture_2d[a]);
|
||||
}
|
||||
if (glstate->enable.texture_3d[a] != cur->texture_3d[a]) {
|
||||
glshim_glActiveTexture(GL_TEXTURE0+a);
|
||||
gl4es_glActiveTexture(GL_TEXTURE0+a);
|
||||
enable_disable(GL_TEXTURE_3D, cur->texture_3d[a]);
|
||||
}
|
||||
glstate->enable.texgen_r[a] = cur->texgen_r[a];
|
||||
@@ -441,36 +443,38 @@ void glshim_glPopAttrib() {
|
||||
glstate->enable.texgen_t[a] = cur->texgen_t[a];
|
||||
glstate->enable.texgen_q[a] = cur->texgen_q[a];
|
||||
}
|
||||
if (glstate->texture.active != old_tex) glshim_glActiveTexture(GL_TEXTURE0+old_tex);
|
||||
if (glstate->texture.active != old_tex) gl4es_glActiveTexture(GL_TEXTURE0+old_tex);
|
||||
}
|
||||
|
||||
if (cur->mask & GL_FOG_BIT) {
|
||||
enable_disable(GL_FOG, cur->fog);
|
||||
glshim_glFogfv(GL_FOG_COLOR, cur->fog_color);
|
||||
glshim_glFogf(GL_FOG_DENSITY, cur->fog_density);
|
||||
glshim_glFogf(GL_FOG_START, cur->fog_start);
|
||||
glshim_glFogf(GL_FOG_END, cur->fog_end);
|
||||
glshim_glFogf(GL_FOG_MODE, cur->fog_mode);
|
||||
gl4es_glFogfv(GL_FOG_COLOR, cur->fog_color);
|
||||
gl4es_glFogf(GL_FOG_DENSITY, cur->fog_density);
|
||||
gl4es_glFogf(GL_FOG_START, cur->fog_start);
|
||||
gl4es_glFogf(GL_FOG_END, cur->fog_end);
|
||||
gl4es_glFogf(GL_FOG_MODE, cur->fog_mode);
|
||||
}
|
||||
|
||||
if (cur->mask & GL_HINT_BIT) {
|
||||
glshim_glHint(GL_PERSPECTIVE_CORRECTION_HINT, cur->perspective_hint);
|
||||
glshim_glHint(GL_POINT_SMOOTH_HINT, cur->point_smooth_hint);
|
||||
glshim_glHint(GL_LINE_SMOOTH_HINT, cur->line_smooth_hint);
|
||||
glshim_glHint(GL_FOG_HINT, cur->fog_hint);
|
||||
glshim_glHint(GL_GENERATE_MIPMAP_HINT, cur->mipmap_hint);
|
||||
gl4es_glHint(GL_PERSPECTIVE_CORRECTION_HINT, cur->perspective_hint);
|
||||
gl4es_glHint(GL_POINT_SMOOTH_HINT, cur->point_smooth_hint);
|
||||
gl4es_glHint(GL_LINE_SMOOTH_HINT, cur->line_smooth_hint);
|
||||
gl4es_glHint(GL_FOG_HINT, cur->fog_hint);
|
||||
gl4es_glHint(GL_GENERATE_MIPMAP_HINT, cur->mipmap_hint);
|
||||
for (int i=GL4ES_HINT_FIRST; i<GL4ES_HINT_LAST; i++)
|
||||
gl4es_glHint(i, cur->gles4_hint[i-GL4ES_HINT_FIRST]);
|
||||
}
|
||||
|
||||
if (cur->mask & GL_LIGHTING_BIT) {
|
||||
enable_disable(GL_LIGHTING, cur->lighting);
|
||||
glshim_glLightModelfv(GL_LIGHT_MODEL_AMBIENT, cur->light_model_ambient);
|
||||
glshim_glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, cur->light_model_two_side);
|
||||
gl4es_glLightModelfv(GL_LIGHT_MODEL_AMBIENT, cur->light_model_ambient);
|
||||
gl4es_glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, cur->light_model_two_side);
|
||||
|
||||
int i;
|
||||
int j=0;
|
||||
for (i = 0; i < hardext.maxlights; i++) {
|
||||
enable_disable(GL_LIGHT0 + i, *(cur->lights_enabled + i));
|
||||
#define L(A) glshim_glLightfv(GL_LIGHT0 + i, A, cur->lights+j); j+=4
|
||||
#define L(A) gl4es_glLightfv(GL_LIGHT0 + i, A, cur->lights+j); j+=4
|
||||
L(GL_AMBIENT);
|
||||
L(GL_DIFFUSE);
|
||||
L(GL_SPECULAR);
|
||||
@@ -484,22 +488,22 @@ void glshim_glPopAttrib() {
|
||||
#undef L
|
||||
}
|
||||
j=0;
|
||||
#define M(A) glshim_glMaterialfv(GL_FRONT_AND_BACK, A, cur->materials+j); j+=4
|
||||
#define M(A) gl4es_glMaterialfv(GL_FRONT_AND_BACK, A, cur->materials+j); j+=4
|
||||
M(GL_AMBIENT); M(GL_DIFFUSE); M(GL_SPECULAR); M(GL_EMISSION); M(GL_SHININESS); // handle both face at some point?
|
||||
#undef M
|
||||
|
||||
glshim_glShadeModel(cur->shade_model);
|
||||
gl4es_glShadeModel(cur->shade_model);
|
||||
}
|
||||
|
||||
// GL_LIST_BIT
|
||||
if (cur->mask & GL_LIST_BIT) {
|
||||
glshim_glListBase(cur->list_base);
|
||||
gl4es_glListBase(cur->list_base);
|
||||
}
|
||||
|
||||
if (cur->mask & GL_LINE_BIT) {
|
||||
enable_disable(GL_LINE_SMOOTH, cur->line_smooth);
|
||||
// TODO: stipple stuff here
|
||||
glshim_glLineWidth(cur->line_width);
|
||||
gl4es_glLineWidth(cur->line_width);
|
||||
}
|
||||
|
||||
if (cur->mask & GL_MULTISAMPLE_BIT) {
|
||||
@@ -511,31 +515,31 @@ void glshim_glPopAttrib() {
|
||||
|
||||
if (cur->mask & GL_POINT_BIT) {
|
||||
enable_disable(GL_POINT_SMOOTH, cur->point_smooth);
|
||||
glshim_glPointSize(cur->point_size);
|
||||
gl4es_glPointSize(cur->point_size);
|
||||
if(hardext.pointsprite) {
|
||||
enable_disable(GL_POINT_SPRITE, cur->pointsprite);
|
||||
int a;
|
||||
for (a=0; a<hardext.maxtex; a++) {
|
||||
if(glstate->texture.pscoordreplace[a]!=cur->pscoordreplace[a]) {
|
||||
glshim_glActiveTexture(GL_TEXTURE0+a);
|
||||
glshim_glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, cur->pscoordreplace[a]);
|
||||
gl4es_glActiveTexture(GL_TEXTURE0+a);
|
||||
gl4es_glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, cur->pscoordreplace[a]);
|
||||
}
|
||||
}
|
||||
if (glstate->texture.active!= cur->active) glshim_glActiveTexture(GL_TEXTURE0+cur->active);
|
||||
if (glstate->texture.active!= cur->active) gl4es_glActiveTexture(GL_TEXTURE0+cur->active);
|
||||
}
|
||||
}
|
||||
|
||||
if (cur->mask & GL_SCISSOR_BIT) {
|
||||
enable_disable(GL_SCISSOR_TEST, cur->scissor_test);
|
||||
glshim_glScissor(v4(cur->scissor_box));
|
||||
gl4es_glScissor(v4(cur->scissor_box));
|
||||
}
|
||||
|
||||
if (cur->mask & GL_STENCIL_BUFFER_BIT) {
|
||||
enable_disable(GL_STENCIL_TEST, cur->stencil_test);
|
||||
glshim_glStencilFunc(cur->stencil_func, cur->stencil_ref, cur->stencil_mask);
|
||||
gl4es_glStencilFunc(cur->stencil_func, cur->stencil_ref, cur->stencil_mask);
|
||||
//TODO: Stencil value mask
|
||||
glshim_glStencilOp(cur->stencil_sfail, cur->stencil_dpfail, cur->stencil_dppass);
|
||||
glshim_glClearStencil(cur->stencil_clearvalue);
|
||||
gl4es_glStencilOp(cur->stencil_sfail, cur->stencil_dpfail, cur->stencil_dppass);
|
||||
gl4es_glClearStencil(cur->stencil_clearvalue);
|
||||
//TODO: Stencil buffer writemask
|
||||
}
|
||||
|
||||
@@ -549,41 +553,41 @@ void glshim_glPopAttrib() {
|
||||
glstate->enable.texgen_q[a] = cur->texgen_q[a];
|
||||
glstate->texgen[a] = cur->texgen[a]; // all mode and planes per texture in 1 line
|
||||
if ((cur->texture[a]==0 && glstate->texture.bound[a] != 0) || (cur->texture[a]!=0 && glstate->texture.bound[a]==0)) {
|
||||
glshim_glActiveTexture(GL_TEXTURE0+a);
|
||||
glshim_glBindTexture(GL_TEXTURE_2D, cur->texture[a]);
|
||||
gl4es_glActiveTexture(GL_TEXTURE0+a);
|
||||
gl4es_glBindTexture(GL_TEXTURE_2D, cur->texture[a]);
|
||||
}
|
||||
}
|
||||
if (glstate->texture.active!= cur->active) glshim_glActiveTexture(GL_TEXTURE0+cur->active);
|
||||
if (glstate->texture.active!= cur->active) gl4es_glActiveTexture(GL_TEXTURE0+cur->active);
|
||||
}
|
||||
|
||||
if (cur->mask & GL_PIXEL_MODE_BIT) {
|
||||
GLenum pixel_name[] = {GL_RED_BIAS, GL_RED_SCALE, GL_GREEN_BIAS, GL_GREEN_SCALE, GL_BLUE_BIAS, GL_BLUE_SCALE, GL_ALPHA_BIAS, GL_ALPHA_SCALE};
|
||||
int i;
|
||||
for (i=0; i<8; i++)
|
||||
glshim_glPixelTransferf(pixel_name[i], cur->pixel_scale_bias[i]);
|
||||
gl4es_glPixelTransferf(pixel_name[i], cur->pixel_scale_bias[i]);
|
||||
//TODO: GL_DEPTH_BIAS & GL_DEPTH_SCALE (probably difficult)
|
||||
//TODO: GL_INDEX_OFFEST & GL_INDEX_SHIFT
|
||||
//TODO: GL_MAP_COLOR & GL_MAP_STENCIL (probably difficult too)
|
||||
glshim_glPixelZoom(cur->pixel_zoomx, cur->pixel_zoomy);
|
||||
gl4es_glPixelZoom(cur->pixel_zoomx, cur->pixel_zoomy);
|
||||
}
|
||||
|
||||
if (cur->mask & GL_TRANSFORM_BIT) {
|
||||
if (!(cur->mask & GL_ENABLE_BIT)) {
|
||||
int i;
|
||||
GLint max_clip_planes;
|
||||
glshim_glGetIntegerv(GL_MAX_CLIP_PLANES, &max_clip_planes);
|
||||
gl4es_glGetIntegerv(GL_MAX_CLIP_PLANES, &max_clip_planes);
|
||||
for (i = 0; i < max_clip_planes; i++) {
|
||||
enable_disable(GL_CLIP_PLANE0 + i, *(cur->clip_planes_enabled + i));
|
||||
}
|
||||
}
|
||||
glshim_glMatrixMode(cur->matrix_mode);
|
||||
gl4es_glMatrixMode(cur->matrix_mode);
|
||||
enable_disable(GL_NORMALIZE, cur->normalize_flag);
|
||||
enable_disable(GL_RESCALE_NORMAL, cur->rescale_normal_flag);
|
||||
}
|
||||
|
||||
if (cur->mask & GL_VIEWPORT_BIT) {
|
||||
glshim_glViewport(cur->viewport_size[0], cur->viewport_size[1], cur->viewport_size[2], cur->viewport_size[3]);
|
||||
glshim_glDepthRangef(cur->depth_range[0], cur->depth_range[1]);
|
||||
gl4es_glViewport(cur->viewport_size[0], cur->viewport_size[1], cur->viewport_size[2], cur->viewport_size[3]);
|
||||
gl4es_glDepthRangef(cur->depth_range[0], cur->depth_range[1]);
|
||||
}
|
||||
|
||||
maybe_free(cur->clip_planes_enabled);
|
||||
@@ -596,10 +600,10 @@ void glshim_glPopAttrib() {
|
||||
|
||||
#undef enable_disable
|
||||
#define enable_disable(pname, enabled) \
|
||||
if (enabled) glshim_glEnableClientState(pname); \
|
||||
else glshim_glDisableClientState(pname)
|
||||
if (enabled) gl4es_glEnableClientState(pname); \
|
||||
else gl4es_glDisableClientState(pname)
|
||||
|
||||
void glshim_glPopClientAttrib() {
|
||||
void gl4es_glPopClientAttrib() {
|
||||
noerrorShim();
|
||||
GLuint old_glbatch = glstate->gl_batch;
|
||||
if (glstate->gl_batch) {
|
||||
@@ -618,14 +622,14 @@ void glshim_glPopClientAttrib() {
|
||||
|
||||
glclientstack_t *cur = glstate->clientStack + glstate->clientStack->len-1;
|
||||
if (cur->mask & GL_CLIENT_PIXEL_STORE_BIT) {
|
||||
glshim_glPixelStorei(GL_PACK_ALIGNMENT, cur->pack_align);
|
||||
glshim_glPixelStorei(GL_UNPACK_ALIGNMENT, cur->unpack_align);
|
||||
glshim_glPixelStorei(GL_UNPACK_ROW_LENGTH, cur->unpack_row_length);
|
||||
glshim_glPixelStorei(GL_UNPACK_SKIP_PIXELS, cur->unpack_skip_pixels);
|
||||
glshim_glPixelStorei(GL_UNPACK_SKIP_ROWS, cur->unpack_skip_rows);
|
||||
glshim_glPixelStorei(GL_PACK_ROW_LENGTH, cur->pack_row_length);
|
||||
glshim_glPixelStorei(GL_PACK_SKIP_PIXELS, cur->pack_skip_pixels);
|
||||
glshim_glPixelStorei(GL_PACK_SKIP_ROWS, cur->pack_skip_rows);
|
||||
gl4es_glPixelStorei(GL_PACK_ALIGNMENT, cur->pack_align);
|
||||
gl4es_glPixelStorei(GL_UNPACK_ALIGNMENT, cur->unpack_align);
|
||||
gl4es_glPixelStorei(GL_UNPACK_ROW_LENGTH, cur->unpack_row_length);
|
||||
gl4es_glPixelStorei(GL_UNPACK_SKIP_PIXELS, cur->unpack_skip_pixels);
|
||||
gl4es_glPixelStorei(GL_UNPACK_SKIP_ROWS, cur->unpack_skip_rows);
|
||||
gl4es_glPixelStorei(GL_PACK_ROW_LENGTH, cur->pack_row_length);
|
||||
gl4es_glPixelStorei(GL_PACK_SKIP_PIXELS, cur->pack_skip_pixels);
|
||||
gl4es_glPixelStorei(GL_PACK_SKIP_ROWS, cur->pack_skip_rows);
|
||||
}
|
||||
|
||||
if (cur->mask & GL_CLIENT_VERTEX_ARRAY_BIT) {
|
||||
@@ -639,13 +643,13 @@ void glshim_glPopClientAttrib() {
|
||||
enable_disable(GL_SECONDARY_COLOR_ARRAY, cur->secondary_enable);
|
||||
for (int a=0; a<hardext.maxtex; a++) {
|
||||
if (glstate->vao->tex_coord_array[a] != cur->tex_enable[a]) {
|
||||
glshim_glClientActiveTexture(GL_TEXTURE0+a);
|
||||
gl4es_glClientActiveTexture(GL_TEXTURE0+a);
|
||||
enable_disable(GL_TEXTURE_COORD_ARRAY, cur->tex_enable[a]);
|
||||
}
|
||||
}
|
||||
|
||||
memcpy(&glstate->vao->pointers, &(cur->pointers), sizeof(pointer_states_t));
|
||||
if (glstate->texture.client != cur->client) glshim_glClientActiveTexture(GL_TEXTURE0+cur->client);
|
||||
if (glstate->texture.client != cur->client) gl4es_glClientActiveTexture(GL_TEXTURE0+cur->client);
|
||||
}
|
||||
|
||||
glstate->clientStack->len--;
|
||||
@@ -659,7 +663,7 @@ void glshim_glPopClientAttrib() {
|
||||
#undef v4
|
||||
|
||||
//Direct wrapper
|
||||
void glPushClientAttrib(GLbitfield mask) AliasExport("glshim_glPushClientAttrib");
|
||||
void glPopClientAttrib() AliasExport("glshim_glPopClientAttrib");
|
||||
void glPushAttrib(GLbitfield mask) AliasExport("glshim_glPushAttrib");
|
||||
void glPopAttrib() AliasExport("glshim_glPopAttrib");
|
||||
void glPushClientAttrib(GLbitfield mask) AliasExport("gl4es_glPushClientAttrib");
|
||||
void glPopClientAttrib() AliasExport("gl4es_glPopClientAttrib");
|
||||
void glPushAttrib(GLbitfield mask) AliasExport("gl4es_glPushAttrib");
|
||||
void glPopAttrib() AliasExport("gl4es_glPopAttrib");
|
||||
@@ -1,11 +1,16 @@
|
||||
#include "gl.h"
|
||||
#include "state.h"
|
||||
#include <gl4eshint.h>
|
||||
|
||||
#ifndef GL_STACK_H
|
||||
#define GL_STACK_H
|
||||
|
||||
#define STACK_SIZE 16
|
||||
|
||||
#define GL4ES_HINT_FIRST GL_SHRINK_HINT_GL4ES
|
||||
#define GL4ES_HINT_LAST (GL_NOERROR_HINT_GL4ES + 1)
|
||||
|
||||
|
||||
typedef struct _glstack_t {
|
||||
GLbitfield mask;
|
||||
|
||||
@@ -78,6 +83,7 @@ typedef struct _glstack_t {
|
||||
GLint line_smooth_hint;
|
||||
GLint fog_hint;
|
||||
GLint mipmap_hint;
|
||||
GLint gles4_hint[GL4ES_HINT_LAST-GL4ES_HINT_FIRST];
|
||||
|
||||
// GL_LIGHTING_BIT
|
||||
GLboolean lighting;
|
||||
@@ -170,9 +176,9 @@ typedef struct _glclientstack_t {
|
||||
unsigned int cap;
|
||||
} glclientstack_t;
|
||||
|
||||
void glshim_glPushClientAttrib(GLbitfield mask);
|
||||
void glshim_glPopClientAttrib();
|
||||
void glshim_glPushAttrib(GLbitfield mask);
|
||||
void glshim_glPopAttrib();
|
||||
void gl4es_glPushClientAttrib(GLbitfield mask);
|
||||
void gl4es_glPopClientAttrib();
|
||||
void gl4es_glPushAttrib(GLbitfield mask);
|
||||
void gl4es_glPopAttrib();
|
||||
|
||||
#endif
|
||||
|
||||
@@ -172,6 +172,7 @@ typedef struct {
|
||||
matrixstack_t *modelview_matrix;
|
||||
matrixstack_t *projection_matrix;
|
||||
matrixstack_t **texture_matrix;
|
||||
int matrix_mode;
|
||||
selectbuf_t selectbuf;
|
||||
khash_t(glvao) *vaos;
|
||||
khash_t(buff) *buffers;
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
|
||||
//extern void* eglGetProcAddress(const char*);
|
||||
|
||||
void glshim_glTexGeni(GLenum coord, GLenum pname, GLint param) {
|
||||
void gl4es_glTexGeni(GLenum coord, GLenum pname, GLint param) {
|
||||
GLfloat params[4] = {0,0,0,0};
|
||||
params[0]=param;
|
||||
glshim_glTexGenfv(coord, pname, params);
|
||||
gl4es_glTexGenfv(coord, pname, params);
|
||||
}
|
||||
|
||||
void glshim_glTexGenfv(GLenum coord, GLenum pname, const GLfloat *param) {
|
||||
void gl4es_glTexGenfv(GLenum coord, GLenum pname, const GLfloat *param) {
|
||||
|
||||
/*
|
||||
If pname is GL_TEXTURE_GEN_MODE, then the array must contain
|
||||
@@ -80,8 +80,8 @@ void glshim_glTexGenfv(GLenum coord, GLenum pname, const GLfloat *param) {
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
}
|
||||
}
|
||||
void glshim_glGetTexGenfv(GLenum coord,GLenum pname,GLfloat *params) {
|
||||
if (gl_batch) flush();
|
||||
void gl4es_glGetTexGenfv(GLenum coord,GLenum pname,GLfloat *params) {
|
||||
if (glstate->gl_batch) flush();
|
||||
noerrorShim();
|
||||
switch(pname) {
|
||||
case GL_TEXTURE_GEN_MODE:
|
||||
@@ -134,236 +134,6 @@ void glshim_glGetTexGenfv(GLenum coord,GLenum pname,GLfloat *params) {
|
||||
}
|
||||
|
||||
|
||||
GLfloat FASTMATH dot(const GLfloat *a, const GLfloat *b) {
|
||||
return a[0]*b[0] + a[1]*b[1] + a[2]*b[2];
|
||||
}
|
||||
|
||||
GLfloat FASTMATH dot4(const GLfloat *a, const GLfloat *b) {
|
||||
#ifdef __ARM_NEON__
|
||||
register float ret;
|
||||
asm volatile (
|
||||
"vld1.f32 {d0-d1}, [%1] \n" //q0 = a(0..3)
|
||||
"vld1.f32 {d2-d3}, [%2] \n" //q1 = b(0..3)
|
||||
"vmul.f32 q0, q0, q1 \n" //q0 = a(0)*b(0),a(1)*b(1),a(2)*b(2),a(3)*b(3)
|
||||
"vadd.f32 d0, d0, d1 \n" //d0 = a(0)*b(0)+a(2)*b(2),a(1)*b(1)+a(3)*b(3)
|
||||
"vpadd.f32 d0,d0 \n" //d0 = a(0)*b(0)+a(2)*b(2)+a(1)*b(1)+a(3)*b(3),a(0)*b(0)+a(2)*b(2)+a(1)*b(1)+a(3)*b(3)
|
||||
"vmov.f32 %0, s0 \n"
|
||||
:"=w"(ret): "r"(a), "r"(b)
|
||||
: "q0", "q1"
|
||||
);
|
||||
return ret;
|
||||
#else
|
||||
return a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + a[3]*b[3];
|
||||
#endif
|
||||
}
|
||||
|
||||
void matrix_vector(const GLfloat *a, const GLfloat *b, GLfloat *c) {
|
||||
#ifdef __ARM_NEON__
|
||||
const float* a1 = a+8;
|
||||
asm volatile (
|
||||
"vld4.f32 {d0,d2,d4,d6}, [%1] \n"
|
||||
"vld4.f32 {d1,d3,d5,d7}, [%2] \n" // q0-q3 = a(0,4,8,12/1,5,9,13/2,6,10,14/3,7,11,15)
|
||||
"vld1.f32 {q4}, [%3] \n" // q4 = b
|
||||
"vmul.f32 q0, q0, d8[0] \n" // q0 = a(0,4,8,12)*b[0]
|
||||
"vmla.f32 q0, q1, d8[1] \n" // q0 = q0 + a(1,5,9,13)*b[1]
|
||||
"vmla.f32 q0, q2, d9[0] \n" // q0 = q0 + a(2,6,10,14)*b[2]
|
||||
"vmla.f32 q0, q3, d9[1] \n" // q0 = q0 + a(3,7,11,15)*b[3]
|
||||
"vst1.f32 {q0}, [%0] \n"
|
||||
::"r"(c), "r"(a), "r"(a1), "r"(b)
|
||||
: "q0", "q1", "q2", "q3", "q4", "memory"
|
||||
);
|
||||
#else
|
||||
c[0] = a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];
|
||||
c[1] = a[4] * b[0] + a[5] * b[1] + a[6] * b[2] + a[7] * b[3];
|
||||
c[2] = a[8] * b[0] + a[9] * b[1] + a[10] * b[2] + a[11] * b[3];
|
||||
c[3] = a[12] * b[0] + a[13] * b[1] + a[14] * b[2] + a[15] * b[3];
|
||||
#endif
|
||||
}
|
||||
|
||||
void vector_matrix(const GLfloat *a, const GLfloat *b, GLfloat *c) {
|
||||
#ifdef __ARM_NEON__
|
||||
const float* b2=b+4;
|
||||
const float* b3=b+8;
|
||||
const float* b4=b+12;
|
||||
asm volatile (
|
||||
"vld1.f32 {q0}, [%1] \n" // %q0 = a(0..3)
|
||||
"vld1.f32 {q1}, [%2] \n" // %q1 = b(0..3)
|
||||
"vmul.f32 q1, q1, d0[0] \n" // %q1 = b(0..3)*a[0]
|
||||
"vld1.f32 {q2}, [%3] \n" // %q2 = b(4..7)
|
||||
"vmla.f32 q1, q2, d0[1] \n" // %q1 = %q1 + b(4..7)*a[1]
|
||||
"vld1.f32 {q2}, [%4] \n" // %q2 = b(8..11)
|
||||
"vmla.f32 q1, q2, d1[0] \n" // %q1 = %q1 + b(8..11)*a[2]
|
||||
"vld1.f32 {q2}, [%5] \n" // %q2 = b(12..15)
|
||||
"vmla.f32 q1, q2, d1[1] \n" // %q1 = %q1 + b(12..15)*a[3]
|
||||
"vst1.f32 {q1}, [%0] \n"
|
||||
::"r"(c), "r"(a), "r"(b), "r"(b2), "r"(b3), "r"(b4)
|
||||
: "%2", "q0", "q1", "q2", "memory"
|
||||
);
|
||||
#else
|
||||
c[0] = a[0] * b[0] + a[1] * b[4] + a[2] * b[8] + a[3] * b[12];
|
||||
c[1] = a[0] * b[1] + a[1] * b[5] + a[2] * b[9] + a[3] * b[13];
|
||||
c[2] = a[0] * b[2] + a[1] * b[6] + a[2] * b[10] + a[3] * b[14];
|
||||
c[3] = a[0] * b[3] + a[1] * b[7] + a[2] * b[11] + a[3] * b[15];
|
||||
#endif
|
||||
}
|
||||
|
||||
void vector3_matrix(const GLfloat *a, const GLfloat *b, GLfloat *c) {
|
||||
#ifdef __ARM_NEON__
|
||||
const float* b2=b+4;
|
||||
const float* b3=b+8;
|
||||
const float* b4=b+12;
|
||||
asm volatile (
|
||||
//"vld1.f32 {q0}, [%1] \n" // %q0 = a(0..2)
|
||||
"vld1.32 {d4}, [%1] \n"
|
||||
"flds s10, [%1, #8] \n"
|
||||
"vsub.f32 s11, s11, s11 \n"
|
||||
"vld1.f32 {q1}, [%2] \n" // %q1 = b(0..3)
|
||||
"vmul.f32 q1, q1, d0[0] \n" // %q1 = b(0..3)*a[0]
|
||||
"vld1.f32 {q2}, [%3] \n" // %q2 = b(4..7)
|
||||
"vmla.f32 q1, q2, d0[1] \n" // %q1 = %q1 + b(4..7)*a[1]
|
||||
"vld1.f32 {q2}, [%4] \n" // %q2 = b(8..11)
|
||||
"vmla.f32 q1, q2, d1[0] \n" // %q1 = %q1 + b(8..11)*a[2]
|
||||
"vld1.f32 {q2}, [%5] \n" // %q2 = b(12..15)
|
||||
"vadd.f32 q1, q1, q2 \n" // %q1 = %q1 + b(12..15)
|
||||
"vst1.f32 {q1}, [%0] \n"
|
||||
::"r"(c), "r"(a), "r"(b), "r"(b2), "r"(b3), "r"(b4)
|
||||
: "q0", "q1", "q2", "memory"
|
||||
);
|
||||
#else
|
||||
c[0] = a[0] * b[0] + a[1] * b[4] + a[2] * b[8] + b[12];
|
||||
c[1] = a[0] * b[1] + a[1] * b[5] + a[2] * b[9] + b[13];
|
||||
c[2] = a[0] * b[2] + a[1] * b[6] + a[2] * b[10] + b[14];
|
||||
c[3] = a[0] * b[3] + a[1] * b[7] + a[2] * b[11] + b[15];
|
||||
#endif
|
||||
}
|
||||
|
||||
void vector_normalize(GLfloat *a) {
|
||||
#ifdef __ARM_NEON__
|
||||
asm volatile (
|
||||
"vld1.32 {d4}, [%0] \n\t" //d4={x0,y0}
|
||||
"flds s10, [%0, #8] \n\t" //d5[0]={z0}
|
||||
"vsub.f32 s11, s11, s11 \n\t"
|
||||
|
||||
"vmul.f32 d0, d4, d4 \n\t" //d0= d4*d4
|
||||
"vpadd.f32 d0, d0 \n\t" //d0 = d[0] + d[1]
|
||||
"vmla.f32 d0, d5, d5 \n\t" //d0 = d0 + d5*d5
|
||||
|
||||
"vmov.f32 d1, d0 \n\t" //d1 = d0
|
||||
"vrsqrte.f32 d0, d0 \n\t" //d0 = ~ 1.0 / sqrt(d0)
|
||||
"vmul.f32 d2, d0, d1 \n\t" //d2 = d0 * d1
|
||||
"vrsqrts.f32 d3, d2, d0 \n\t" //d3 = (3 - d0 * d2) / 2
|
||||
"vmul.f32 d0, d0, d3 \n\t" //d0 = d0 * d3
|
||||
/* "vmul.f32 d2, d0, d1 \n\t" //d2 = d0 * d1
|
||||
"vrsqrts.f32 d3, d2, d0 \n\t" //d4 = (3 - d0 * d3) / 2
|
||||
"vmul.f32 d0, d0, d3 \n\t" //d0 = d0 * d4 */ // 1 iteration should be enough
|
||||
|
||||
"vmul.f32 q2, q2, d0[0] \n\t" //d0= d2*d4
|
||||
"vst1.32 {d4}, [%0] \n\t" //
|
||||
"fsts s10, [%0, #8] \n\t" //
|
||||
|
||||
:"+&r"(a):
|
||||
: "d0", "d1", "d2", "d3", "d4", "d5", "memory"
|
||||
);
|
||||
#else
|
||||
float det=1.0f/sqrtf(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);
|
||||
a[0]*=det;
|
||||
a[1]*=det;
|
||||
a[2]*=det;
|
||||
#endif
|
||||
}
|
||||
|
||||
void vector4_normalize(GLfloat *a) {
|
||||
#ifdef __ARM_NEON__
|
||||
asm volatile (
|
||||
"vld1.32 {q2}, [%0] \n\t" //q2={x0,y0,z0,00}
|
||||
|
||||
"vmul.f32 d0, d4, d4 \n\t" //d0= d4*d4
|
||||
"vpadd.f32 d0, d0 \n\t" //d0 = d[0] + d[1]
|
||||
"vmla.f32 d0, d5, d5 \n\t" //d0 = d0 + d5*d5
|
||||
|
||||
"vmov.f32 d1, d0 \n\t" //d1 = d0
|
||||
"vrsqrte.f32 d0, d0 \n\t" //d0 = ~ 1.0 / sqrt(d0)
|
||||
"vmul.f32 d2, d0, d1 \n\t" //d2 = d0 * d1
|
||||
"vrsqrts.f32 d3, d2, d0 \n\t" //d3 = (3 - d0 * d2) / 2
|
||||
"vmul.f32 d0, d0, d3 \n\t" //d0 = d0 * d3
|
||||
/* "vmul.f32 d2, d0, d1 \n\t" //d2 = d0 * d1
|
||||
"vrsqrts.f32 d3, d2, d0 \n\t" //d4 = (3 - d0 * d3) / 2
|
||||
"vmul.f32 d0, d0, d3 \n\t" //d0 = d0 * d4 */ // 1 iteration should be enough
|
||||
|
||||
"vmul.f32 q2, q2, d0[0] \n\t" //d0= d2*d4
|
||||
"vst1.32 {q2}, [%0] \n\t" //
|
||||
|
||||
:"+&r"(a):
|
||||
: "d0", "d1", "d2", "d3", "d4", "d5", "memory"
|
||||
);
|
||||
#else
|
||||
float det=1.0f/sqrtf(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);
|
||||
a[0]*=det;
|
||||
a[1]*=det;
|
||||
a[2]*=det;
|
||||
// a[3] is ignored and left as 0.0f
|
||||
#endif
|
||||
}
|
||||
|
||||
void FASTMATH matrix_transpose(const GLfloat *a, GLfloat *b) {
|
||||
// column major -> row major
|
||||
// a(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15) -> b(0,4,8,12,1,5,9,13,2,6,10,14,3,7,11,15)
|
||||
#ifdef __ARM_NEON__
|
||||
const float* a1 = a+8;
|
||||
float* b1=b+8;
|
||||
asm volatile (
|
||||
"vld4.f32 {d0,d2,d4,d6}, [%1] \n"
|
||||
"vld4.f32 {d1,d3,d5,d7}, [%2] \n" // %q0-%q3 = a(0,4,8,12/1,5,9,13/2,6,10,14/3,7,11,15)
|
||||
"vst1.f32 {d0-d3}, [%0] \n"
|
||||
"vst1.f32 {d4-d7}, [%3] \n"
|
||||
::"r"(b), "r"(a), "r"(a1), "r"(b1)
|
||||
: "q0", "q1", "q2", "q3", "memory"
|
||||
);
|
||||
#else
|
||||
for (int i=0; i<4; i++)
|
||||
for (int j=0; j<4; j++)
|
||||
b[i*4+j]=a[i+j*4];
|
||||
#endif
|
||||
}
|
||||
|
||||
void matrix_inverse(const GLfloat *m, GLfloat *r) {
|
||||
|
||||
r[0] = m[5]*m[10]*m[15] - m[5]*m[14]*m[11] - m[6]*m[9]*m[15] + m[6]*m[13]*m[11] + m[7]*m[9]*m[14] - m[7]*m[13]*m[10];
|
||||
r[1] = -m[1]*m[10]*m[15] + m[1]*m[14]*m[11] + m[2]*m[9]*m[15] - m[2]*m[13]*m[11] - m[3]*m[9]*m[14] + m[3]*m[13]*m[10];
|
||||
r[2] = m[1]*m[6]*m[15] - m[1]*m[14]*m[7] - m[2]*m[5]*m[15] + m[2]*m[13]*m[7] + m[3]*m[5]*m[14] - m[3]*m[13]*m[6];
|
||||
r[3] = -m[1]*m[6]*m[11] + m[1]*m[10]*m[7] + m[2]*m[5]*m[11] - m[2]*m[9]*m[7] - m[3]*m[5]*m[10] + m[3]*m[9]*m[6];
|
||||
|
||||
r[4] = -m[4]*m[10]*m[15] + m[4]*m[14]*m[11] + m[6]*m[8]*m[15] - m[6]*m[12]*m[11] - m[7]*m[8]*m[14] + m[7]*m[12]*m[10];
|
||||
r[5] = m[0]*m[10]*m[15] - m[0]*m[14]*m[11] - m[2]*m[8]*m[15] + m[2]*m[12]*m[11] + m[3]*m[8]*m[14] - m[3]*m[12]*m[10];
|
||||
r[6] = -m[0]*m[6]*m[15] + m[0]*m[14]*m[7] + m[2]*m[4]*m[15] - m[2]*m[12]*m[7] - m[3]*m[4]*m[14] + m[3]*m[12]*m[6];
|
||||
r[7] = m[0]*m[6]*m[11] - m[0]*m[10]*m[7] - m[2]*m[4]*m[11] + m[2]*m[8]*m[7] + m[3]*m[4]*m[10] - m[3]*m[8]*m[6];
|
||||
|
||||
r[8] = m[4]*m[9]*m[15] - m[4]*m[13]*m[11] - m[5]*m[8]*m[15] + m[5]*m[12]*m[11] + m[7]*m[8]*m[13] - m[7]*m[12]*m[9];
|
||||
r[9] = -m[0]*m[9]*m[15] + m[0]*m[13]*m[11] + m[1]*m[8]*m[15] - m[1]*m[12]*m[11] - m[3]*m[8]*m[13] + m[3]*m[12]*m[9];
|
||||
r[10] = m[0]*m[5]*m[15] - m[0]*m[13]*m[7] - m[1]*m[4]*m[15] + m[1]*m[12]*m[7] + m[3]*m[4]*m[13] - m[3]*m[12]*m[5];
|
||||
r[11] = -m[0]*m[5]*m[11] + m[0]*m[9]*m[7] + m[1]*m[4]*m[11] - m[1]*m[8]*m[7] - m[3]*m[4]*m[9] + m[3]*m[8]*m[5];
|
||||
|
||||
r[12] = -m[4]*m[9]*m[14] + m[4]*m[13]*m[10] + m[5]*m[8]*m[14] - m[5]*m[12]*m[10] - m[6]*m[8]*m[13] + m[6]*m[12]*m[9];
|
||||
r[13] = m[0]*m[9]*m[14] - m[0]*m[13]*m[10] - m[1]*m[8]*m[14] + m[1]*m[12]*m[10] + m[2]*m[8]*m[13] - m[2]*m[12]*m[9];
|
||||
r[14] = -m[0]*m[5]*m[14] + m[0]*m[13]*m[6] + m[1]*m[4]*m[14] - m[1]*m[12]*m[6] - m[2]*m[4]*m[13] + m[2]*m[12]*m[5];
|
||||
r[15] = m[0]*m[5]*m[10] - m[0]*m[9]*m[6] - m[1]*m[4]*m[10] + m[1]*m[8]*m[6] + m[2]*m[4]*m[9] - m[2]*m[8]*m[5];
|
||||
|
||||
GLfloat det = 1/(m[0]*r[0] + m[1]*r[4] + m[2]*r[8] + m[3]*r[12]);
|
||||
for (int i = 0; i < 16; i++) r[i] *= det;
|
||||
}
|
||||
|
||||
void matrix_mul(const GLfloat *a, const GLfloat *b, GLfloat *c) {
|
||||
memset(c, 0, sizeof(GLfloat)*16);
|
||||
// c = a * b
|
||||
for (int j=0 ; j<4; ++j) {
|
||||
for (int i=0 ; i<4; ++i) {
|
||||
for (int k=0; k<4; ++k) {
|
||||
c[i*4+j] += a[k*4+j] * b[i*4+k];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void dot_loop(const GLfloat *verts, const GLfloat *params, GLfloat *out, GLint count, GLushort *indices) {
|
||||
for (int i = 0; i < count; i++) {
|
||||
GLushort k = indices?indices[i]:i;
|
||||
@@ -379,7 +149,7 @@ void sphere_loop(const GLfloat *verts, const GLfloat *norm, GLfloat *out, GLint
|
||||
}*/
|
||||
// First get the ModelviewMatrix
|
||||
GLfloat ModelviewMatrix[16], InvModelview[16];
|
||||
glshim_glGetFloatv(GL_MODELVIEW_MATRIX, InvModelview);
|
||||
gl4es_glGetFloatv(GL_MODELVIEW_MATRIX, InvModelview);
|
||||
// column major -> row major
|
||||
for (int i=0; i<4; i++)
|
||||
for (int j=0; j<4; j++)
|
||||
@@ -476,7 +246,7 @@ void gen_tex_coords(GLfloat *verts, GLfloat *norm, GLfloat **coords, GLint count
|
||||
*needclean=1;
|
||||
// setup reflection map!
|
||||
GLuint old_tex=glstate->texture.active;
|
||||
if (old_tex!=texture) glshim_glActiveTexture(GL_TEXTURE0 + texture);
|
||||
if (old_tex!=texture) gl4es_glActiveTexture(GL_TEXTURE0 + texture);
|
||||
LOAD_GLES_OES(glTexGeni);
|
||||
LOAD_GLES_OES(glTexGenfv);
|
||||
LOAD_GLES(glEnable);
|
||||
@@ -487,7 +257,7 @@ void gen_tex_coords(GLfloat *verts, GLfloat *norm, GLfloat **coords, GLint count
|
||||
// enable texgen
|
||||
gles_glEnable(GL_TEXTURE_GEN_STR); //GLES only support the 3 gen at the same time!
|
||||
|
||||
if (old_tex!=texture) glshim_glActiveTexture(GL_TEXTURE0 + old_tex);
|
||||
if (old_tex!=texture) gl4es_glActiveTexture(GL_TEXTURE0 + old_tex);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -499,7 +269,7 @@ void gen_tex_coords(GLfloat *verts, GLfloat *norm, GLfloat **coords, GLint count
|
||||
*needclean=1;
|
||||
// setup reflection map!
|
||||
GLuint old_tex=glstate->texture.active;
|
||||
if (old_tex!=texture) glshim_glActiveTexture(GL_TEXTURE0 + texture);
|
||||
if (old_tex!=texture) gl4es_glActiveTexture(GL_TEXTURE0 + texture);
|
||||
LOAD_GLES_OES(glTexGeni);
|
||||
LOAD_GLES_OES(glTexGenfv);
|
||||
LOAD_GLES(glEnable);
|
||||
@@ -510,7 +280,7 @@ void gen_tex_coords(GLfloat *verts, GLfloat *norm, GLfloat **coords, GLint count
|
||||
// enable texgen
|
||||
gles_glEnable(GL_TEXTURE_GEN_STR);
|
||||
|
||||
if (old_tex!=texture) glshim_glActiveTexture(GL_TEXTURE0 + old_tex);
|
||||
if (old_tex!=texture) gl4es_glActiveTexture(GL_TEXTURE0 + old_tex);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -549,38 +319,38 @@ void gen_tex_clean(GLint cleancode, int texture) {
|
||||
}
|
||||
}
|
||||
|
||||
void glshim_glLoadTransposeMatrixf(const GLfloat *m) {
|
||||
void gl4es_glLoadTransposeMatrixf(const GLfloat *m) {
|
||||
GLfloat mf[16];
|
||||
matrix_transpose(m, mf);
|
||||
glshim_glLoadMatrixf(mf);
|
||||
gl4es_glLoadMatrixf(mf);
|
||||
errorGL();
|
||||
}
|
||||
|
||||
void glshim_glLoadTransposeMatrixd(const GLdouble *m) {
|
||||
void gl4es_glLoadTransposeMatrixd(const GLdouble *m) {
|
||||
GLfloat mf[16];
|
||||
for (int i=0; i<16; i++)
|
||||
mf[i] = m[i];
|
||||
glshim_glLoadTransposeMatrixf(mf);
|
||||
gl4es_glLoadTransposeMatrixf(mf);
|
||||
}
|
||||
|
||||
void glshim_glMultTransposeMatrixd(const GLdouble *m) {
|
||||
void gl4es_glMultTransposeMatrixd(const GLdouble *m) {
|
||||
GLfloat mf[16];
|
||||
for (int i=0; i<16; i++)
|
||||
mf[i] = m[i];
|
||||
glshim_glMultTransposeMatrixf(mf);
|
||||
gl4es_glMultTransposeMatrixf(mf);
|
||||
}
|
||||
void glshim_glMultTransposeMatrixf(const GLfloat *m) {
|
||||
void gl4es_glMultTransposeMatrixf(const GLfloat *m) {
|
||||
GLfloat mf[16];
|
||||
matrix_transpose(m, mf);
|
||||
glshim_glMultMatrixf(mf);
|
||||
gl4es_glMultMatrixf(mf);
|
||||
errorGL();
|
||||
}
|
||||
|
||||
void glTexGenfv(GLenum coord, GLenum pname, const GLfloat *params) AliasExport("glshim_glTexGenfv");
|
||||
void glTexGeni(GLenum coord, GLenum pname, GLint param) AliasExport("glshim_glTexGeni");
|
||||
void glGetTexGenfv(GLenum coord,GLenum pname,GLfloat *params) AliasExport("glshim_glGetTexGenfv");
|
||||
void glTexGenfv(GLenum coord, GLenum pname, const GLfloat *params) AliasExport("gl4es_glTexGenfv");
|
||||
void glTexGeni(GLenum coord, GLenum pname, GLint param) AliasExport("gl4es_glTexGeni");
|
||||
void glGetTexGenfv(GLenum coord,GLenum pname,GLfloat *params) AliasExport("gl4es_glGetTexGenfv");
|
||||
|
||||
void glLoadTransposeMatrixf(const GLfloat *m) AliasExport("glshim_glLoadTransposeMatrixf");
|
||||
void glLoadTransposeMatrixd(const GLdouble *m) AliasExport("glshim_glLoadTransposeMatrixd");
|
||||
void glMultTransposeMatrixd(const GLdouble *m) AliasExport("glshim_glMultTransposeMatrixd");
|
||||
void glMultTransposeMatrixf(const GLfloat *m) AliasExport("glshim_glMultTransposeMatrixf");
|
||||
void glLoadTransposeMatrixf(const GLfloat *m) AliasExport("gl4es_glLoadTransposeMatrixf");
|
||||
void glLoadTransposeMatrixd(const GLdouble *m) AliasExport("gl4es_glLoadTransposeMatrixd");
|
||||
void glMultTransposeMatrixd(const GLdouble *m) AliasExport("gl4es_glMultTransposeMatrixd");
|
||||
void glMultTransposeMatrixf(const GLfloat *m) AliasExport("gl4es_glMultTransposeMatrixf");
|
||||
|
||||
@@ -1,21 +1,13 @@
|
||||
#include "gl.h"
|
||||
#include <math.h>
|
||||
#include "matvec.h"
|
||||
|
||||
void glshim_glTexGenfv(GLenum coord, GLenum pname, const GLfloat *params);
|
||||
void glshim_glTexGeni(GLenum coord, GLenum pname, GLint param);
|
||||
void gl4es_glTexGenfv(GLenum coord, GLenum pname, const GLfloat *params);
|
||||
void gl4es_glTexGeni(GLenum coord, GLenum pname, GLint param);
|
||||
void gen_tex_coords(GLfloat *verts, GLfloat *norm, GLfloat **coords, GLint count, GLint *needclean, int texture, GLushort* indices, GLuint ilen);
|
||||
void gen_tex_clean(GLint cleancode, int texture);
|
||||
void glshim_glGetTexGenfv(GLenum coord,GLenum pname,GLfloat *params);
|
||||
void gl4es_glGetTexGenfv(GLenum coord,GLenum pname,GLfloat *params);
|
||||
|
||||
GLfloat dot(const GLfloat *a, const GLfloat *b);
|
||||
void matrix_vector(const GLfloat *a, const GLfloat *b, GLfloat *c);
|
||||
void vector_matrix(const GLfloat *a, const GLfloat *b, GLfloat *c);
|
||||
void vector_normalize(GLfloat *a);
|
||||
void matrix_transpose(const GLfloat *a, GLfloat *b);
|
||||
void matrix_inverse(const GLfloat *m, GLfloat *r);
|
||||
void matrix_mul(const GLfloat *a, const GLfloat *b, GLfloat *c);
|
||||
|
||||
void glshim_glLoadTransposeMatrixf(const GLfloat *m);
|
||||
void glshim_glLoadTransposeMatrixd(const GLdouble *m);
|
||||
void glshim_glMultTransposeMatrixd(const GLdouble *m);
|
||||
void glshim_glMultTransposeMatrixf(const GLfloat *m);
|
||||
void gl4es_glLoadTransposeMatrixf(const GLfloat *m);
|
||||
void gl4es_glLoadTransposeMatrixd(const GLdouble *m);
|
||||
void gl4es_glMultTransposeMatrixd(const GLdouble *m);
|
||||
void gl4es_glMultTransposeMatrixf(const GLfloat *m);
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "gles.h"
|
||||
#include "../glx/streaming.h"
|
||||
#include "../glx/hardext.h"
|
||||
#include "init.h"
|
||||
|
||||
#ifndef GL_TEXTURE_STREAM_IMG
|
||||
#define GL_TEXTURE_STREAM_IMG 0x8C0D
|
||||
@@ -100,8 +101,6 @@ void tex_setup_texcoord(GLuint len) {
|
||||
}
|
||||
}
|
||||
|
||||
int nolumalpha = 0;
|
||||
|
||||
static int is_fake_compressed_rgb(GLenum internalformat)
|
||||
{
|
||||
if(internalformat==GL_COMPRESSED_RGB) return 1;
|
||||
@@ -182,7 +181,7 @@ static void *swizzle_texture(GLsizei width, GLsizei height,
|
||||
case GL_RGBA:
|
||||
break;
|
||||
case GL_LUMINANCE8_ALPHA8:
|
||||
if(nolumalpha)
|
||||
if(globals4es.nolumalpha)
|
||||
convert = true;
|
||||
else {
|
||||
dest_format = GL_LUMINANCE_ALPHA;
|
||||
@@ -190,7 +189,7 @@ static void *swizzle_texture(GLsizei width, GLsizei height,
|
||||
}
|
||||
break;
|
||||
case GL_LUMINANCE_ALPHA:
|
||||
if(nolumalpha)
|
||||
if(globals4es.nolumalpha)
|
||||
convert = true;
|
||||
else
|
||||
dest_format = GL_LUMINANCE_ALPHA;
|
||||
@@ -332,7 +331,7 @@ GLenum swizzle_internalformat(GLenum *internalformat) {
|
||||
case GL_RG:
|
||||
case 2:
|
||||
ret = GL_LUMINANCE_ALPHA;
|
||||
if (nolumalpha)
|
||||
if (globals4es.nolumalpha)
|
||||
sret = GL_RGBA;
|
||||
else
|
||||
sret = GL_LUMINANCE_ALPHA;
|
||||
@@ -379,7 +378,7 @@ GLenum swizzle_internalformat(GLenum *internalformat) {
|
||||
case GL_LUMINANCE16_ALPHA16:
|
||||
case GL_LUMINANCE_ALPHA:
|
||||
ret = GL_LUMINANCE_ALPHA;
|
||||
if (nolumalpha)
|
||||
if (globals4es.nolumalpha)
|
||||
sret = GL_RGBA;
|
||||
else
|
||||
sret = GL_LUMINANCE_ALPHA;
|
||||
@@ -395,7 +394,7 @@ GLenum swizzle_internalformat(GLenum *internalformat) {
|
||||
break;
|
||||
case GL_COMPRESSED_LUMINANCE_ALPHA:
|
||||
ret = GL_COMPRESSED_RGBA;
|
||||
if (nolumalpha)
|
||||
if (globals4es.nolumalpha)
|
||||
sret = GL_RGBA;
|
||||
else
|
||||
sret = GL_LUMINANCE_ALPHA;
|
||||
@@ -426,29 +425,21 @@ GLenum swizzle_internalformat(GLenum *internalformat) {
|
||||
return sret;
|
||||
}
|
||||
|
||||
int automipmap = 0;
|
||||
int texcopydata = 0;
|
||||
int tested_env = 0;
|
||||
int texshrink = 0;
|
||||
int texdump = 0;
|
||||
int alphahack = 0;
|
||||
int texstream = 0;
|
||||
int copytex = 0;
|
||||
static int default_tex_mipmap = 0;
|
||||
|
||||
static int proxy_width = 0;
|
||||
static int proxy_height = 0;
|
||||
static GLint proxy_intformat = 0;
|
||||
|
||||
void glshim_glTexImage2D(GLenum target, GLint level, GLint internalformat,
|
||||
void gl4es_glTexImage2D(GLenum target, GLint level, GLint internalformat,
|
||||
GLsizei width, GLsizei height, GLint border,
|
||||
GLenum format, GLenum type, const GLvoid *data) {
|
||||
|
||||
//printf("glTexImage2D on target=%s with unpack_row_length(%i), size(%i,%i) and skip(%i,%i), format(internal)=%s(%s), type=%s, data=%08x, level=%i (mipmap_need=%i, mipmap_auto=%i) => texture=%u (streamed=%i), glstate->list.compiling=%d\n", PrintEnum(target), glstate->texture.unpack_row_length, width, height, glstate->texture.unpack_skip_pixels, glstate->texture.unpack_skip_rows, PrintEnum(format), PrintEnum(internalformat), PrintEnum(type), data, level, (glstate->texture.bound[glstate->texture.active])?glstate->texture.bound[glstate->texture.active]->mipmap_need:0, (glstate->texture.bound[glstate->texture.active])?glstate->texture.bound[glstate->texture.active]->mipmap_auto:0, (glstate->texture.bound[glstate->texture.active])?glstate->texture.bound[glstate->texture.active]->texture:0, (glstate->texture.bound[glstate->texture.active])?glstate->texture.bound[glstate->texture.active]->streamed:0, glstate->list.compiling);
|
||||
// proxy case
|
||||
if (target == GL_PROXY_TEXTURE_2D) {
|
||||
proxy_width = ((width<<level)>(texshrink>=8)?8192:2048)?0:width;
|
||||
proxy_height = ((height<<level)>(texshrink>=8)?8192:2048)?0:height;
|
||||
proxy_width = ((width<<level)>(globals4es.texshrink>=8)?8192:2048)?0:width;
|
||||
proxy_height = ((height<<level)>(globals4es.texshrink>=8)?8192:2048)?0:height;
|
||||
proxy_intformat = swizzle_internalformat(&internalformat);
|
||||
return;
|
||||
}
|
||||
@@ -470,9 +461,9 @@ void glshim_glTexImage2D(GLenum target, GLint level, GLint internalformat,
|
||||
|
||||
gltexture_t *bound = glstate->texture.bound[glstate->texture.active];
|
||||
if (bound) bound->alpha = pixel_hasalpha(format);
|
||||
if (automipmap) {
|
||||
if (globals4es.automipmap) {
|
||||
if (bound && (level>0))
|
||||
if ((automipmap==1) || (automipmap==3) || bound->mipmap_need) {
|
||||
if ((globals4es.automipmap==1) || (globals4es.automipmap==3) || bound->mipmap_need) {
|
||||
glstate->gl_batch = old_glbatch;
|
||||
return; // has been handled by auto_mipmap
|
||||
}
|
||||
@@ -510,7 +501,7 @@ void glshim_glTexImage2D(GLenum target, GLint level, GLint internalformat,
|
||||
|
||||
if (bound) {
|
||||
bound->shrink = 0;
|
||||
switch(texshrink) {
|
||||
switch(globals4es.texshrink) {
|
||||
case 0: // nothing
|
||||
break;
|
||||
case 1: //everything / 2
|
||||
@@ -686,15 +677,15 @@ void glshim_glTexImage2D(GLenum target, GLint level, GLint internalformat,
|
||||
}
|
||||
}
|
||||
|
||||
if (texdump) {
|
||||
if (globals4es.texdump) {
|
||||
if (bound) {
|
||||
pixel_to_ppm(pixels, width, height, format, type, bound->texture);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
#ifdef TEXSTREAM
|
||||
if (texstream && bound && (target==GL_TEXTURE_2D) && (width>=256 && height>=256) &&
|
||||
((internalformat==GL_RGB) || (internalformat==3) || (internalformat==GL_RGB8) || (internalformat==GL_BGR) || (internalformat==GL_RGB5)) || (texstream==2) ) {
|
||||
if (globals4es.texstream && bound && (target==GL_TEXTURE_2D) && (width>=256 && height>=256) &&
|
||||
((internalformat==GL_RGB) || (internalformat==3) || (internalformat==GL_RGB8) || (internalformat==GL_BGR) || (internalformat==GL_RGB5)) || (globals4es.texstream==2) ) {
|
||||
bound->streamingID = AddStreamed(width, height, bound->texture);
|
||||
if (bound->streamingID>-1) { // success
|
||||
bound->streamed = true;
|
||||
@@ -716,8 +707,8 @@ void glshim_glTexImage2D(GLenum target, GLint level, GLint internalformat,
|
||||
bound->shrink = 0;
|
||||
if (!bound->streamed)
|
||||
swizzle_texture(width, height, &format, &type, internalformat, new_format, NULL); // convert format even if data is NULL
|
||||
if ((texshrink>0) && !bound->streamed) {
|
||||
switch(texshrink) {
|
||||
if ((globals4es.texshrink>0) && !bound->streamed) {
|
||||
switch(globals4es.texshrink) {
|
||||
case 1: //everything / 2
|
||||
width /= 2;
|
||||
height /= 2;
|
||||
@@ -802,7 +793,7 @@ void glshim_glTexImage2D(GLenum target, GLint level, GLint internalformat,
|
||||
}
|
||||
#undef MIN_SIZE
|
||||
#endif
|
||||
if (texstream && bound && bound->streamed) {
|
||||
if (globals4es.texstream && bound && bound->streamed) {
|
||||
nwidth = width;
|
||||
nheight = height;
|
||||
}
|
||||
@@ -815,19 +806,19 @@ void glshim_glTexImage2D(GLenum target, GLint level, GLint internalformat,
|
||||
bound->type = type;
|
||||
bound->compressed = false;
|
||||
}
|
||||
if ((bound) && (automipmap==4) && (nwidth!=nheight))
|
||||
if ((bound) && (globals4es.automipmap==4) && (nwidth!=nheight))
|
||||
bound->mipmap_auto = 0;
|
||||
|
||||
if (!(texstream && bound && bound->streamed)) {
|
||||
if (bound && ((bound->mipmap_need && (automipmap!=3)) || (bound->mipmap_auto)))
|
||||
if (!(globals4es.texstream && bound && bound->streamed)) {
|
||||
if (bound && ((bound->mipmap_need && (globals4es.automipmap!=3)) || (bound->mipmap_auto)))
|
||||
gles_glTexParameteri( target, GL_GENERATE_MIPMAP, GL_TRUE );
|
||||
else {
|
||||
gles_glTexParameteri( target, GL_GENERATE_MIPMAP, GL_FALSE );
|
||||
if ((bound) && (bound->mipmap_need)) {
|
||||
// remove the need for mipmap...
|
||||
bound->mipmap_need = 0;
|
||||
glshim_glTexParameteri(target, GL_TEXTURE_MIN_FILTER, bound->min_filter);
|
||||
glshim_glTexParameteri(target, GL_TEXTURE_MAG_FILTER, bound->mag_filter);
|
||||
gl4es_glTexParameteri(target, GL_TEXTURE_MIN_FILTER, bound->min_filter);
|
||||
gl4es_glTexParameteri(target, GL_TEXTURE_MAG_FILTER, bound->mag_filter);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -854,15 +845,15 @@ void glshim_glTexImage2D(GLenum target, GLint level, GLint internalformat,
|
||||
format, type, pixels);
|
||||
errorGL();
|
||||
}
|
||||
/*if (bound && bound->mipmap_need && !bound->mipmap_auto && (automipmap!=3))
|
||||
/*if (bound && bound->mipmap_need && !bound->mipmap_auto && (globals4es.automipmap!=3))
|
||||
gles_glTexParameteri( target, GL_GENERATE_MIPMAP, GL_FALSE );*/
|
||||
} else {
|
||||
if (pixels)
|
||||
glshim_glTexSubImage2D(target, level, 0, 0, width, height, format, type, pixels); // (should never happens) updload the 1st data...
|
||||
gl4es_glTexSubImage2D(target, level, 0, 0, width, height, format, type, pixels); // (should never happens) updload the 1st data...
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((target==GL_TEXTURE_2D) && texcopydata && bound && ((texstream && !bound->streamed) || !texstream)) {
|
||||
if ((target==GL_TEXTURE_2D) && globals4es.texcopydata && bound && ((globals4es.texstream && !bound->streamed) || !globals4es.texstream)) {
|
||||
if (bound->data)
|
||||
bound->data=realloc(bound->data, width*height*4);
|
||||
else
|
||||
@@ -880,7 +871,7 @@ void glshim_glTexImage2D(GLenum target, GLint level, GLint internalformat,
|
||||
glstate->gl_batch = old_glbatch;
|
||||
}
|
||||
|
||||
void glshim_glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
||||
void gl4es_glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
||||
GLsizei width, GLsizei height, GLenum format, GLenum type,
|
||||
const GLvoid *data) {
|
||||
|
||||
@@ -907,9 +898,9 @@ void glshim_glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yof
|
||||
target = map_tex_target(target);
|
||||
|
||||
gltexture_t *bound = glstate->texture.bound[glstate->texture.active];
|
||||
if (automipmap) {
|
||||
if (globals4es.automipmap) {
|
||||
if (bound && (level>0))
|
||||
if ((automipmap==1) || (automipmap==3) || bound->mipmap_need) {
|
||||
if ((globals4es.automipmap==1) || (globals4es.automipmap==3) || bound->mipmap_need) {
|
||||
glstate->gl_batch = old_glbatch;
|
||||
return; // has been handled by auto_mipmap
|
||||
}
|
||||
@@ -943,7 +934,7 @@ void glshim_glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yof
|
||||
|
||||
GLvoid *old = pixels;
|
||||
#ifdef TEXSTREAM
|
||||
if (bound && texstream && (bound->streamed)) {
|
||||
if (bound && globals4es.texstream && (bound->streamed)) {
|
||||
// Optimisation, let's do convert directly to the right place...
|
||||
GLvoid *tmp = GetStreamingBuffer(bound->streamingID);
|
||||
tmp += (yoffset*bound->width+xoffset)*2;
|
||||
@@ -1011,16 +1002,16 @@ void glshim_glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yof
|
||||
height /= 2*bound->shrink;
|
||||
}
|
||||
|
||||
if (texdump) {
|
||||
if (globals4es.texdump) {
|
||||
if (bound) {
|
||||
pixel_to_ppm(pixels, width, height, format, type, bound->texture);
|
||||
}
|
||||
}
|
||||
|
||||
if (bound && bound->mipmap_need && !bound->mipmap_auto && (automipmap!=3) && (!texstream || (texstream && !bound->streamed)))
|
||||
if (bound && bound->mipmap_need && !bound->mipmap_auto && (globals4es.automipmap!=3) && (!globals4es.texstream || (globals4es.texstream && !bound->streamed)))
|
||||
gles_glTexParameteri( target, GL_GENERATE_MIPMAP, GL_TRUE );
|
||||
|
||||
if (bound && texstream && bound->streamed) {
|
||||
if (bound && globals4es.texstream && bound->streamed) {
|
||||
/* // copy the texture to the buffer
|
||||
void* tmp = GetStreamingBuffer(bound->streamingID);
|
||||
for (int yy=0; yy<height; yy++) {
|
||||
@@ -1032,10 +1023,10 @@ void glshim_glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yof
|
||||
errorGL();
|
||||
}
|
||||
|
||||
if (bound && bound->mipmap_need && !bound->mipmap_auto && (automipmap!=3) && (!texstream || (texstream && !bound->streamed)))
|
||||
if (bound && bound->mipmap_need && !bound->mipmap_auto && (globals4es.automipmap!=3) && (!globals4es.texstream || (globals4es.texstream && !bound->streamed)))
|
||||
gles_glTexParameteri( target, GL_GENERATE_MIPMAP, GL_FALSE );
|
||||
|
||||
if ((target==GL_TEXTURE_2D) && texcopydata && bound && ((texstream && !bound->streamed) || !texstream)) {
|
||||
if ((target==GL_TEXTURE_2D) && globals4es.texcopydata && bound && ((globals4es.texstream && !bound->streamed) || !globals4es.texstream)) {
|
||||
//printf("*texcopy* glTexSubImage2D, xy=%i,%i, size=%i,%i=>%i,%i, format=%s, type=%s, tex=%u\n", xoffset, yoffset, width, height, bound->width, bound->height, PrintEnum(format), PrintEnum(type), bound->glname);
|
||||
GLvoid * tmp = bound->data;
|
||||
tmp += (yoffset*bound->width + xoffset)*4;
|
||||
@@ -1049,58 +1040,58 @@ void glshim_glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yof
|
||||
}
|
||||
|
||||
// 1d stubs
|
||||
void glshim_glTexImage1D(GLenum target, GLint level, GLint internalFormat,
|
||||
void gl4es_glTexImage1D(GLenum target, GLint level, GLint internalFormat,
|
||||
GLsizei width, GLint border,
|
||||
GLenum format, GLenum type, const GLvoid *data) {
|
||||
|
||||
// TODO: maybe too naive to force GL_TEXTURE_2D here?
|
||||
glshim_glTexImage2D(GL_TEXTURE_2D, level, internalFormat, width, 1,
|
||||
gl4es_glTexImage2D(GL_TEXTURE_2D, level, internalFormat, width, 1,
|
||||
border, format, type, data);
|
||||
}
|
||||
void glshim_glTexSubImage1D(GLenum target, GLint level, GLint xoffset,
|
||||
void gl4es_glTexSubImage1D(GLenum target, GLint level, GLint xoffset,
|
||||
GLsizei width, GLenum format, GLenum type,
|
||||
const GLvoid *data) {
|
||||
|
||||
glshim_glTexSubImage2D(GL_TEXTURE_2D, level, xoffset, 0,
|
||||
gl4es_glTexSubImage2D(GL_TEXTURE_2D, level, xoffset, 0,
|
||||
width, 1, format, type, data);
|
||||
}
|
||||
void glshim_glCopyTexImage1D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y,
|
||||
void gl4es_glCopyTexImage1D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y,
|
||||
GLsizei width, GLint border) {
|
||||
glshim_glCopyTexImage2D(GL_TEXTURE_2D, level, internalformat, x, y, width, 1, border);
|
||||
gl4es_glCopyTexImage2D(GL_TEXTURE_2D, level, internalformat, x, y, width, 1, border);
|
||||
|
||||
}
|
||||
|
||||
void glshim_glCopyTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLint x, GLint y,
|
||||
void gl4es_glCopyTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLint x, GLint y,
|
||||
GLsizei width) {
|
||||
glshim_glCopyTexSubImage2D(GL_TEXTURE_2D, level, xoffset, 0, x, y, width, 1);
|
||||
gl4es_glCopyTexSubImage2D(GL_TEXTURE_2D, level, xoffset, 0, x, y, width, 1);
|
||||
}
|
||||
|
||||
void glshim_glCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
|
||||
void gl4es_glCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
|
||||
GLint x, GLint y, GLsizei width, GLsizei height) {
|
||||
glshim_glCopyTexSubImage2D(GL_TEXTURE_2D, level, xoffset, yoffset, x, y, width, height);
|
||||
gl4es_glCopyTexSubImage2D(GL_TEXTURE_2D, level, xoffset, yoffset, x, y, width, height);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 3d stubs
|
||||
void glshim_glTexImage3D(GLenum target, GLint level, GLint internalFormat,
|
||||
void gl4es_glTexImage3D(GLenum target, GLint level, GLint internalFormat,
|
||||
GLsizei width, GLsizei height, GLsizei depth, GLint border,
|
||||
GLenum format, GLenum type, const GLvoid *data) {
|
||||
|
||||
// TODO: maybe too naive to force GL_TEXTURE_2D here?
|
||||
glshim_glTexImage2D(GL_TEXTURE_2D, level, internalFormat, width, height,
|
||||
gl4es_glTexImage2D(GL_TEXTURE_2D, level, internalFormat, width, height,
|
||||
border, format, type, data);
|
||||
}
|
||||
void glshim_glTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
|
||||
void gl4es_glTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
|
||||
GLsizei width, GLsizei height, GLsizei depth, GLenum format,
|
||||
GLenum type, const GLvoid *data) {
|
||||
|
||||
glshim_glTexSubImage2D(target, level, xoffset, yoffset,
|
||||
gl4es_glTexSubImage2D(target, level, xoffset, yoffset,
|
||||
width, height, format, type, data);
|
||||
}
|
||||
|
||||
void glshim_glPixelStorei(GLenum pname, GLint param) {
|
||||
void gl4es_glPixelStorei(GLenum pname, GLint param) {
|
||||
// TODO: add to glGetIntegerv?
|
||||
// if (glstate->gl_batch) flush();
|
||||
|
||||
@@ -1148,7 +1139,7 @@ void glshim_glPixelStorei(GLenum pname, GLint param) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
GLboolean glshim_glIsTexture( GLuint texture) {
|
||||
GLboolean gl4es_glIsTexture( GLuint texture) {
|
||||
noerrorShim();
|
||||
if (!texture) {
|
||||
return GL_FALSE;
|
||||
@@ -1167,7 +1158,7 @@ GLboolean glshim_glIsTexture( GLuint texture) {
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
gltexture_t* glshim_getTexture(GLenum target, GLuint texture) {
|
||||
gltexture_t* gl4es_getTexture(GLenum target, GLuint texture) {
|
||||
// Get a texture based on glID
|
||||
gltexture_t* tex = NULL;
|
||||
if (texture == 0) return tex;
|
||||
@@ -1192,12 +1183,12 @@ gltexture_t* glshim_getTexture(GLenum target, GLuint texture) {
|
||||
tex->width = 0;
|
||||
tex->height = 0;
|
||||
tex->uploaded = false;
|
||||
tex->mipmap_auto = default_tex_mipmap || (automipmap==1);
|
||||
tex->mipmap_need = (automipmap==1)?1:0;
|
||||
tex->mipmap_auto = default_tex_mipmap || (globals4es.automipmap==1);
|
||||
tex->mipmap_need = (globals4es.automipmap==1)?1:0;
|
||||
tex->alpha = true;
|
||||
tex->streamed = false;
|
||||
tex->streamingID = -1;
|
||||
tex->min_filter = tex->mag_filter = (automipmap==1)?GL_LINEAR_MIPMAP_LINEAR:GL_LINEAR;
|
||||
tex->min_filter = tex->mag_filter = (globals4es.automipmap==1)?GL_LINEAR_MIPMAP_LINEAR:GL_LINEAR;
|
||||
tex->format = GL_RGBA;
|
||||
tex->type = GL_UNSIGNED_BYTE;
|
||||
tex->orig_internal = GL_RGBA;
|
||||
@@ -1209,7 +1200,7 @@ gltexture_t* glshim_getTexture(GLenum target, GLuint texture) {
|
||||
return tex;
|
||||
}
|
||||
#define batch_activetex (glstate->statebatch.active_tex_changed?(glstate->statebatch.active_tex-GL_TEXTURE0):glstate->texture.active)
|
||||
void glshim_glBindTexture(GLenum target, GLuint texture) {
|
||||
void gl4es_glBindTexture(GLenum target, GLuint texture) {
|
||||
noerrorShim();
|
||||
if ((target!=GL_PROXY_TEXTURE_2D) && (glstate->list.active && (glstate->gl_batch && !glstate->list.compiling))) {
|
||||
//printf("=> glBindTexture(0x%04X, %u), active=%i, client=%i, batch_active=%i, batch_bound=0x%04X, batch_tex=%u\n", target, texture, glstate->texture.active, glstate->texture.client, batch_activetex, glstate->statebatch.bound_targ[batch_activetex], glstate->statebatch.bound_tex[batch_activetex]);
|
||||
@@ -1232,11 +1223,11 @@ void glshim_glBindTexture(GLenum target, GLuint texture) {
|
||||
gltexture_t *tex = NULL;
|
||||
//printf("glBindTexture(0x%04X, %u), active=%i, client=%i\n", target, texture, glstate->texture.active, glstate->texture.client);
|
||||
if (texture) {
|
||||
tex = glshim_getTexture(target, texture);
|
||||
tex = gl4es_getTexture(target, texture);
|
||||
if (glstate->texture.bound[glstate->texture.active] == tex)
|
||||
tex_changed = 0;
|
||||
texture = tex->glname;
|
||||
if (texstream && tex->streamed)
|
||||
if (globals4es.texstream && tex->streamed)
|
||||
streamingID = tex->streamingID;
|
||||
} else {
|
||||
if (glstate->texture.bound[glstate->texture.active] == NULL)
|
||||
@@ -1251,7 +1242,7 @@ tex_changed=1; // seems buggy, temporary disabling that...
|
||||
|
||||
GLboolean tmp = glstate->enable.texture_2d[glstate->texture.active];
|
||||
#ifdef TEXSTREAM
|
||||
if (texstream) { // unbind streaming texture if any...
|
||||
if (globals4es.texstream) { // unbind streaming texture if any...
|
||||
gltexture_t *bound = glstate->texture.bound[glstate->texture.active];
|
||||
if (bound && bound->streamed) {
|
||||
if (tmp)
|
||||
@@ -1270,7 +1261,7 @@ tex_changed=1; // seems buggy, temporary disabling that...
|
||||
|
||||
LOAD_GLES(glBindTexture);
|
||||
#ifdef TEXSTREAM
|
||||
if (texstream && (streamingID>-1)) {
|
||||
if (globals4es.texstream && (streamingID>-1)) {
|
||||
if (tmp)
|
||||
gles_glDisable(GL_TEXTURE_2D);
|
||||
ActivateStreaming(streamingID);
|
||||
@@ -1288,7 +1279,7 @@ tex_changed=1; // seems buggy, temporary disabling that...
|
||||
#undef batch_activetex
|
||||
|
||||
// TODO: also glTexParameterf(v)?
|
||||
void glshim_glTexParameteri(GLenum target, GLenum pname, GLint param) {
|
||||
void gl4es_glTexParameteri(GLenum target, GLenum pname, GLint param) {
|
||||
PUSH_IF_COMPILING(glTexParameteri);
|
||||
LOAD_GLES(glTexParameteri);
|
||||
target = map_tex_target(target);
|
||||
@@ -1303,7 +1294,7 @@ void glshim_glTexParameteri(GLenum target, GLenum pname, GLint param) {
|
||||
case GL_LINEAR_MIPMAP_LINEAR:
|
||||
if (texture)
|
||||
texture->mipmap_need = true;
|
||||
if ((automipmap==3) || ((texture) && (automipmap==1) && (texture->mipmap_auto==0)))
|
||||
if ((globals4es.automipmap==3) || ((texture) && (globals4es.automipmap==1) && (texture->mipmap_auto==0)))
|
||||
switch (param) {
|
||||
case GL_NEAREST_MIPMAP_NEAREST:
|
||||
case GL_NEAREST_MIPMAP_LINEAR:
|
||||
@@ -1350,11 +1341,11 @@ void glshim_glTexParameteri(GLenum target, GLenum pname, GLint param) {
|
||||
errorGL();
|
||||
}
|
||||
|
||||
void glshim_glTexParameterf(GLenum target, GLenum pname, GLfloat param) {
|
||||
glshim_glTexParameteri(target, pname, param);
|
||||
void gl4es_glTexParameterf(GLenum target, GLenum pname, GLfloat param) {
|
||||
gl4es_glTexParameteri(target, pname, param);
|
||||
}
|
||||
|
||||
void glshim_glDeleteTextures(GLsizei n, const GLuint *textures) {
|
||||
void gl4es_glDeleteTextures(GLsizei n, const GLuint *textures) {
|
||||
if (glstate->gl_batch) flush();
|
||||
noerrorShim();
|
||||
LOAD_GLES(glDeleteTextures);
|
||||
@@ -1375,7 +1366,7 @@ void glshim_glDeleteTextures(GLsizei n, const GLuint *textures) {
|
||||
gles_glDeleteTextures(1, &tex->glname);
|
||||
errorGL();
|
||||
#ifdef TEXSTREAM
|
||||
if (texstream && tex->streamed)
|
||||
if (globals4es.texstream && tex->streamed)
|
||||
FreeStreamed(tex->streamingID);
|
||||
#endif
|
||||
#if 1
|
||||
@@ -1394,7 +1385,7 @@ void glshim_glDeleteTextures(GLsizei n, const GLuint *textures) {
|
||||
}
|
||||
}
|
||||
|
||||
void glshim_glGenTextures(GLsizei n, GLuint * textures) {
|
||||
void gl4es_glGenTextures(GLsizei n, GLuint * textures) {
|
||||
if (n<=0)
|
||||
return;
|
||||
if (glstate->gl_batch) flush();
|
||||
@@ -1442,12 +1433,12 @@ void glshim_glGenTextures(GLsizei n, GLuint * textures) {
|
||||
}
|
||||
}
|
||||
|
||||
GLboolean glshim_glAreTexturesResident(GLsizei n, const GLuint *textures, GLboolean *residences) {
|
||||
GLboolean gl4es_glAreTexturesResident(GLsizei n, const GLuint *textures, GLboolean *residences) {
|
||||
noerrorShim();
|
||||
return true;
|
||||
}
|
||||
|
||||
void glshim_glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint *params) {
|
||||
void gl4es_glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint *params) {
|
||||
//printf("glGetTexLevelParameteriv(%s, %d, %s, %p)\n", PrintEnum(target), level, PrintEnum(pname), params);
|
||||
// simplification: (mostly) not taking "target" into account here
|
||||
if (glstate->gl_batch) flush();
|
||||
@@ -1551,7 +1542,8 @@ void pushViewport(GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
void popViewport();
|
||||
|
||||
|
||||
void glshim_glGetTexImage(GLenum target, GLint level, GLenum format, GLenum type, GLvoid * img) {
|
||||
void gl4es_glGetTexImage(GLenum target, GLint level, GLenum format, GLenum type, GLvoid * img) {
|
||||
//printf("glGetTexImage(%s, %i, %s, %s, %p)\n", PrintEnum(target), level, PrintEnum(format), PrintEnum(type), img);
|
||||
GLuint old_glbatch = glstate->gl_batch;
|
||||
if (glstate->gl_batch) {
|
||||
flush();
|
||||
@@ -1562,11 +1554,14 @@ void glshim_glGetTexImage(GLenum target, GLint level, GLenum format, GLenum type
|
||||
gltexture_t* bound = glstate->texture.bound[glstate->texture.active];
|
||||
int width = bound->width;
|
||||
int height = bound->height;
|
||||
int nwidth = bound->nwidth;
|
||||
int nheight = bound->nheight;
|
||||
int shrink = bound->shrink;
|
||||
if (level != 0) {
|
||||
//printf("STUBBED glGetTexImage with level=%i\n", level);
|
||||
void* tmp = malloc(width*height*pixel_sizeof(format, type)); // tmp space...
|
||||
void* tmp2;
|
||||
glshim_glGetTexImage(target, 0, format, type, tmp);
|
||||
gl4es_glGetTexImage(target, 0, format, type, tmp);
|
||||
for (int i=0; i<level; i++) {
|
||||
pixel_halfscale(tmp, &tmp2, width, height, format, type);
|
||||
free(tmp);
|
||||
@@ -1593,7 +1588,7 @@ void glshim_glGetTexImage(GLenum target, GLint level, GLenum format, GLenum type
|
||||
if (glstate->vao->pack)
|
||||
dst += (uintptr_t)glstate->vao->pack->data;
|
||||
#ifdef TEXSTREAM
|
||||
if (texstream && bound->streamed) {
|
||||
if (globals4es.texstream && bound->streamed) {
|
||||
noerrorShim();
|
||||
pixel_convert(GetStreamingBuffer(bound->streamingID), &dst, width, height, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, format, type, 0);
|
||||
readfboEnd();
|
||||
@@ -1602,7 +1597,7 @@ void glshim_glGetTexImage(GLenum target, GLint level, GLenum format, GLenum type
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if (texcopydata && bound->data) {
|
||||
if (globals4es.texcopydata && bound->data) {
|
||||
//printf("texcopydata* glGetTexImage(0x%04X, %d, 0x%04x, 0x%04X, %p)\n", target, level, format, type, img);
|
||||
noerrorShim();
|
||||
if (!pixel_convert(bound->data, &dst, width, height, GL_RGBA, GL_UNSIGNED_BYTE, format, type, 0))
|
||||
@@ -1614,24 +1609,24 @@ void glshim_glGetTexImage(GLenum target, GLint level, GLenum format, GLenum type
|
||||
GLuint fbo;
|
||||
|
||||
// if the texture is not RGBA or RGB or ALPHA, the "just attach texture to the fbo" trick will not work, and a full Blit has to be done
|
||||
if(bound->format==GL_RGBA || bound->format==GL_RGB || bound->format==GL_ALPHA) {
|
||||
glshim_glGenFramebuffers(1, &fbo);
|
||||
glshim_glBindFramebuffer(GL_FRAMEBUFFER_OES, fbo);
|
||||
glshim_glFramebufferTexture2D(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, GL_TEXTURE_2D, oldBind, 0);
|
||||
if((bound->format==GL_RGBA || bound->format==GL_RGB || bound->format==GL_ALPHA) && (shrink==0)) {
|
||||
gl4es_glGenFramebuffers(1, &fbo);
|
||||
gl4es_glBindFramebuffer(GL_FRAMEBUFFER_OES, fbo);
|
||||
gl4es_glFramebufferTexture2D(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, GL_TEXTURE_2D, oldBind, 0);
|
||||
// Read the pixels!
|
||||
glshim_glReadPixels(0, 0, width, height, format, type, img); // using "full" version with conversion of format/type
|
||||
glshim_glBindFramebuffer(GL_FRAMEBUFFER_OES, old_fbo);
|
||||
glshim_glDeleteFramebuffers(1, &fbo);
|
||||
gl4es_glReadPixels(0, nheight-height, width, height, format, type, img); // using "full" version with conversion of format/type
|
||||
gl4es_glBindFramebuffer(GL_FRAMEBUFFER_OES, old_fbo);
|
||||
gl4es_glDeleteFramebuffers(1, &fbo);
|
||||
noerrorShim();
|
||||
} else {
|
||||
glshim_glGenFramebuffers(1, &fbo);
|
||||
glshim_glBindFramebuffer(GL_FRAMEBUFFER_OES, fbo);
|
||||
gl4es_glGenFramebuffers(1, &fbo);
|
||||
gl4es_glBindFramebuffer(GL_FRAMEBUFFER_OES, fbo);
|
||||
GLuint temptex;
|
||||
glshim_glGenTextures(1, &temptex);
|
||||
glshim_glBindTexture(GL_TEXTURE_2D, temptex);
|
||||
glshim_glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, bound->nwidth, bound->nheight, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
|
||||
glshim_glFramebufferTexture2D(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, GL_TEXTURE_2D, temptex, 0);
|
||||
glshim_glBindTexture(GL_TEXTURE_2D, oldBind);
|
||||
gl4es_glGenTextures(1, &temptex);
|
||||
gl4es_glBindTexture(GL_TEXTURE_2D, temptex);
|
||||
gl4es_glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, nwidth<<shrink, nheight<<shrink, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
|
||||
gl4es_glFramebufferTexture2D(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, GL_TEXTURE_2D, temptex, 0);
|
||||
gl4es_glBindTexture(GL_TEXTURE_2D, oldBind);
|
||||
// blit the texture
|
||||
// TODO: create a blitTexture function (to be used in raster too)
|
||||
LOAD_GLES(glEnableClientState);
|
||||
@@ -1642,56 +1637,58 @@ void glshim_glGetTexImage(GLenum target, GLint level, GLenum format, GLenum type
|
||||
LOAD_GLES(glBindTexture);
|
||||
LOAD_GLES(glActiveTexture);
|
||||
LOAD_GLES(glClientActiveTexture);
|
||||
glshim_glPushAttrib(GL_TEXTURE_BIT | GL_ENABLE_BIT | GL_TRANSFORM_BIT | GL_COLOR_BUFFER_BIT | GL_CURRENT_BIT);
|
||||
gl4es_glPushAttrib(GL_TEXTURE_BIT | GL_ENABLE_BIT | GL_TRANSFORM_BIT | GL_COLOR_BUFFER_BIT | GL_CURRENT_BIT);
|
||||
GLfloat old_projection[16], old_modelview[16], old_texture[16];
|
||||
|
||||
glshim_glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
glshim_glClear(GL_COLOR_BUFFER_BIT);
|
||||
gl4es_glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
gl4es_glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
GLuint old_tex = glstate->texture.active;
|
||||
if (old_tex!=0) gles_glActiveTexture(GL_TEXTURE0);
|
||||
GLuint old_cli = glstate->texture.client;
|
||||
if (old_cli!=0) gles_glClientActiveTexture(GL_TEXTURE0);
|
||||
glshim_glGetFloatv(GL_TEXTURE_MATRIX, old_texture);
|
||||
glshim_glGetFloatv(GL_PROJECTION_MATRIX, old_projection);
|
||||
glshim_glGetFloatv(GL_MODELVIEW_MATRIX, old_modelview);
|
||||
glshim_glMatrixMode(GL_TEXTURE);
|
||||
glshim_glLoadIdentity();
|
||||
glshim_glMatrixMode(GL_PROJECTION);
|
||||
glshim_glLoadIdentity();
|
||||
glshim_glMatrixMode(GL_MODELVIEW);
|
||||
glshim_glLoadIdentity();
|
||||
gl4es_glGetFloatv(GL_TEXTURE_MATRIX, old_texture);
|
||||
gl4es_glGetFloatv(GL_PROJECTION_MATRIX, old_projection);
|
||||
gl4es_glGetFloatv(GL_MODELVIEW_MATRIX, old_modelview);
|
||||
gl4es_glMatrixMode(GL_TEXTURE);
|
||||
gl4es_glLoadIdentity();
|
||||
gl4es_glMatrixMode(GL_PROJECTION);
|
||||
gl4es_glLoadIdentity();
|
||||
gl4es_glMatrixMode(GL_MODELVIEW);
|
||||
gl4es_glLoadIdentity();
|
||||
|
||||
pushViewport(0,0,bound->nwidth, bound->nheight);
|
||||
float w2 = 2.0f / bound->nwidth;
|
||||
float h2 = 2.0f / bound->nheight;
|
||||
pushViewport(0,0,nwidth<<shrink, nheight<<shrink);
|
||||
float w2 = 2.0f / nwidth;
|
||||
float h2 = 2.0f / nheight;
|
||||
float blit_x1=0;
|
||||
float blit_x2=bound->nwidth;
|
||||
float blit_x2=width;
|
||||
float blit_y1=0;
|
||||
float blit_y2=bound->nheight;
|
||||
float blit_y2=height;
|
||||
GLfloat blit_vert[] = {
|
||||
blit_x1*w2-1.0f, blit_y1*h2-1.0f,
|
||||
blit_x2*w2-1.0f, blit_y1*h2-1.0f,
|
||||
blit_x2*w2-1.0f, blit_y2*h2-1.0f,
|
||||
blit_x1*w2-1.0f, blit_y2*h2-1.0f
|
||||
};
|
||||
GLfloat rw = ((GLfloat)width)/nwidth;
|
||||
GLfloat rh = ((GLfloat)height)/nheight;
|
||||
GLfloat blit_tex[] = {
|
||||
0, 0,
|
||||
1, 0,
|
||||
1, 1,
|
||||
0, 1
|
||||
0, 0,
|
||||
rw, 0,
|
||||
rw, rh,
|
||||
0, rh
|
||||
};
|
||||
|
||||
glshim_glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT | GL_CLIENT_PIXEL_STORE_BIT);
|
||||
gl4es_glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT | GL_CLIENT_PIXEL_STORE_BIT);
|
||||
|
||||
glshim_glDisable(GL_DEPTH_TEST);
|
||||
glshim_glDisable(GL_LIGHTING);
|
||||
glshim_glDisable(GL_CULL_FACE);
|
||||
glshim_glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
gl4es_glDisable(GL_DEPTH_TEST);
|
||||
gl4es_glDisable(GL_LIGHTING);
|
||||
gl4es_glDisable(GL_CULL_FACE);
|
||||
gl4es_glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
|
||||
glshim_glEnable(GL_TEXTURE_2D);
|
||||
gl4es_glEnable(GL_TEXTURE_2D);
|
||||
gles_glBindTexture(GL_TEXTURE_2D, oldBind);
|
||||
glshim_glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
gl4es_glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
|
||||
if(!glstate->clientstate.vertex_array)
|
||||
{
|
||||
@@ -1724,19 +1721,19 @@ void glshim_glGetTexImage(GLenum target, GLint level, GLenum format, GLenum type
|
||||
// All the previous states are Pushed / Poped anyway...
|
||||
if (old_tex!=0) gles_glActiveTexture(GL_TEXTURE0+old_tex);
|
||||
if (old_cli!=0) gles_glClientActiveTexture(GL_TEXTURE0+old_cli);
|
||||
glshim_glPopClientAttrib();
|
||||
glshim_glMatrixMode(GL_TEXTURE);
|
||||
glshim_glLoadMatrixf(old_texture);
|
||||
glshim_glMatrixMode(GL_MODELVIEW);
|
||||
glshim_glLoadMatrixf(old_modelview);
|
||||
glshim_glMatrixMode(GL_PROJECTION);
|
||||
glshim_glLoadMatrixf(old_projection);
|
||||
glshim_glPopAttrib();
|
||||
gl4es_glPopClientAttrib();
|
||||
gl4es_glMatrixMode(GL_TEXTURE);
|
||||
gl4es_glLoadMatrixf(old_texture);
|
||||
gl4es_glMatrixMode(GL_MODELVIEW);
|
||||
gl4es_glLoadMatrixf(old_modelview);
|
||||
gl4es_glMatrixMode(GL_PROJECTION);
|
||||
gl4es_glLoadMatrixf(old_projection);
|
||||
gl4es_glPopAttrib();
|
||||
// Read the pixels!
|
||||
glshim_glReadPixels(0, 0, width, height, format, type, img); // using "full" version with conversion of format/type
|
||||
glshim_glBindFramebuffer(GL_FRAMEBUFFER_OES, old_fbo);
|
||||
glshim_glDeleteFramebuffers(1, &fbo);
|
||||
glshim_glDeleteTextures(1, &temptex);
|
||||
gl4es_glReadPixels(0, (nheight-height)<<shrink, width<<shrink, height<<shrink, format, type, img); // using "full" version with conversion of format/type
|
||||
gl4es_glBindFramebuffer(GL_FRAMEBUFFER_OES, old_fbo);
|
||||
gl4es_glDeleteFramebuffers(1, &fbo);
|
||||
gl4es_glDeleteTextures(1, &temptex);
|
||||
popViewport();
|
||||
noerrorShim();
|
||||
}
|
||||
@@ -1745,7 +1742,7 @@ void glshim_glGetTexImage(GLenum target, GLint level, GLenum format, GLenum type
|
||||
glstate->gl_batch=old_glbatch;
|
||||
}
|
||||
|
||||
void glshim_glActiveTexture( GLenum texture ) {
|
||||
void gl4es_glActiveTexture( GLenum texture ) {
|
||||
if (glstate->list.active && (glstate->gl_batch && !glstate->list.compiling)) {
|
||||
if (glstate->statebatch.active_tex_changed) {
|
||||
if(glstate->statebatch.active_tex == texture)
|
||||
@@ -1771,7 +1768,7 @@ void glshim_glActiveTexture( GLenum texture ) {
|
||||
errorGL();
|
||||
}
|
||||
|
||||
void glshim_glClientActiveTexture( GLenum texture ) {
|
||||
void gl4es_glClientActiveTexture( GLenum texture ) {
|
||||
if ((texture < GL_TEXTURE0) || (texture >= GL_TEXTURE0+MAX_TEX)) {
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
return;
|
||||
@@ -1785,7 +1782,7 @@ void glshim_glClientActiveTexture( GLenum texture ) {
|
||||
gles_glClientActiveTexture(texture);
|
||||
errorGL();
|
||||
}
|
||||
void glshim_glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid * data) {
|
||||
void gl4es_glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid * data) {
|
||||
//printf("glReadPixels(%i, %i, %i, %i, %s, %s, 0x%p)\n", x, y, width, height, PrintEnum(format), PrintEnum(type), data);
|
||||
GLuint old_glbatch = glstate->gl_batch;
|
||||
if (glstate->gl_batch) {
|
||||
@@ -1831,7 +1828,7 @@ void glshim_glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum
|
||||
return;
|
||||
}
|
||||
|
||||
void glshim_glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
||||
void gl4es_glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
||||
GLint x, GLint y, GLsizei width, GLsizei height) {
|
||||
//printf("glCopyTexSubImage2D(%s, %i, %i, %i, %i, %i, %i, %i), bounded texture=%u format/type=%s, %s\n", PrintEnum(target), level, xoffset, yoffset, x, y, width, height, (glstate->texture.bound[glstate->texture.active])?glstate->texture.bound[glstate->texture.active]->texture:0, PrintEnum((glstate->texture.bound[glstate->texture.active])?glstate->texture.bound[glstate->texture.active]->format:0), PrintEnum((glstate->texture.bound[glstate->texture.active])?glstate->texture.bound[glstate->texture.active]->type:0));
|
||||
// PUSH_IF_COMPILING(glCopyTexSubImage2D);
|
||||
@@ -1860,10 +1857,10 @@ void glshim_glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint
|
||||
if (bound && bound->streamed) {
|
||||
void* buff = GetStreamingBuffer(bound->streamingID);
|
||||
if ((bound->width == width) && (bound->height == height) && (xoffset == yoffset == 0)) {
|
||||
glshim_glReadPixels(x, y, width, height, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, buff);
|
||||
gl4es_glReadPixels(x, y, width, height, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, buff);
|
||||
} else {
|
||||
void* tmp = malloc(width*height*2);
|
||||
glshim_glReadPixels(x, y, width, height, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, tmp);
|
||||
gl4es_glReadPixels(x, y, width, height, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, tmp);
|
||||
for (int y=0; y<height; y++) {
|
||||
memcpy(buff+((yoffset+y)*bound->width+xoffset)*2, tmp+y*width*2, width*2);
|
||||
}
|
||||
@@ -1872,14 +1869,14 @@ void glshim_glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
if (copytex) {
|
||||
if (globals4es.copytex) {
|
||||
gles_glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
|
||||
} else {
|
||||
void* tmp = malloc(width*height*4);
|
||||
GLenum format = (bound)?bound->format:GL_RGBA;
|
||||
GLenum type = (bound)?bound->type:GL_UNSIGNED_BYTE;
|
||||
glshim_glReadPixels(x, y, width, height, format, type, tmp);
|
||||
glshim_glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, tmp);
|
||||
gl4es_glReadPixels(x, y, width, height, format, type, tmp);
|
||||
gl4es_glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, tmp);
|
||||
free(tmp);
|
||||
}
|
||||
}
|
||||
@@ -1890,7 +1887,7 @@ void glshim_glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint
|
||||
}
|
||||
|
||||
|
||||
void glshim_glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y,
|
||||
void gl4es_glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y,
|
||||
GLsizei width, GLsizei height, GLint border) {
|
||||
//printf("glCopyTexImage2D(0x%04X, %i, 0x%04X, %i, %i, %i, %i, %i), current_fb=%u\n", target, level, internalformat, x, y, width, height, border, current_fb);
|
||||
//PUSH_IF_COMPILING(glCopyTexImage2D);
|
||||
@@ -1908,13 +1905,13 @@ void glshim_glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat
|
||||
glstate->vao->pack = NULL;
|
||||
glstate->vao->unpack = NULL;
|
||||
|
||||
if (copytex) {
|
||||
if (globals4es.copytex) {
|
||||
LOAD_GLES(glCopyTexImage2D);
|
||||
gles_glCopyTexImage2D(target, level, GL_RGB, x, y, width, height, border);
|
||||
} else {
|
||||
void* tmp = malloc(width*height*4);
|
||||
glshim_glReadPixels(x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, tmp);
|
||||
glshim_glTexImage2D(target, level, internalformat, width, height, border, GL_RGBA, GL_UNSIGNED_BYTE, tmp);
|
||||
gl4es_glReadPixels(x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, tmp);
|
||||
gl4es_glTexImage2D(target, level, internalformat, width, height, border, GL_RGBA, GL_UNSIGNED_BYTE, tmp);
|
||||
free(tmp);
|
||||
}
|
||||
|
||||
@@ -1996,7 +1993,7 @@ GLvoid *uncompressDXTc(GLsizei width, GLsizei height, GLenum format, GLsizei ima
|
||||
return pixels;
|
||||
}
|
||||
|
||||
void glshim_glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat,
|
||||
void gl4es_glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat,
|
||||
GLsizei width, GLsizei height, GLint border,
|
||||
GLsizei imageSize, const GLvoid *data)
|
||||
{
|
||||
@@ -2088,12 +2085,12 @@ void glshim_glCompressedTexImage2D(GLenum target, GLint level, GLenum internalfo
|
||||
fact = 0;
|
||||
}
|
||||
int oldalign;
|
||||
glshim_glGetIntegerv(GL_UNPACK_ALIGNMENT, &oldalign);
|
||||
gl4es_glGetIntegerv(GL_UNPACK_ALIGNMENT, &oldalign);
|
||||
if (oldalign!=1)
|
||||
glshim_glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
glshim_glTexImage2D(target, level, format, width>>fact, height>>fact, border, format, type, half);
|
||||
gl4es_glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
gl4es_glTexImage2D(target, level, format, width>>fact, height>>fact, border, format, type, half);
|
||||
if (oldalign!=1)
|
||||
glshim_glPixelStorei(GL_UNPACK_ALIGNMENT, oldalign);
|
||||
gl4es_glPixelStorei(GL_UNPACK_ALIGNMENT, oldalign);
|
||||
if (half!=pixels)
|
||||
free(half);
|
||||
if (pixels!=datab)
|
||||
@@ -2109,7 +2106,7 @@ void glshim_glCompressedTexImage2D(GLenum target, GLint level, GLenum internalfo
|
||||
glstate->gl_batch = old_glbatch;
|
||||
}
|
||||
|
||||
void glshim_glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
||||
void gl4es_glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
||||
GLsizei width, GLsizei height, GLenum format,
|
||||
GLsizei imageSize, const GLvoid *data)
|
||||
{
|
||||
@@ -2160,15 +2157,15 @@ void glshim_glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset,
|
||||
#if 0
|
||||
pixel_thirdscale(pixels, &half, width, height, GL_RGBA, GL_UNSIGNED_BYTE);
|
||||
int oldalign;
|
||||
glshim_glGetIntegerv(GL_UNPACK_ALIGNMENT, &oldalign);
|
||||
if (oldalign!=1) glshim_glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
glshim_glTexSubImage2D(target, level, xoffset/2, yoffset/2, width/2, height/2, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4, half);
|
||||
if (oldalign!=1) glshim_glPixelStorei(GL_UNPACK_ALIGNMENT, oldalign);
|
||||
gl4es_glGetIntegerv(GL_UNPACK_ALIGNMENT, &oldalign);
|
||||
if (oldalign!=1) gl4es_glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
gl4es_glTexSubImage2D(target, level, xoffset/2, yoffset/2, width/2, height/2, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4, half);
|
||||
if (oldalign!=1) gl4es_glPixelStorei(GL_UNPACK_ALIGNMENT, oldalign);
|
||||
#else
|
||||
GLenum format = glstate->texture.bound[glstate->texture.active]->format;
|
||||
GLenum type = glstate->texture.bound[glstate->texture.active]->type;
|
||||
pixel_convert(pixels, &half, width, height, GL_RGBA, GL_UNSIGNED_BYTE, format, type, 0);
|
||||
glshim_glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, half);
|
||||
gl4es_glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, half);
|
||||
#endif
|
||||
if (half!=pixels)
|
||||
free(half);
|
||||
@@ -2180,7 +2177,7 @@ void glshim_glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset,
|
||||
glstate->gl_batch = old_glbatch;
|
||||
}
|
||||
|
||||
void glshim_glGetCompressedTexImage(GLenum target, GLint lod, GLvoid *img) {
|
||||
void gl4es_glGetCompressedTexImage(GLenum target, GLint lod, GLvoid *img) {
|
||||
if (glstate->gl_batch) flush();
|
||||
|
||||
gltexture_t* bound = glstate->texture.bound[glstate->texture.active];
|
||||
@@ -2207,7 +2204,7 @@ void glshim_glGetCompressedTexImage(GLenum target, GLint lod, GLvoid *img) {
|
||||
|
||||
// alloc the memory for source image and grab the file
|
||||
GLuint *src = (GLuint*)malloc(width*height*4);
|
||||
glshim_glGetTexImage(target, lod, GL_RGBA, GL_UNSIGNED_BYTE, (GLvoid*)src);
|
||||
gl4es_glGetTexImage(target, lod, GL_RGBA, GL_UNSIGNED_BYTE, (GLvoid*)src);
|
||||
GLuint tmp[4*4]; //this is the 4x4 block
|
||||
for (int y = 0; y < h; y+=4)
|
||||
for (int x = 0; x < w; x+=4) {
|
||||
@@ -2229,35 +2226,35 @@ void glshim_glGetCompressedTexImage(GLenum target, GLint lod, GLvoid *img) {
|
||||
return;
|
||||
}
|
||||
|
||||
void glshim_glCompressedTexImage1D(GLenum target, GLint level, GLenum internalformat,
|
||||
void gl4es_glCompressedTexImage1D(GLenum target, GLint level, GLenum internalformat,
|
||||
GLsizei width, GLint border,
|
||||
GLsizei imageSize, const GLvoid *data) {
|
||||
|
||||
glshim_glCompressedTexImage2D(target, level, internalformat, width, 1, border, imageSize, data);
|
||||
gl4es_glCompressedTexImage2D(target, level, internalformat, width, 1, border, imageSize, data);
|
||||
}
|
||||
|
||||
void glshim_glCompressedTexImage3D(GLenum target, GLint level, GLenum internalformat,
|
||||
void gl4es_glCompressedTexImage3D(GLenum target, GLint level, GLenum internalformat,
|
||||
GLsizei width, GLsizei height, GLsizei depth, GLint border,
|
||||
GLsizei imageSize, const GLvoid *data) {
|
||||
|
||||
glshim_glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data);
|
||||
gl4es_glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data);
|
||||
}
|
||||
|
||||
void glshim_glCompressedTexSubImage1D(GLenum target, GLint level, GLint xoffset,
|
||||
void gl4es_glCompressedTexSubImage1D(GLenum target, GLint level, GLint xoffset,
|
||||
GLsizei width, GLenum format,
|
||||
GLsizei imageSize, const GLvoid *data) {
|
||||
|
||||
glshim_glCompressedTexSubImage2D(target, level, xoffset, 0, width, 1, format, imageSize, data);
|
||||
gl4es_glCompressedTexSubImage2D(target, level, xoffset, 0, width, 1, format, imageSize, data);
|
||||
}
|
||||
void glshim_glCompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
|
||||
void gl4es_glCompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
|
||||
GLsizei width, GLsizei height, GLsizei depth, GLenum format,
|
||||
GLsizei imageSize, const GLvoid *data) {
|
||||
|
||||
glshim_glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);
|
||||
gl4es_glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);
|
||||
}
|
||||
|
||||
|
||||
void glshim_glTexEnvf(GLenum target, GLenum pname, GLfloat param) {
|
||||
void gl4es_glTexEnvf(GLenum target, GLenum pname, GLfloat param) {
|
||||
LOAD_GLES(glTexEnvf);
|
||||
PUSH_IF_COMPILING(glTexEnvf);
|
||||
|
||||
@@ -2265,14 +2262,14 @@ void glshim_glTexEnvf(GLenum target, GLenum pname, GLfloat param) {
|
||||
glstate->texture.pscoordreplace[glstate->texture.active] = (param!=0.0f)?1:0;
|
||||
gles_glTexEnvf(target, pname, param);
|
||||
}
|
||||
void glshim_glTexEnvi(GLenum target, GLenum pname, GLint param) {
|
||||
void gl4es_glTexEnvi(GLenum target, GLenum pname, GLint param) {
|
||||
LOAD_GLES(glTexEnvi);
|
||||
PUSH_IF_COMPILING(glTexEnvi);
|
||||
if(target==GL_POINT_SPRITE && pname==GL_COORD_REPLACE)
|
||||
glstate->texture.pscoordreplace[glstate->texture.active] = (param!=0)?1:0;
|
||||
gles_glTexEnvi(target, pname, param);
|
||||
}
|
||||
void glshim_glTexEnvfv(GLenum target, GLenum pname, const GLfloat *param) {
|
||||
void gl4es_glTexEnvfv(GLenum target, GLenum pname, const GLfloat *param) {
|
||||
if ((glstate->list.compiling || glstate->gl_batch) && glstate->list.active) {
|
||||
NewStage(glstate->list.active, STAGE_TEXENV);
|
||||
rlTexEnvfv(glstate->list.active, target, pname, param);
|
||||
@@ -2282,7 +2279,7 @@ void glshim_glTexEnvfv(GLenum target, GLenum pname, const GLfloat *param) {
|
||||
LOAD_GLES(glTexEnvfv);
|
||||
gles_glTexEnvfv(target, pname, param);
|
||||
}
|
||||
void glshim_glTexEnviv(GLenum target, GLenum pname, const GLint *param) {
|
||||
void gl4es_glTexEnviv(GLenum target, GLenum pname, const GLint *param) {
|
||||
if ((glstate->list.compiling || glstate->gl_batch) && glstate->list.active) {
|
||||
NewStage(glstate->list.active, STAGE_TEXENV);
|
||||
rlTexEnviv(glstate->list.active, target, pname, param);
|
||||
@@ -2292,7 +2289,7 @@ void glshim_glTexEnviv(GLenum target, GLenum pname, const GLint *param) {
|
||||
LOAD_GLES(glTexEnviv);
|
||||
gles_glTexEnviv(target, pname, param);
|
||||
}
|
||||
void glshim_glGetTexEnvfv(GLenum target, GLenum pname, GLfloat * params) {
|
||||
void gl4es_glGetTexEnvfv(GLenum target, GLenum pname, GLfloat * params) {
|
||||
LOAD_GLES(glGetTexEnvfv);
|
||||
if (glstate->list.active && (glstate->gl_batch && !glstate->list.compiling)) flush();
|
||||
if(target==GL_POINT_SPRITE && pname==GL_COORD_REPLACE)
|
||||
@@ -2301,7 +2298,7 @@ void glshim_glGetTexEnvfv(GLenum target, GLenum pname, GLfloat * params) {
|
||||
gles_glGetTexEnvfv(target, pname, params);
|
||||
|
||||
}
|
||||
void glshim_glGetTexEnviv(GLenum target, GLenum pname, GLint * params) {
|
||||
void gl4es_glGetTexEnviv(GLenum target, GLenum pname, GLint * params) {
|
||||
LOAD_GLES(glGetTexEnviv);
|
||||
if (glstate->list.active && (glstate->gl_batch && !glstate->list.compiling)) flush();
|
||||
if(target==GL_POINT_SPRITE && pname==GL_COORD_REPLACE)
|
||||
@@ -2312,64 +2309,64 @@ void glshim_glGetTexEnviv(GLenum target, GLenum pname, GLint * params) {
|
||||
|
||||
|
||||
//Direct wrapper
|
||||
void glTexImage2D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *data) AliasExport("glshim_glTexImage2D");
|
||||
void glTexImage1D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *data) AliasExport("glshim_glTexImage1D");
|
||||
void glTexImage3D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *data) AliasExport("glshim_glTexImage3D");
|
||||
void glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *data) AliasExport("glshim_glTexSubImage2D");
|
||||
void glTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *data) AliasExport("glshim_glTexSubImage1D");
|
||||
void glTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *data) AliasExport("glshim_glTexSubImage3D");
|
||||
void glBindTexture(GLenum target, GLuint texture) AliasExport("glshim_glBindTexture");
|
||||
void glGenTextures(GLsizei n, GLuint * textures) AliasExport("glshim_glGenTextures");
|
||||
void glDeleteTextures(GLsizei n, const GLuint * textures) AliasExport("glshim_glDeleteTextures");
|
||||
void glTexParameteri(GLenum target, GLenum pname, GLint param) AliasExport("glshim_glTexParameteri");
|
||||
void glTexParameterf(GLenum target, GLenum pname, GLfloat param) AliasExport("glshim_glTexParameterf");
|
||||
GLboolean glAreTexturesResident(GLsizei n, const GLuint *textures, GLboolean *residences) AliasExport("glshim_glAreTexturesResident");
|
||||
void glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint *params) AliasExport("glshim_glGetTexLevelParameteriv");
|
||||
void glGetTexImage(GLenum target, GLint level, GLenum format, GLenum type, GLvoid * img) AliasExport("glshim_glGetTexImage");
|
||||
void glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid * data) AliasExport("glshim_glReadPixels");
|
||||
void glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data) AliasExport("glshim_glCompressedTexImage2D");
|
||||
void glCompressedTexImage1D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data) AliasExport("glshim_glCompressedTexImage1D");
|
||||
void glCompressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data) AliasExport("glshim_glCompressedTexImage3D");
|
||||
void glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data) AliasExport("glshim_glCompressedTexSubImage2D");
|
||||
void glCompressedTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data) AliasExport("glshim_glCompressedTexSubImage1D");
|
||||
void glCompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data) AliasExport("glshim_glCompressedTexSubImage3D");
|
||||
void glGetCompressedTexImage(GLenum target, GLint lod, GLvoid *img) AliasExport("glshim_glGetCompressedTexImage");
|
||||
void glCopyTexImage1D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) AliasExport("glshim_glCopyTexImage1D");
|
||||
void glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) AliasExport("glshim_glCopyTexImage2D");
|
||||
void glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) AliasExport("glshim_glCopyTexSubImage2D");
|
||||
void glCopyTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) AliasExport("glshim_glCopyTexSubImage1D");
|
||||
void glCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) AliasExport("glshim_glCopyTexSubImage3D");
|
||||
void glActiveTexture( GLenum texture ) AliasExport("glshim_glActiveTexture");
|
||||
void glClientActiveTexture( GLenum texture ) AliasExport("glshim_glClientActiveTexture");
|
||||
GLboolean glIsTexture( GLuint texture ) AliasExport("glshim_glIsTexture");
|
||||
void glPixelStorei(GLenum pname, GLint param) AliasExport("glshim_glPixelStorei");
|
||||
void glTexEnvf(GLenum target, GLenum pname, GLfloat param) AliasExport("glshim_glTexEnvf");
|
||||
void glTexEnvi(GLenum target, GLenum pname, GLint param) AliasExport("glshim_glTexEnvi");
|
||||
void glTexEnvfv(GLenum target, GLenum pname, const GLfloat *param) AliasExport("glshim_glTexEnvfv");
|
||||
void glTexEnviv(GLenum target, GLenum pname, const GLint *param) AliasExport("glshim_glTexEnviv");
|
||||
void glGetTexEnvfv(GLenum target, GLenum pname, GLfloat * params) AliasExport("glshim_glGetTexEnvfv");
|
||||
void glGetTexEnviv(GLenum target, GLenum pname, GLint * params) AliasExport("glshim_glGetTexEnviv");
|
||||
void glTexImage2D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *data) AliasExport("gl4es_glTexImage2D");
|
||||
void glTexImage1D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *data) AliasExport("gl4es_glTexImage1D");
|
||||
void glTexImage3D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *data) AliasExport("gl4es_glTexImage3D");
|
||||
void glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *data) AliasExport("gl4es_glTexSubImage2D");
|
||||
void glTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *data) AliasExport("gl4es_glTexSubImage1D");
|
||||
void glTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *data) AliasExport("gl4es_glTexSubImage3D");
|
||||
void glBindTexture(GLenum target, GLuint texture) AliasExport("gl4es_glBindTexture");
|
||||
void glGenTextures(GLsizei n, GLuint * textures) AliasExport("gl4es_glGenTextures");
|
||||
void glDeleteTextures(GLsizei n, const GLuint * textures) AliasExport("gl4es_glDeleteTextures");
|
||||
void glTexParameteri(GLenum target, GLenum pname, GLint param) AliasExport("gl4es_glTexParameteri");
|
||||
void glTexParameterf(GLenum target, GLenum pname, GLfloat param) AliasExport("gl4es_glTexParameterf");
|
||||
GLboolean glAreTexturesResident(GLsizei n, const GLuint *textures, GLboolean *residences) AliasExport("gl4es_glAreTexturesResident");
|
||||
void glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint *params) AliasExport("gl4es_glGetTexLevelParameteriv");
|
||||
void glGetTexImage(GLenum target, GLint level, GLenum format, GLenum type, GLvoid * img) AliasExport("gl4es_glGetTexImage");
|
||||
void glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid * data) AliasExport("gl4es_glReadPixels");
|
||||
void glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data) AliasExport("gl4es_glCompressedTexImage2D");
|
||||
void glCompressedTexImage1D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data) AliasExport("gl4es_glCompressedTexImage1D");
|
||||
void glCompressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data) AliasExport("gl4es_glCompressedTexImage3D");
|
||||
void glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data) AliasExport("gl4es_glCompressedTexSubImage2D");
|
||||
void glCompressedTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data) AliasExport("gl4es_glCompressedTexSubImage1D");
|
||||
void glCompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data) AliasExport("gl4es_glCompressedTexSubImage3D");
|
||||
void glGetCompressedTexImage(GLenum target, GLint lod, GLvoid *img) AliasExport("gl4es_glGetCompressedTexImage");
|
||||
void glCopyTexImage1D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) AliasExport("gl4es_glCopyTexImage1D");
|
||||
void glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) AliasExport("gl4es_glCopyTexImage2D");
|
||||
void glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) AliasExport("gl4es_glCopyTexSubImage2D");
|
||||
void glCopyTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) AliasExport("gl4es_glCopyTexSubImage1D");
|
||||
void glCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) AliasExport("gl4es_glCopyTexSubImage3D");
|
||||
void glActiveTexture( GLenum texture ) AliasExport("gl4es_glActiveTexture");
|
||||
void glClientActiveTexture( GLenum texture ) AliasExport("gl4es_glClientActiveTexture");
|
||||
GLboolean glIsTexture( GLuint texture ) AliasExport("gl4es_glIsTexture");
|
||||
void glPixelStorei(GLenum pname, GLint param) AliasExport("gl4es_glPixelStorei");
|
||||
void glTexEnvf(GLenum target, GLenum pname, GLfloat param) AliasExport("gl4es_glTexEnvf");
|
||||
void glTexEnvi(GLenum target, GLenum pname, GLint param) AliasExport("gl4es_glTexEnvi");
|
||||
void glTexEnvfv(GLenum target, GLenum pname, const GLfloat *param) AliasExport("gl4es_glTexEnvfv");
|
||||
void glTexEnviv(GLenum target, GLenum pname, const GLint *param) AliasExport("gl4es_glTexEnviv");
|
||||
void glGetTexEnvfv(GLenum target, GLenum pname, GLfloat * params) AliasExport("gl4es_glGetTexEnvfv");
|
||||
void glGetTexEnviv(GLenum target, GLenum pname, GLint * params) AliasExport("gl4es_glGetTexEnviv");
|
||||
|
||||
//EXT mapper
|
||||
void glTexSubImage3DEXT(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *data) AliasExport("glshim_glTexSubImage3D");
|
||||
void glCompressedTexImage2DEXT(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data) AliasExport("glshim_glCompressedTexImage2D");
|
||||
void glCompressedTexImage1DEXT(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data) AliasExport("glshim_glCompressedTexImage1D");
|
||||
void glCompressedTexImage3DEXT(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data) AliasExport("glshim_glCompressedTexImage3D");
|
||||
void glCompressedTexSubImage2DEXT(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data) AliasExport("glshim_glCompressedTexSubImage2D");
|
||||
void glCompressedTexSubImage1DEXT(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data) AliasExport("glshim_glCompressedTexSubImage1D");
|
||||
void glCompressedTexSubImage3DEXT(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data) AliasExport("glshim_glCompressedTexSubImage3D");
|
||||
void glGetCompressedTexImageEXT(GLenum target, GLint lod, GLvoid *img) AliasExport("glshim_glGetCompressedTexImage");
|
||||
void glCopyTexSubImage3DEXT(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) AliasExport("glshim_glCopyTexSubImage3D");
|
||||
void glTexSubImage3DEXT(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *data) AliasExport("gl4es_glTexSubImage3D");
|
||||
void glCompressedTexImage2DEXT(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data) AliasExport("gl4es_glCompressedTexImage2D");
|
||||
void glCompressedTexImage1DEXT(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data) AliasExport("gl4es_glCompressedTexImage1D");
|
||||
void glCompressedTexImage3DEXT(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data) AliasExport("gl4es_glCompressedTexImage3D");
|
||||
void glCompressedTexSubImage2DEXT(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data) AliasExport("gl4es_glCompressedTexSubImage2D");
|
||||
void glCompressedTexSubImage1DEXT(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data) AliasExport("gl4es_glCompressedTexSubImage1D");
|
||||
void glCompressedTexSubImage3DEXT(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data) AliasExport("gl4es_glCompressedTexSubImage3D");
|
||||
void glGetCompressedTexImageEXT(GLenum target, GLint lod, GLvoid *img) AliasExport("gl4es_glGetCompressedTexImage");
|
||||
void glCopyTexSubImage3DEXT(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) AliasExport("gl4es_glCopyTexSubImage3D");
|
||||
|
||||
//ARB mapper
|
||||
void glActiveTextureARB(GLenum texture) AliasExport("glshim_glActiveTexture");
|
||||
void glClientActiveTextureARB(GLenum texture) AliasExport("glshim_glClientActiveTexture");
|
||||
void glTexSubImage3DARB(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *data) AliasExport("glshim_glTexSubImage3D");
|
||||
void glCompressedTexImage2DARB(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data) AliasExport("glshim_glCompressedTexImage2D");
|
||||
void glCompressedTexImage1DARB(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data) AliasExport("glshim_glCompressedTexImage1D");
|
||||
void glCompressedTexImage3DARB(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data) AliasExport("glshim_glCompressedTexImage3D");
|
||||
void glCompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data) AliasExport("glshim_glCompressedTexSubImage2D");
|
||||
void glCompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data) AliasExport("glshim_glCompressedTexSubImage1D");
|
||||
void glCompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data) AliasExport("glshim_glCompressedTexSubImage3D");
|
||||
void glGetCompressedTexImageARB(GLenum target, GLint lod, GLvoid *img) AliasExport("glshim_glGetCompressedTexImage");
|
||||
void glCopyTexSubImage3DARB(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) AliasExport("glshim_glCopyTexSubImage3D");
|
||||
void glActiveTextureARB(GLenum texture) AliasExport("gl4es_glActiveTexture");
|
||||
void glClientActiveTextureARB(GLenum texture) AliasExport("gl4es_glClientActiveTexture");
|
||||
void glTexSubImage3DARB(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *data) AliasExport("gl4es_glTexSubImage3D");
|
||||
void glCompressedTexImage2DARB(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data) AliasExport("gl4es_glCompressedTexImage2D");
|
||||
void glCompressedTexImage1DARB(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data) AliasExport("gl4es_glCompressedTexImage1D");
|
||||
void glCompressedTexImage3DARB(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data) AliasExport("gl4es_glCompressedTexImage3D");
|
||||
void glCompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data) AliasExport("gl4es_glCompressedTexSubImage2D");
|
||||
void glCompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data) AliasExport("gl4es_glCompressedTexSubImage1D");
|
||||
void glCompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data) AliasExport("gl4es_glCompressedTexSubImage3D");
|
||||
void glGetCompressedTexImageARB(GLenum target, GLint lod, GLvoid *img) AliasExport("gl4es_glGetCompressedTexImage");
|
||||
void glCopyTexSubImage3DARB(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) AliasExport("gl4es_glCopyTexSubImage3D");
|
||||
|
||||
@@ -3,84 +3,84 @@
|
||||
#ifndef GL_TEXTURE_H
|
||||
#define GL_TEXTURE_H
|
||||
|
||||
void glshim_glTexImage2D(GLenum target, GLint level, GLint internalFormat,
|
||||
void gl4es_glTexImage2D(GLenum target, GLint level, GLint internalFormat,
|
||||
GLsizei width, GLsizei height, GLint border,
|
||||
GLenum format, GLenum type, const GLvoid *data);
|
||||
|
||||
void glshim_glTexImage1D(GLenum target, GLint level, GLint internalFormat,
|
||||
void gl4es_glTexImage1D(GLenum target, GLint level, GLint internalFormat,
|
||||
GLsizei width, GLint border,
|
||||
GLenum format, GLenum type, const GLvoid *data);
|
||||
|
||||
void glshim_glTexImage3D(GLenum target, GLint level, GLint internalFormat,
|
||||
void gl4es_glTexImage3D(GLenum target, GLint level, GLint internalFormat,
|
||||
GLsizei width, GLsizei height, GLsizei depth,
|
||||
GLint border, GLenum format, GLenum type, const GLvoid *data);
|
||||
|
||||
void glshim_glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
||||
void gl4es_glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
||||
GLsizei width, GLsizei height, GLenum format, GLenum type,
|
||||
const GLvoid *data);
|
||||
|
||||
void glshim_glTexSubImage1D(GLenum target, GLint level, GLint xoffset,
|
||||
void gl4es_glTexSubImage1D(GLenum target, GLint level, GLint xoffset,
|
||||
GLsizei width, GLenum format, GLenum type,
|
||||
const GLvoid *data);
|
||||
|
||||
void glshim_glTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
|
||||
void gl4es_glTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
|
||||
GLsizei width, GLsizei height, GLsizei depth, GLenum format,
|
||||
GLenum type, const GLvoid *data);
|
||||
|
||||
void glshim_glBindTexture(GLenum target, GLuint texture);
|
||||
void glshim_glGenTextures(GLsizei n, GLuint * textures);
|
||||
void glshim_glDeleteTextures(GLsizei n, const GLuint * textures);
|
||||
void glshim_glTexParameteri(GLenum target, GLenum pname, GLint param);
|
||||
void glshim_glTexParameterf(GLenum target, GLenum pname, GLfloat param);
|
||||
GLboolean glshim_glAreTexturesResident(GLsizei n, const GLuint *textures, GLboolean *residences);
|
||||
void glshim_glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint *params);
|
||||
void glshim_glGetTexImage(GLenum target, GLint level, GLenum format, GLenum type, GLvoid * img);
|
||||
void glshim_glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid * data);
|
||||
void gl4es_glBindTexture(GLenum target, GLuint texture);
|
||||
void gl4es_glGenTextures(GLsizei n, GLuint * textures);
|
||||
void gl4es_glDeleteTextures(GLsizei n, const GLuint * textures);
|
||||
void gl4es_glTexParameteri(GLenum target, GLenum pname, GLint param);
|
||||
void gl4es_glTexParameterf(GLenum target, GLenum pname, GLfloat param);
|
||||
GLboolean gl4es_glAreTexturesResident(GLsizei n, const GLuint *textures, GLboolean *residences);
|
||||
void gl4es_glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint *params);
|
||||
void gl4es_glGetTexImage(GLenum target, GLint level, GLenum format, GLenum type, GLvoid * img);
|
||||
void gl4es_glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid * data);
|
||||
|
||||
void glshim_glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat,
|
||||
void gl4es_glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat,
|
||||
GLsizei width, GLsizei height, GLint border,
|
||||
GLsizei imageSize, const GLvoid *data);
|
||||
void glshim_glCompressedTexImage1D(GLenum target, GLint level, GLenum internalformat,
|
||||
void gl4es_glCompressedTexImage1D(GLenum target, GLint level, GLenum internalformat,
|
||||
GLsizei width, GLint border,
|
||||
GLsizei imageSize, const GLvoid *data);
|
||||
void glshim_glCompressedTexImage3D(GLenum target, GLint level, GLenum internalformat,
|
||||
void gl4es_glCompressedTexImage3D(GLenum target, GLint level, GLenum internalformat,
|
||||
GLsizei width, GLsizei height, GLsizei depth, GLint border,
|
||||
GLsizei imageSize, const GLvoid *data);
|
||||
|
||||
void glshim_glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
||||
void gl4es_glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
||||
GLsizei width, GLsizei height, GLenum format,
|
||||
GLsizei imageSize, const GLvoid *data);
|
||||
void glshim_glCompressedTexSubImage1D(GLenum target, GLint level, GLint xoffset,
|
||||
void gl4es_glCompressedTexSubImage1D(GLenum target, GLint level, GLint xoffset,
|
||||
GLsizei width, GLenum format,
|
||||
GLsizei imageSize, const GLvoid *data);
|
||||
void glshim_glCompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
|
||||
void gl4es_glCompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
|
||||
GLsizei width, GLsizei height, GLsizei depth, GLenum format,
|
||||
GLsizei imageSize, const GLvoid *data);
|
||||
|
||||
void glshim_glGetCompressedTexImage(GLenum target, GLint lod, GLvoid *img);
|
||||
void gl4es_glGetCompressedTexImage(GLenum target, GLint lod, GLvoid *img);
|
||||
|
||||
|
||||
void glshim_glCopyTexImage1D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y,
|
||||
void gl4es_glCopyTexImage1D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y,
|
||||
GLsizei width, GLint border);
|
||||
|
||||
void glshim_glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y,
|
||||
void gl4es_glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y,
|
||||
GLsizei width, GLsizei height, GLint border);
|
||||
|
||||
void glshim_glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
||||
void gl4es_glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
||||
GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
|
||||
void glshim_glCopyTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLint x, GLint y,
|
||||
void gl4es_glCopyTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLint x, GLint y,
|
||||
GLsizei width);
|
||||
|
||||
void glshim_glCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
|
||||
void gl4es_glCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
|
||||
GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
|
||||
void glshim_glTexEnvf(GLenum target, GLenum pname, GLfloat param);
|
||||
void glshim_glTexEnvi(GLenum target, GLenum pname, GLint param);
|
||||
void glshim_glTexEnvfv(GLenum target, GLenum pname, const GLfloat *param);
|
||||
void glshim_glTexEnviv(GLenum target, GLenum pname, const GLint *param);
|
||||
void glshim_glGetTexEnvfv(GLenum target, GLenum pname, GLfloat * params);
|
||||
void glshim_glGetTexEnviv(GLenum target, GLenum pname, GLint * params);
|
||||
void gl4es_glTexEnvf(GLenum target, GLenum pname, GLfloat param);
|
||||
void gl4es_glTexEnvi(GLenum target, GLenum pname, GLint param);
|
||||
void gl4es_glTexEnvfv(GLenum target, GLenum pname, const GLfloat *param);
|
||||
void gl4es_glTexEnviv(GLenum target, GLenum pname, const GLint *param);
|
||||
void gl4es_glGetTexEnvfv(GLenum target, GLenum pname, GLfloat * params);
|
||||
void gl4es_glGetTexEnviv(GLenum target, GLenum pname, GLint * params);
|
||||
|
||||
|
||||
void tex_coord_rect_arb(GLfloat *tex, GLsizei len,
|
||||
@@ -133,12 +133,12 @@ static inline GLenum map_tex_target(GLenum target) {
|
||||
}
|
||||
return target;
|
||||
}
|
||||
gltexture_t* glshim_getTexture(GLenum target, GLuint texture);
|
||||
gltexture_t* gl4es_getTexture(GLenum target, GLuint texture);
|
||||
|
||||
void glshim_glActiveTexture( GLenum texture );
|
||||
void glshim_glClientActiveTexture( GLenum texture );
|
||||
void glshim_glMultiTexCoord2f( GLenum target, GLfloat s, GLfloat t );
|
||||
GLboolean glshim_glIsTexture( GLuint texture );
|
||||
void gl4es_glActiveTexture( GLenum texture );
|
||||
void gl4es_glClientActiveTexture( GLenum texture );
|
||||
void gl4es_glMultiTexCoord2f( GLenum target, GLfloat s, GLfloat t );
|
||||
GLboolean gl4es_glIsTexture( GLuint texture );
|
||||
|
||||
void tex_setup_texcoord(GLuint len);
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -7,78 +7,78 @@
|
||||
|
||||
// misc naive wrappers
|
||||
#ifdef USE_ES2
|
||||
void glshim_glCompileShaderARB(GLuint shader);
|
||||
GLuint glshim_glCreateShaderObjectARB(GLenum shaderType);
|
||||
void glshim_glGetObjectParameterivARB(GLuint shader, GLenum pname, GLint *params);
|
||||
void glshim_glShaderSourceARB(GLuint shader, GLsizei count, const GLchar **string, const GLint *length);
|
||||
void gl4es_glCompileShaderARB(GLuint shader);
|
||||
GLuint gl4es_glCreateShaderObjectARB(GLenum shaderType);
|
||||
void gl4es_glGetObjectParameterivARB(GLuint shader, GLenum pname, GLint *params);
|
||||
void gl4es_glShaderSourceARB(GLuint shader, GLsizei count, const GLchar **string, const GLint *length);
|
||||
#endif
|
||||
|
||||
void glshim_glClearDepth(GLdouble depth);
|
||||
void glshim_glClipPlane(GLenum plane, const GLdouble *equation);
|
||||
void glshim_glDepthRange(GLdouble nearVal, GLdouble farVal);
|
||||
void glshim_glFogi(GLenum pname, GLint param);
|
||||
void glshim_glFogiv(GLenum pname, GLint *params);
|
||||
void glshim_glFrustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near, GLdouble far);
|
||||
void glshim_glGetDoublev(GLenum pname, GLdouble *params);
|
||||
void glshim_glLighti(GLenum light, GLenum pname, GLint param);
|
||||
void glshim_glLightiv(GLenum light, GLenum pname, GLint *iparams);
|
||||
void glshim_glLightModeli(GLenum pname, GLint param);
|
||||
void glshim_glLightModeliv(GLenum pname, GLint *iparams);
|
||||
void glshim_glMateriali(GLenum face, GLenum pname, GLint param);
|
||||
void glshim_glMaterialiv(GLenum face, GLenum pname, GLint *param);
|
||||
void glshim_glMultiTexCoord2f(GLenum target, GLfloat s, GLfloat t);
|
||||
void glshim_glOrtho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near, GLdouble far);
|
||||
void glshim_glGetMaterialiv(GLenum face, GLenum pname, GLint * params);
|
||||
void glshim_glGetLightiv(GLenum light, GLenum pname, GLint * params);
|
||||
void glshim_glGetClipPlane(GLenum plane, GLdouble *equation);
|
||||
void gl4es_glClearDepth(GLdouble depth);
|
||||
void gl4es_glClipPlane(GLenum plane, const GLdouble *equation);
|
||||
void gl4es_glDepthRange(GLdouble nearVal, GLdouble farVal);
|
||||
void gl4es_glFogi(GLenum pname, GLint param);
|
||||
void gl4es_glFogiv(GLenum pname, GLint *params);
|
||||
void gl4es_glFrustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near, GLdouble far);
|
||||
void gl4es_glGetDoublev(GLenum pname, GLdouble *params);
|
||||
void gl4es_glLighti(GLenum light, GLenum pname, GLint param);
|
||||
void gl4es_glLightiv(GLenum light, GLenum pname, GLint *iparams);
|
||||
void gl4es_glLightModeli(GLenum pname, GLint param);
|
||||
void gl4es_glLightModeliv(GLenum pname, GLint *iparams);
|
||||
void gl4es_glMateriali(GLenum face, GLenum pname, GLint param);
|
||||
void gl4es_glMaterialiv(GLenum face, GLenum pname, GLint *param);
|
||||
void gl4es_glMultiTexCoord2f(GLenum target, GLfloat s, GLfloat t);
|
||||
void gl4es_glOrtho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near, GLdouble far);
|
||||
void gl4es_glGetMaterialiv(GLenum face, GLenum pname, GLint * params);
|
||||
void gl4es_glGetLightiv(GLenum light, GLenum pname, GLint * params);
|
||||
void gl4es_glGetClipPlane(GLenum plane, GLdouble *equation);
|
||||
|
||||
void glshim_glDrawRangeElements(GLenum mode,GLuint start,GLuint end,GLsizei count,GLenum type,const void *indices);
|
||||
void gl4es_glDrawRangeElements(GLenum mode,GLuint start,GLuint end,GLsizei count,GLenum type,const void *indices);
|
||||
// color
|
||||
void glshim_glColor3f(GLfloat r, GLfloat g, GLfloat b);
|
||||
void glshim_glColor3fv(GLfloat *c);
|
||||
void glshim_glColor4fv(GLfloat *c);
|
||||
void glshim_glIndexfv(const GLfloat *c);
|
||||
void glshim_glSecondaryColor3fv(const GLfloat *v);
|
||||
void gl4es_glColor3f(GLfloat r, GLfloat g, GLfloat b);
|
||||
void gl4es_glColor3fv(GLfloat *c);
|
||||
void gl4es_glColor4fv(GLfloat *c);
|
||||
void gl4es_glIndexfv(const GLfloat *c);
|
||||
void gl4es_glSecondaryColor3fv(const GLfloat *v);
|
||||
|
||||
// raster
|
||||
void glshim_glRasterPos2f(GLfloat x, GLfloat y);
|
||||
void glshim_glRasterPos2fv(const GLfloat *v);
|
||||
void glshim_glRasterPos3f(GLfloat x, GLfloat y, GLfloat z);
|
||||
void glshim_glRasterPos3fv(const GLfloat *v);
|
||||
void glshim_glRasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
||||
void glshim_glRasterPos4fv(const GLfloat *v);
|
||||
void glshim_glWindowPos2f(GLfloat x, GLfloat y);
|
||||
void glshim_glWindowPos2fv(const GLfloat *v);
|
||||
void glshim_glWindowPos3f(GLfloat x, GLfloat y, GLfloat z);
|
||||
void glshim_glWindowPos3fv(const GLfloat *v);
|
||||
void gl4es_glRasterPos2f(GLfloat x, GLfloat y);
|
||||
void gl4es_glRasterPos2fv(const GLfloat *v);
|
||||
void gl4es_glRasterPos3f(GLfloat x, GLfloat y, GLfloat z);
|
||||
void gl4es_glRasterPos3fv(const GLfloat *v);
|
||||
void gl4es_glRasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
||||
void gl4es_glRasterPos4fv(const GLfloat *v);
|
||||
void gl4es_glWindowPos2f(GLfloat x, GLfloat y);
|
||||
void gl4es_glWindowPos2fv(const GLfloat *v);
|
||||
void gl4es_glWindowPos3f(GLfloat x, GLfloat y, GLfloat z);
|
||||
void gl4es_glWindowPos3fv(const GLfloat *v);
|
||||
|
||||
void glshim_glPixelStoref(GLenum pname, GLfloat param);
|
||||
void glshim_glGetTexGendv(GLenum coord,GLenum pname,GLdouble *params);
|
||||
void glshim_glGetTexGeniv(GLenum coord,GLenum pname,GLint *params);
|
||||
void glshim_glPixelTransferi(GLenum pname, GLint param);
|
||||
void glshim_glPixelTransferf(GLenum pname, GLfloat param);
|
||||
void gl4es_glPixelStoref(GLenum pname, GLfloat param);
|
||||
void gl4es_glGetTexGendv(GLenum coord,GLenum pname,GLdouble *params);
|
||||
void gl4es_glGetTexGeniv(GLenum coord,GLenum pname,GLint *params);
|
||||
void gl4es_glPixelTransferi(GLenum pname, GLint param);
|
||||
void gl4es_glPixelTransferf(GLenum pname, GLfloat param);
|
||||
|
||||
// eval
|
||||
void glshim_glEvalCoord1d(GLdouble u);
|
||||
void glshim_glEvalCoord1dv(GLdouble *v);
|
||||
void glshim_glEvalCoord1fv(GLfloat *v);
|
||||
void glshim_glEvalCoord2d(GLdouble u, GLdouble v);
|
||||
void glshim_glEvalCoord2dv(GLdouble *v);
|
||||
void glshim_glEvalCoord2fv(GLfloat *v);
|
||||
void glshim_glMapGrid1d(GLint un, GLdouble u1, GLdouble u2);
|
||||
void glshim_glMapGrid2d(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2);
|
||||
void gl4es_glEvalCoord1d(GLdouble u);
|
||||
void gl4es_glEvalCoord1dv(GLdouble *v);
|
||||
void gl4es_glEvalCoord1fv(GLfloat *v);
|
||||
void gl4es_glEvalCoord2d(GLdouble u, GLdouble v);
|
||||
void gl4es_glEvalCoord2dv(GLdouble *v);
|
||||
void gl4es_glEvalCoord2fv(GLfloat *v);
|
||||
void gl4es_glMapGrid1d(GLint un, GLdouble u1, GLdouble u2);
|
||||
void gl4es_glMapGrid2d(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2);
|
||||
|
||||
// matrix
|
||||
void glshim_glLoadMatrixd(const GLdouble *m);
|
||||
void glshim_glMultMatrixd(const GLdouble *m);
|
||||
void gl4es_glLoadMatrixd(const GLdouble *m);
|
||||
void gl4es_glMultMatrixd(const GLdouble *m);
|
||||
|
||||
// normal
|
||||
void glshim_glNormal3fv(GLfloat *v);
|
||||
void gl4es_glNormal3fv(GLfloat *v);
|
||||
|
||||
// rect
|
||||
#define GL_RECT(suffix, type) \
|
||||
void glshim_glRect##suffix(type x1, type y1, type x2, type y2); \
|
||||
void glshim_glRect##suffix##v(const type *v);
|
||||
void gl4es_glRect##suffix(type x1, type y1, type x2, type y2); \
|
||||
void gl4es_glRect##suffix##v(const type *v);
|
||||
|
||||
GL_RECT(d, GLdouble)
|
||||
GL_RECT(f, GLfloat)
|
||||
@@ -88,45 +88,45 @@ GL_RECT(s, GLshort)
|
||||
|
||||
// textures
|
||||
|
||||
void glshim_glTexCoord1f(GLfloat s);
|
||||
void glshim_glTexCoord1fv(GLfloat *t);
|
||||
void glshim_glTexCoord2f(GLfloat s, GLfloat t);
|
||||
void glshim_glTexCoord2fv(GLfloat *t);
|
||||
void glshim_glTexCoord3f(GLfloat s, GLfloat t, GLfloat r);
|
||||
void glshim_glTexCoord3fv(GLfloat *t);
|
||||
void glshim_glTexCoord4fv(GLfloat *t);
|
||||
void gl4es_glTexCoord1f(GLfloat s);
|
||||
void gl4es_glTexCoord1fv(GLfloat *t);
|
||||
void gl4es_glTexCoord2f(GLfloat s, GLfloat t);
|
||||
void gl4es_glTexCoord2fv(GLfloat *t);
|
||||
void gl4es_glTexCoord3f(GLfloat s, GLfloat t, GLfloat r);
|
||||
void gl4es_glTexCoord3fv(GLfloat *t);
|
||||
void gl4es_glTexCoord4fv(GLfloat *t);
|
||||
|
||||
void glshim_glMultiTexCoord1f(GLenum target, GLfloat s);
|
||||
void glshim_glMultiTexCoord1fv(GLenum target, GLfloat *t);
|
||||
void glshim_glMultiTexCoord2f(GLenum target, GLfloat s, GLfloat t);
|
||||
void glshim_glMultiTexCoord2fv(GLenum target, GLfloat *t);
|
||||
void glshim_glMultiTexCoord3f(GLenum target, GLfloat s, GLfloat t, GLfloat r);
|
||||
void glshim_glMultiTexCoord3fv(GLenum target, GLfloat *t);
|
||||
void glshim_glMultiTexCoord4fv(GLenum target, GLfloat *t);
|
||||
void gl4es_glMultiTexCoord1f(GLenum target, GLfloat s);
|
||||
void gl4es_glMultiTexCoord1fv(GLenum target, GLfloat *t);
|
||||
void gl4es_glMultiTexCoord2f(GLenum target, GLfloat s, GLfloat t);
|
||||
void gl4es_glMultiTexCoord2fv(GLenum target, GLfloat *t);
|
||||
void gl4es_glMultiTexCoord3f(GLenum target, GLfloat s, GLfloat t, GLfloat r);
|
||||
void gl4es_glMultiTexCoord3fv(GLenum target, GLfloat *t);
|
||||
void gl4es_glMultiTexCoord4fv(GLenum target, GLfloat *t);
|
||||
|
||||
void glshim_glGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat *params);
|
||||
void gl4es_glGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat *params);
|
||||
|
||||
void glshim_glPolygonMode(GLenum face, GLenum mode);
|
||||
void gl4es_glPolygonMode(GLenum face, GLenum mode);
|
||||
|
||||
// texgen
|
||||
void glshim_glTexGend(GLenum coord, GLenum pname, GLdouble param);
|
||||
void glshim_glTexGeni(GLenum coord, GLenum pname, GLint param);
|
||||
void glshim_glTexGenf(GLenum coord, GLenum pname, GLfloat param);
|
||||
void glshim_glTexGendv(GLenum coord, GLenum pname, const GLdouble *params);
|
||||
void glshim_glTexGenfv(GLenum coord, GLenum pname, const GLfloat *params);
|
||||
void glshim_glTexGeniv(GLenum coord, GLenum pname, const GLint *params);
|
||||
void gl4es_glTexGend(GLenum coord, GLenum pname, GLdouble param);
|
||||
void gl4es_glTexGeni(GLenum coord, GLenum pname, GLint param);
|
||||
void gl4es_glTexGenf(GLenum coord, GLenum pname, GLfloat param);
|
||||
void gl4es_glTexGendv(GLenum coord, GLenum pname, const GLdouble *params);
|
||||
void gl4es_glTexGenfv(GLenum coord, GLenum pname, const GLfloat *params);
|
||||
void gl4es_glTexGeniv(GLenum coord, GLenum pname, const GLint *params);
|
||||
|
||||
// transforms
|
||||
void glshim_glRotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
|
||||
void glshim_glScaled(GLdouble x, GLdouble y, GLdouble z);
|
||||
void glshim_glTranslated(GLdouble x, GLdouble y, GLdouble z);
|
||||
void gl4es_glRotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
|
||||
void gl4es_glScaled(GLdouble x, GLdouble y, GLdouble z);
|
||||
void gl4es_glTranslated(GLdouble x, GLdouble y, GLdouble z);
|
||||
|
||||
// vertex
|
||||
void glshim_glVertex2f(GLfloat x, GLfloat y);
|
||||
void glshim_glVertex2fv(GLfloat *v);
|
||||
void glshim_glVertex3fv(GLfloat *v);
|
||||
void glshim_glVertex3f(GLfloat r, GLfloat g, GLfloat b);
|
||||
void glshim_glVertex4fv(GLfloat *v);
|
||||
void gl4es_glVertex2f(GLfloat x, GLfloat y);
|
||||
void gl4es_glVertex2fv(GLfloat *v);
|
||||
void gl4es_glVertex3fv(GLfloat *v);
|
||||
void gl4es_glVertex3f(GLfloat r, GLfloat g, GLfloat b);
|
||||
void gl4es_glVertex4fv(GLfloat *v);
|
||||
|
||||
// OES wrappers
|
||||
|
||||
@@ -140,56 +140,56 @@ void glOrthofOES(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLflo
|
||||
// basic thunking
|
||||
|
||||
#define THUNK(suffix, type) \
|
||||
void glshim_glColor3##suffix##v(const type *v); \
|
||||
void glshim_glColor3##suffix(type r, type g, type b); \
|
||||
void glshim_glColor4##suffix##v(const type *v); \
|
||||
void glshim_glColor4##suffix(type r, type g, type b, type a); \
|
||||
void glshim_glSecondaryColor3##suffix##v(const type *v); \
|
||||
void glshim_glSecondaryColor3##suffix(type r, type g, type b); \
|
||||
void glshim_glIndex##suffix##v(const type *c); \
|
||||
void glshim_glIndex##suffix(type c); \
|
||||
void glshim_glNormal3##suffix##v(const type *v); \
|
||||
void glshim_glNormal3##suffix(type x, type y, type z); \
|
||||
void glshim_glRasterPos2##suffix##v(type *v); \
|
||||
void glshim_glRasterPos2##suffix(type x, type y); \
|
||||
void glshim_glRasterPos3##suffix##v(type *v); \
|
||||
void glshim_glRasterPos3##suffix(type x, type y, type z); \
|
||||
void glshim_glRasterPos4##suffix##v(type *v); \
|
||||
void glshim_glRasterPos4##suffix(type x, type y, type z, type w); \
|
||||
void glshim_glWindowPos2##suffix##v(type *v); \
|
||||
void glshim_glWindowPos2##suffix(type x, type y); \
|
||||
void glshim_glWindowPos3##suffix##v(type *v); \
|
||||
void glshim_glWindowPos3##suffix(type x, type y, type z); \
|
||||
void glshim_glVertex2##suffix##v(type *v); \
|
||||
void glshim_glVertex2##suffix(type x, type y); \
|
||||
void glshim_glVertex3##suffix##v(type *v); \
|
||||
void glshim_glVertex3##suffix(type x, type y, type z); \
|
||||
void glshim_glVertex4##suffix(type x, type y, type z, type w); \
|
||||
void glshim_glVertex4##suffix##v(type *v); \
|
||||
void glshim_glTexCoord1##suffix(type s); \
|
||||
void glshim_glTexCoord1##suffix##v(type *t); \
|
||||
void glshim_glTexCoord2##suffix(type s, type t); \
|
||||
void glshim_glTexCoord2##suffix##v(type *t); \
|
||||
void glshim_glTexCoord3##suffix(type s, type t, type r); \
|
||||
void glshim_glTexCoord3##suffix##v(type *t); \
|
||||
void glshim_glTexCoord4##suffix(type s, type t, type r, type q); \
|
||||
void glshim_glTexCoord4##suffix##v(type *t); \
|
||||
void glshim_glMultiTexCoord1##suffix(GLenum target, type s); \
|
||||
void glshim_glMultiTexCoord1##suffix##v(GLenum target, type *t); \
|
||||
void glshim_glMultiTexCoord2##suffix(GLenum target, type s, type t); \
|
||||
void glshim_glMultiTexCoord2##suffix##v(GLenum target, type *t); \
|
||||
void glshim_glMultiTexCoord3##suffix(GLenum target, type s, type t, type r); \
|
||||
void glshim_glMultiTexCoord3##suffix##v(GLenum target, type *t); \
|
||||
void glshim_glMultiTexCoord4##suffix(GLenum target, type s, type t, type r, type q); \
|
||||
void glshim_glMultiTexCoord4##suffix##v(GLenum target, type *t); \
|
||||
void glshim_glMultiTexCoord1##suffix##ARB(GLenum target, type s); \
|
||||
void glshim_glMultiTexCoord1##suffix##vARB(GLenum target, type *t); \
|
||||
void glshim_glMultiTexCoord2##suffix##ARB(GLenum target, type s, type t); \
|
||||
void glshim_glMultiTexCoord2##suffix##vARB(GLenum target, type *t); \
|
||||
void glshim_glMultiTexCoord3##suffix##ARB(GLenum target, type s, type t, type r); \
|
||||
void glshim_glMultiTexCoord3##suffix##vARB(GLenum target, type *t); \
|
||||
void glshim_glMultiTexCoord4##suffix##ARB(GLenum target, type s, type t, type r, type q); \
|
||||
void glshim_glMultiTexCoord4##suffix##vARB(GLenum target, type *t);
|
||||
void gl4es_glColor3##suffix##v(const type *v); \
|
||||
void gl4es_glColor3##suffix(type r, type g, type b); \
|
||||
void gl4es_glColor4##suffix##v(const type *v); \
|
||||
void gl4es_glColor4##suffix(type r, type g, type b, type a); \
|
||||
void gl4es_glSecondaryColor3##suffix##v(const type *v); \
|
||||
void gl4es_glSecondaryColor3##suffix(type r, type g, type b); \
|
||||
void gl4es_glIndex##suffix##v(const type *c); \
|
||||
void gl4es_glIndex##suffix(type c); \
|
||||
void gl4es_glNormal3##suffix##v(const type *v); \
|
||||
void gl4es_glNormal3##suffix(type x, type y, type z); \
|
||||
void gl4es_glRasterPos2##suffix##v(type *v); \
|
||||
void gl4es_glRasterPos2##suffix(type x, type y); \
|
||||
void gl4es_glRasterPos3##suffix##v(type *v); \
|
||||
void gl4es_glRasterPos3##suffix(type x, type y, type z); \
|
||||
void gl4es_glRasterPos4##suffix##v(type *v); \
|
||||
void gl4es_glRasterPos4##suffix(type x, type y, type z, type w); \
|
||||
void gl4es_glWindowPos2##suffix##v(type *v); \
|
||||
void gl4es_glWindowPos2##suffix(type x, type y); \
|
||||
void gl4es_glWindowPos3##suffix##v(type *v); \
|
||||
void gl4es_glWindowPos3##suffix(type x, type y, type z); \
|
||||
void gl4es_glVertex2##suffix##v(type *v); \
|
||||
void gl4es_glVertex2##suffix(type x, type y); \
|
||||
void gl4es_glVertex3##suffix##v(type *v); \
|
||||
void gl4es_glVertex3##suffix(type x, type y, type z); \
|
||||
void gl4es_glVertex4##suffix(type x, type y, type z, type w); \
|
||||
void gl4es_glVertex4##suffix##v(type *v); \
|
||||
void gl4es_glTexCoord1##suffix(type s); \
|
||||
void gl4es_glTexCoord1##suffix##v(type *t); \
|
||||
void gl4es_glTexCoord2##suffix(type s, type t); \
|
||||
void gl4es_glTexCoord2##suffix##v(type *t); \
|
||||
void gl4es_glTexCoord3##suffix(type s, type t, type r); \
|
||||
void gl4es_glTexCoord3##suffix##v(type *t); \
|
||||
void gl4es_glTexCoord4##suffix(type s, type t, type r, type q); \
|
||||
void gl4es_glTexCoord4##suffix##v(type *t); \
|
||||
void gl4es_glMultiTexCoord1##suffix(GLenum target, type s); \
|
||||
void gl4es_glMultiTexCoord1##suffix##v(GLenum target, type *t); \
|
||||
void gl4es_glMultiTexCoord2##suffix(GLenum target, type s, type t); \
|
||||
void gl4es_glMultiTexCoord2##suffix##v(GLenum target, type *t); \
|
||||
void gl4es_glMultiTexCoord3##suffix(GLenum target, type s, type t, type r); \
|
||||
void gl4es_glMultiTexCoord3##suffix##v(GLenum target, type *t); \
|
||||
void gl4es_glMultiTexCoord4##suffix(GLenum target, type s, type t, type r, type q); \
|
||||
void gl4es_glMultiTexCoord4##suffix##v(GLenum target, type *t); \
|
||||
void gl4es_glMultiTexCoord1##suffix##ARB(GLenum target, type s); \
|
||||
void gl4es_glMultiTexCoord1##suffix##vARB(GLenum target, type *t); \
|
||||
void gl4es_glMultiTexCoord2##suffix##ARB(GLenum target, type s, type t); \
|
||||
void gl4es_glMultiTexCoord2##suffix##vARB(GLenum target, type *t); \
|
||||
void gl4es_glMultiTexCoord3##suffix##ARB(GLenum target, type s, type t, type r); \
|
||||
void gl4es_glMultiTexCoord3##suffix##vARB(GLenum target, type *t); \
|
||||
void gl4es_glMultiTexCoord4##suffix##ARB(GLenum target, type s, type t, type r, type q); \
|
||||
void gl4es_glMultiTexCoord4##suffix##vARB(GLenum target, type *t);
|
||||
|
||||
THUNK(b, GLbyte)
|
||||
THUNK(d, GLdouble)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,253 +1,253 @@
|
||||
#ifndef USE_ES2
|
||||
#include "gles.h"
|
||||
#ifndef skip_glBindFramebuffer
|
||||
void glshim_glBindFramebuffer(GLenum target, GLuint framebuffer) {
|
||||
void gl4es_glBindFramebuffer(GLenum target, GLuint framebuffer) {
|
||||
LOAD_GLES_OES(glBindFramebuffer);
|
||||
#ifndef direct_glBindFramebuffer
|
||||
PUSH_IF_COMPILING(glBindFramebuffer)
|
||||
#endif
|
||||
gles_glBindFramebuffer(target, framebuffer);
|
||||
}
|
||||
void glBindFramebuffer(GLenum target, GLuint framebuffer) __attribute__((alias("glshim_glBindFramebuffer"))) __attribute__((visibility("default")));
|
||||
void glBindFramebuffer(GLenum target, GLuint framebuffer) __attribute__((alias("gl4es_glBindFramebuffer"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glBindRenderbuffer
|
||||
void glshim_glBindRenderbuffer(GLenum target, GLuint renderbuffer) {
|
||||
void gl4es_glBindRenderbuffer(GLenum target, GLuint renderbuffer) {
|
||||
LOAD_GLES_OES(glBindRenderbuffer);
|
||||
#ifndef direct_glBindRenderbuffer
|
||||
PUSH_IF_COMPILING(glBindRenderbuffer)
|
||||
#endif
|
||||
gles_glBindRenderbuffer(target, renderbuffer);
|
||||
}
|
||||
void glBindRenderbuffer(GLenum target, GLuint renderbuffer) __attribute__((alias("glshim_glBindRenderbuffer"))) __attribute__((visibility("default")));
|
||||
void glBindRenderbuffer(GLenum target, GLuint renderbuffer) __attribute__((alias("gl4es_glBindRenderbuffer"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glBlendColor
|
||||
void glshim_glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) {
|
||||
void gl4es_glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) {
|
||||
LOAD_GLES_OES(glBlendColor);
|
||||
#ifndef direct_glBlendColor
|
||||
PUSH_IF_COMPILING(glBlendColor)
|
||||
#endif
|
||||
gles_glBlendColor(red, green, blue, alpha);
|
||||
}
|
||||
void glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) __attribute__((alias("glshim_glBlendColor"))) __attribute__((visibility("default")));
|
||||
void glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) __attribute__((alias("gl4es_glBlendColor"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glBlendEquation
|
||||
void glshim_glBlendEquation(GLenum mode) {
|
||||
void gl4es_glBlendEquation(GLenum mode) {
|
||||
LOAD_GLES_OES(glBlendEquation);
|
||||
#ifndef direct_glBlendEquation
|
||||
PUSH_IF_COMPILING(glBlendEquation)
|
||||
#endif
|
||||
gles_glBlendEquation(mode);
|
||||
}
|
||||
void glBlendEquation(GLenum mode) __attribute__((alias("glshim_glBlendEquation"))) __attribute__((visibility("default")));
|
||||
void glBlendEquation(GLenum mode) __attribute__((alias("gl4es_glBlendEquation"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glBlendEquationSeparate
|
||||
void glshim_glBlendEquationSeparate(GLenum modeRGB, GLenum modeA) {
|
||||
void gl4es_glBlendEquationSeparate(GLenum modeRGB, GLenum modeA) {
|
||||
LOAD_GLES_OES(glBlendEquationSeparate);
|
||||
#ifndef direct_glBlendEquationSeparate
|
||||
PUSH_IF_COMPILING(glBlendEquationSeparate)
|
||||
#endif
|
||||
gles_glBlendEquationSeparate(modeRGB, modeA);
|
||||
}
|
||||
void glBlendEquationSeparate(GLenum modeRGB, GLenum modeA) __attribute__((alias("glshim_glBlendEquationSeparate"))) __attribute__((visibility("default")));
|
||||
void glBlendEquationSeparate(GLenum modeRGB, GLenum modeA) __attribute__((alias("gl4es_glBlendEquationSeparate"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glBlendFuncSeparate
|
||||
void glshim_glBlendFuncSeparate(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) {
|
||||
void gl4es_glBlendFuncSeparate(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) {
|
||||
LOAD_GLES_OES(glBlendFuncSeparate);
|
||||
#ifndef direct_glBlendFuncSeparate
|
||||
PUSH_IF_COMPILING(glBlendFuncSeparate)
|
||||
#endif
|
||||
gles_glBlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha);
|
||||
}
|
||||
void glBlendFuncSeparate(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) __attribute__((alias("glshim_glBlendFuncSeparate"))) __attribute__((visibility("default")));
|
||||
void glBlendFuncSeparate(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) __attribute__((alias("gl4es_glBlendFuncSeparate"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glCheckFramebufferStatus
|
||||
GLenum glshim_glCheckFramebufferStatus(GLenum target) {
|
||||
GLenum gl4es_glCheckFramebufferStatus(GLenum target) {
|
||||
LOAD_GLES_OES(glCheckFramebufferStatus);
|
||||
#ifndef direct_glCheckFramebufferStatus
|
||||
PUSH_IF_COMPILING(glCheckFramebufferStatus)
|
||||
#endif
|
||||
return gles_glCheckFramebufferStatus(target);
|
||||
}
|
||||
GLenum glCheckFramebufferStatus(GLenum target) __attribute__((alias("glshim_glCheckFramebufferStatus"))) __attribute__((visibility("default")));
|
||||
GLenum glCheckFramebufferStatus(GLenum target) __attribute__((alias("gl4es_glCheckFramebufferStatus"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glDeleteFramebuffers
|
||||
void glshim_glDeleteFramebuffers(GLsizei n, GLuint * framebuffers) {
|
||||
void gl4es_glDeleteFramebuffers(GLsizei n, GLuint * framebuffers) {
|
||||
LOAD_GLES_OES(glDeleteFramebuffers);
|
||||
#ifndef direct_glDeleteFramebuffers
|
||||
PUSH_IF_COMPILING(glDeleteFramebuffers)
|
||||
#endif
|
||||
gles_glDeleteFramebuffers(n, framebuffers);
|
||||
}
|
||||
void glDeleteFramebuffers(GLsizei n, GLuint * framebuffers) __attribute__((alias("glshim_glDeleteFramebuffers"))) __attribute__((visibility("default")));
|
||||
void glDeleteFramebuffers(GLsizei n, GLuint * framebuffers) __attribute__((alias("gl4es_glDeleteFramebuffers"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glDeleteRenderbuffers
|
||||
void glshim_glDeleteRenderbuffers(GLsizei n, GLuint * renderbuffers) {
|
||||
void gl4es_glDeleteRenderbuffers(GLsizei n, GLuint * renderbuffers) {
|
||||
LOAD_GLES_OES(glDeleteRenderbuffers);
|
||||
#ifndef direct_glDeleteRenderbuffers
|
||||
PUSH_IF_COMPILING(glDeleteRenderbuffers)
|
||||
#endif
|
||||
gles_glDeleteRenderbuffers(n, renderbuffers);
|
||||
}
|
||||
void glDeleteRenderbuffers(GLsizei n, GLuint * renderbuffers) __attribute__((alias("glshim_glDeleteRenderbuffers"))) __attribute__((visibility("default")));
|
||||
void glDeleteRenderbuffers(GLsizei n, GLuint * renderbuffers) __attribute__((alias("gl4es_glDeleteRenderbuffers"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glDrawTexf
|
||||
void glshim_glDrawTexf(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height) {
|
||||
void gl4es_glDrawTexf(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height) {
|
||||
LOAD_GLES_OES(glDrawTexf);
|
||||
#ifndef direct_glDrawTexf
|
||||
PUSH_IF_COMPILING(glDrawTexf)
|
||||
#endif
|
||||
gles_glDrawTexf(x, y, z, width, height);
|
||||
}
|
||||
void glDrawTexf(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height) __attribute__((alias("glshim_glDrawTexf"))) __attribute__((visibility("default")));
|
||||
void glDrawTexf(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height) __attribute__((alias("gl4es_glDrawTexf"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glDrawTexi
|
||||
void glshim_glDrawTexi(GLint x, GLint y, GLint z, GLint width, GLint height) {
|
||||
void gl4es_glDrawTexi(GLint x, GLint y, GLint z, GLint width, GLint height) {
|
||||
LOAD_GLES_OES(glDrawTexi);
|
||||
#ifndef direct_glDrawTexi
|
||||
PUSH_IF_COMPILING(glDrawTexi)
|
||||
#endif
|
||||
gles_glDrawTexi(x, y, z, width, height);
|
||||
}
|
||||
void glDrawTexi(GLint x, GLint y, GLint z, GLint width, GLint height) __attribute__((alias("glshim_glDrawTexi"))) __attribute__((visibility("default")));
|
||||
void glDrawTexi(GLint x, GLint y, GLint z, GLint width, GLint height) __attribute__((alias("gl4es_glDrawTexi"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glFramebufferRenderbuffer
|
||||
void glshim_glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) {
|
||||
void gl4es_glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) {
|
||||
LOAD_GLES_OES(glFramebufferRenderbuffer);
|
||||
#ifndef direct_glFramebufferRenderbuffer
|
||||
PUSH_IF_COMPILING(glFramebufferRenderbuffer)
|
||||
#endif
|
||||
gles_glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
|
||||
}
|
||||
void glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) __attribute__((alias("glshim_glFramebufferRenderbuffer"))) __attribute__((visibility("default")));
|
||||
void glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) __attribute__((alias("gl4es_glFramebufferRenderbuffer"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glFramebufferTexture2D
|
||||
void glshim_glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {
|
||||
void gl4es_glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {
|
||||
LOAD_GLES_OES(glFramebufferTexture2D);
|
||||
#ifndef direct_glFramebufferTexture2D
|
||||
PUSH_IF_COMPILING(glFramebufferTexture2D)
|
||||
#endif
|
||||
gles_glFramebufferTexture2D(target, attachment, textarget, texture, level);
|
||||
}
|
||||
void glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) __attribute__((alias("glshim_glFramebufferTexture2D"))) __attribute__((visibility("default")));
|
||||
void glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) __attribute__((alias("gl4es_glFramebufferTexture2D"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glGenFramebuffers
|
||||
void glshim_glGenFramebuffers(GLsizei n, GLuint * ids) {
|
||||
void gl4es_glGenFramebuffers(GLsizei n, GLuint * ids) {
|
||||
LOAD_GLES_OES(glGenFramebuffers);
|
||||
#ifndef direct_glGenFramebuffers
|
||||
PUSH_IF_COMPILING(glGenFramebuffers)
|
||||
#endif
|
||||
gles_glGenFramebuffers(n, ids);
|
||||
}
|
||||
void glGenFramebuffers(GLsizei n, GLuint * ids) __attribute__((alias("glshim_glGenFramebuffers"))) __attribute__((visibility("default")));
|
||||
void glGenFramebuffers(GLsizei n, GLuint * ids) __attribute__((alias("gl4es_glGenFramebuffers"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glGenRenderbuffers
|
||||
void glshim_glGenRenderbuffers(GLsizei n, GLuint * renderbuffers) {
|
||||
void gl4es_glGenRenderbuffers(GLsizei n, GLuint * renderbuffers) {
|
||||
LOAD_GLES_OES(glGenRenderbuffers);
|
||||
#ifndef direct_glGenRenderbuffers
|
||||
PUSH_IF_COMPILING(glGenRenderbuffers)
|
||||
#endif
|
||||
gles_glGenRenderbuffers(n, renderbuffers);
|
||||
}
|
||||
void glGenRenderbuffers(GLsizei n, GLuint * renderbuffers) __attribute__((alias("glshim_glGenRenderbuffers"))) __attribute__((visibility("default")));
|
||||
void glGenRenderbuffers(GLsizei n, GLuint * renderbuffers) __attribute__((alias("gl4es_glGenRenderbuffers"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glGenerateMipmap
|
||||
void glshim_glGenerateMipmap(GLenum target) {
|
||||
void gl4es_glGenerateMipmap(GLenum target) {
|
||||
LOAD_GLES_OES(glGenerateMipmap);
|
||||
#ifndef direct_glGenerateMipmap
|
||||
PUSH_IF_COMPILING(glGenerateMipmap)
|
||||
#endif
|
||||
gles_glGenerateMipmap(target);
|
||||
}
|
||||
void glGenerateMipmap(GLenum target) __attribute__((alias("glshim_glGenerateMipmap"))) __attribute__((visibility("default")));
|
||||
void glGenerateMipmap(GLenum target) __attribute__((alias("gl4es_glGenerateMipmap"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glGetFramebufferAttachmentParameteriv
|
||||
void glshim_glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint * params) {
|
||||
void gl4es_glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint * params) {
|
||||
LOAD_GLES_OES(glGetFramebufferAttachmentParameteriv);
|
||||
#ifndef direct_glGetFramebufferAttachmentParameteriv
|
||||
PUSH_IF_COMPILING(glGetFramebufferAttachmentParameteriv)
|
||||
#endif
|
||||
gles_glGetFramebufferAttachmentParameteriv(target, attachment, pname, params);
|
||||
}
|
||||
void glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint * params) __attribute__((alias("glshim_glGetFramebufferAttachmentParameteriv"))) __attribute__((visibility("default")));
|
||||
void glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint * params) __attribute__((alias("gl4es_glGetFramebufferAttachmentParameteriv"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glGetRenderbufferParameteriv
|
||||
void glshim_glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint * params) {
|
||||
void gl4es_glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint * params) {
|
||||
LOAD_GLES_OES(glGetRenderbufferParameteriv);
|
||||
#ifndef direct_glGetRenderbufferParameteriv
|
||||
PUSH_IF_COMPILING(glGetRenderbufferParameteriv)
|
||||
#endif
|
||||
gles_glGetRenderbufferParameteriv(target, pname, params);
|
||||
}
|
||||
void glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint * params) __attribute__((alias("glshim_glGetRenderbufferParameteriv"))) __attribute__((visibility("default")));
|
||||
void glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint * params) __attribute__((alias("gl4es_glGetRenderbufferParameteriv"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glIsFramebuffer
|
||||
GLboolean glshim_glIsFramebuffer(GLuint framebuffer) {
|
||||
GLboolean gl4es_glIsFramebuffer(GLuint framebuffer) {
|
||||
LOAD_GLES_OES(glIsFramebuffer);
|
||||
#ifndef direct_glIsFramebuffer
|
||||
PUSH_IF_COMPILING(glIsFramebuffer)
|
||||
#endif
|
||||
return gles_glIsFramebuffer(framebuffer);
|
||||
}
|
||||
GLboolean glIsFramebuffer(GLuint framebuffer) __attribute__((alias("glshim_glIsFramebuffer"))) __attribute__((visibility("default")));
|
||||
GLboolean glIsFramebuffer(GLuint framebuffer) __attribute__((alias("gl4es_glIsFramebuffer"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glIsRenderbuffer
|
||||
GLboolean glshim_glIsRenderbuffer(GLuint renderbuffer) {
|
||||
GLboolean gl4es_glIsRenderbuffer(GLuint renderbuffer) {
|
||||
LOAD_GLES_OES(glIsRenderbuffer);
|
||||
#ifndef direct_glIsRenderbuffer
|
||||
PUSH_IF_COMPILING(glIsRenderbuffer)
|
||||
#endif
|
||||
return gles_glIsRenderbuffer(renderbuffer);
|
||||
}
|
||||
GLboolean glIsRenderbuffer(GLuint renderbuffer) __attribute__((alias("glshim_glIsRenderbuffer"))) __attribute__((visibility("default")));
|
||||
GLboolean glIsRenderbuffer(GLuint renderbuffer) __attribute__((alias("gl4es_glIsRenderbuffer"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glMultiDrawArrays
|
||||
void glshim_glMultiDrawArrays(GLenum mode, const GLint * first, const GLsizei * count, GLsizei primcount) {
|
||||
void gl4es_glMultiDrawArrays(GLenum mode, const GLint * first, const GLsizei * count, GLsizei primcount) {
|
||||
LOAD_GLES_OES(glMultiDrawArrays);
|
||||
#ifndef direct_glMultiDrawArrays
|
||||
PUSH_IF_COMPILING(glMultiDrawArrays)
|
||||
#endif
|
||||
gles_glMultiDrawArrays(mode, first, count, primcount);
|
||||
}
|
||||
void glMultiDrawArrays(GLenum mode, const GLint * first, const GLsizei * count, GLsizei primcount) __attribute__((alias("glshim_glMultiDrawArrays"))) __attribute__((visibility("default")));
|
||||
void glMultiDrawArrays(GLenum mode, const GLint * first, const GLsizei * count, GLsizei primcount) __attribute__((alias("gl4es_glMultiDrawArrays"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glMultiDrawElements
|
||||
void glshim_glMultiDrawElements(GLenum mode, GLsizei * count, GLenum type, const void * const * indices, GLsizei primcount) {
|
||||
void gl4es_glMultiDrawElements(GLenum mode, GLsizei * count, GLenum type, const void * const * indices, GLsizei primcount) {
|
||||
LOAD_GLES_OES(glMultiDrawElements);
|
||||
#ifndef direct_glMultiDrawElements
|
||||
PUSH_IF_COMPILING(glMultiDrawElements)
|
||||
#endif
|
||||
gles_glMultiDrawElements(mode, count, type, indices, primcount);
|
||||
}
|
||||
void glMultiDrawElements(GLenum mode, GLsizei * count, GLenum type, const void * const * indices, GLsizei primcount) __attribute__((alias("glshim_glMultiDrawElements"))) __attribute__((visibility("default")));
|
||||
void glMultiDrawElements(GLenum mode, GLsizei * count, GLenum type, const void * const * indices, GLsizei primcount) __attribute__((alias("gl4es_glMultiDrawElements"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glRenderbufferStorage
|
||||
void glshim_glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) {
|
||||
void gl4es_glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) {
|
||||
LOAD_GLES_OES(glRenderbufferStorage);
|
||||
#ifndef direct_glRenderbufferStorage
|
||||
PUSH_IF_COMPILING(glRenderbufferStorage)
|
||||
#endif
|
||||
gles_glRenderbufferStorage(target, internalformat, width, height);
|
||||
}
|
||||
void glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) __attribute__((alias("glshim_glRenderbufferStorage"))) __attribute__((visibility("default")));
|
||||
void glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) __attribute__((alias("gl4es_glRenderbufferStorage"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glTexGenfv
|
||||
void glshim_glTexGenfv(GLenum coord, GLenum pname, const GLfloat * params) {
|
||||
void gl4es_glTexGenfv(GLenum coord, GLenum pname, const GLfloat * params) {
|
||||
LOAD_GLES_OES(glTexGenfv);
|
||||
#ifndef direct_glTexGenfv
|
||||
PUSH_IF_COMPILING(glTexGenfv)
|
||||
#endif
|
||||
gles_glTexGenfv(coord, pname, params);
|
||||
}
|
||||
void glTexGenfv(GLenum coord, GLenum pname, const GLfloat * params) __attribute__((alias("glshim_glTexGenfv"))) __attribute__((visibility("default")));
|
||||
void glTexGenfv(GLenum coord, GLenum pname, const GLfloat * params) __attribute__((alias("gl4es_glTexGenfv"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glTexGeni
|
||||
void glshim_glTexGeni(GLenum coord, GLenum pname, GLint param) {
|
||||
void gl4es_glTexGeni(GLenum coord, GLenum pname, GLint param) {
|
||||
LOAD_GLES_OES(glTexGeni);
|
||||
#ifndef direct_glTexGeni
|
||||
PUSH_IF_COMPILING(glTexGeni)
|
||||
#endif
|
||||
gles_glTexGeni(coord, pname, param);
|
||||
}
|
||||
void glTexGeni(GLenum coord, GLenum pname, GLint param) __attribute__((alias("glshim_glTexGeni"))) __attribute__((visibility("default")));
|
||||
void glTexGeni(GLenum coord, GLenum pname, GLint param) __attribute__((alias("gl4es_glTexGeni"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#include "stub.h"
|
||||
|
||||
#define STUB(ret, def, args)\
|
||||
ret glshim_ ## def args {\
|
||||
ret gl4es_ ## def args {\
|
||||
char *debug = getenv("LIBGL_DEBUG");\
|
||||
if (debug && strcmp(debug, "1") == 0)\
|
||||
printf("stub: %s;\n", #def);\
|
||||
} \
|
||||
ret def args __attribute((alias("glshim_"#def))) __attribute__((visibility("default")));
|
||||
ret def args __attribute((alias("gl4es_"#def))) __attribute__((visibility("default")));
|
||||
|
||||
STUB(void,glFogCoordd,(GLdouble coord));
|
||||
STUB(void,glFogCoordf,(GLfloat coord));
|
||||
|
||||
@@ -1,40 +1,40 @@
|
||||
#include "../gl.h"
|
||||
|
||||
//GLint glshim_glRenderMode(GLenum mode);
|
||||
//void glshim_glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha);
|
||||
void glshim_glBlendEquationSeparatei(GLuint buf, GLenum modeRGB, GLenum modeAlpha);
|
||||
//void glshim_glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
|
||||
void glshim_glBlendFuncSeparatei(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
|
||||
void glshim_glColorMaterial(GLenum face, GLenum mode);
|
||||
void glshim_glCopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type);
|
||||
void glshim_glDrawBuffer(GLenum mode);
|
||||
void glshim_glEdgeFlag(GLboolean flag);
|
||||
void glshim_glFogCoordd(GLdouble coord);
|
||||
void glshim_glFogCoorddv(const GLdouble *coord);
|
||||
void glshim_glFogCoordf(GLfloat coord);
|
||||
void glshim_glFogCoordfv(const GLfloat *coord);
|
||||
//void glshim_glGetTexImage(GLenum target, GLint level, GLenum format, GLenum type, GLvoid * img);
|
||||
//void glshim_glGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat *params);
|
||||
//void glshim_glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint *params);
|
||||
void glshim_glIndexf(GLfloat c);
|
||||
void glshim_glLightModeli(GLenum pname, GLint param);
|
||||
void glshim_glPolygonStipple(const GLubyte *mask);
|
||||
void glshim_glReadBuffer(GLenum mode);
|
||||
void glshim_glSecondaryColor3f(GLfloat r, GLfloat g, GLfloat b);
|
||||
void glshim_glColorTable (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
|
||||
//void glshim_glIndexPointer(GLenum type, GLsizei stride, const GLvoid * pointer);
|
||||
//GLint gl4es_glRenderMode(GLenum mode);
|
||||
//void gl4es_glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha);
|
||||
void gl4es_glBlendEquationSeparatei(GLuint buf, GLenum modeRGB, GLenum modeAlpha);
|
||||
//void gl4es_glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
|
||||
void gl4es_glBlendFuncSeparatei(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
|
||||
void gl4es_glColorMaterial(GLenum face, GLenum mode);
|
||||
void gl4es_glCopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type);
|
||||
void gl4es_glDrawBuffer(GLenum mode);
|
||||
void gl4es_glEdgeFlag(GLboolean flag);
|
||||
void gl4es_glFogCoordd(GLdouble coord);
|
||||
void gl4es_glFogCoorddv(const GLdouble *coord);
|
||||
void gl4es_glFogCoordf(GLfloat coord);
|
||||
void gl4es_glFogCoordfv(const GLfloat *coord);
|
||||
//void gl4es_glGetTexImage(GLenum target, GLint level, GLenum format, GLenum type, GLvoid * img);
|
||||
//void gl4es_glGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat *params);
|
||||
//void gl4es_glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint *params);
|
||||
void gl4es_glIndexf(GLfloat c);
|
||||
void gl4es_glLightModeli(GLenum pname, GLint param);
|
||||
void gl4es_glPolygonStipple(const GLubyte *mask);
|
||||
void gl4es_glReadBuffer(GLenum mode);
|
||||
void gl4es_glSecondaryColor3f(GLfloat r, GLfloat g, GLfloat b);
|
||||
void gl4es_glColorTable (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
|
||||
//void gl4es_glIndexPointer(GLenum type, GLsizei stride, const GLvoid * pointer);
|
||||
|
||||
void glshim_glAccum(GLenum op, GLfloat value);
|
||||
void glshim_glPrioritizeTextures(GLsizei n, const GLuint *textures, const GLclampf *priorities);
|
||||
void glshim_glPixelMapfv(GLenum map, GLsizei mapsize, const GLfloat *values);
|
||||
void glshim_glPixelMapuiv(GLenum map,GLsizei mapsize, const GLuint *values);
|
||||
void glshim_glPixelMapusv(GLenum map,GLsizei mapsize, const GLushort *values);
|
||||
void glshim_glPassThrough(GLfloat token);
|
||||
void glshim_glIndexMask(GLuint mask);
|
||||
void glshim_glGetPixelMapfv(GLenum map, GLfloat *data);
|
||||
void glshim_glGetPixelMapuiv(GLenum map, GLuint *data);
|
||||
void glshim_glGetPixelMapusv(GLenum map, GLushort *data);
|
||||
void glshim_glClearIndex(GLfloat c);
|
||||
void glshim_glGetPolygonStipple(GLubyte *pattern);
|
||||
void glshim_glFeedbackBuffer(GLsizei size, GLenum type, GLfloat *buffer);
|
||||
void glshim_glEdgeFlagv(GLboolean *flag);
|
||||
void gl4es_glAccum(GLenum op, GLfloat value);
|
||||
void gl4es_glPrioritizeTextures(GLsizei n, const GLuint *textures, const GLclampf *priorities);
|
||||
void gl4es_glPixelMapfv(GLenum map, GLsizei mapsize, const GLfloat *values);
|
||||
void gl4es_glPixelMapuiv(GLenum map,GLsizei mapsize, const GLuint *values);
|
||||
void gl4es_glPixelMapusv(GLenum map,GLsizei mapsize, const GLushort *values);
|
||||
void gl4es_glPassThrough(GLfloat token);
|
||||
void gl4es_glIndexMask(GLuint mask);
|
||||
void gl4es_glGetPixelMapfv(GLenum map, GLfloat *data);
|
||||
void gl4es_glGetPixelMapuiv(GLenum map, GLuint *data);
|
||||
void gl4es_glGetPixelMapusv(GLenum map, GLushort *data);
|
||||
void gl4es_glClearIndex(GLfloat c);
|
||||
void gl4es_glGetPolygonStipple(GLubyte *pattern);
|
||||
void gl4es_glFeedbackBuffer(GLsizei size, GLenum type, GLfloat *buffer);
|
||||
void gl4es_glEdgeFlagv(GLboolean *flag);
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
#include <execinfo.h>
|
||||
#endif
|
||||
#include <fcntl.h>
|
||||
#if defined(PANDORA) || defined(ODROID)
|
||||
#define USE_FBIO 1
|
||||
#endif
|
||||
|
||||
#include "../../version.h"
|
||||
#include "../gl/init.h"
|
||||
|
||||
#ifdef USE_FBIO
|
||||
#include <linux/fb.h>
|
||||
@@ -45,8 +45,6 @@ static int sock = -2;
|
||||
#endif
|
||||
|
||||
#ifndef ANDROID
|
||||
static int shm_tested = 0;
|
||||
static int shm_shm = 0;
|
||||
typedef struct {
|
||||
int Width;
|
||||
int Height;
|
||||
@@ -73,7 +71,34 @@ static int isPBuffer(GLXDrawable drawable) {
|
||||
void BlitEmulatedPixmap();
|
||||
int createPBuffer(Display * dpy, const EGLint * egl_attribs, EGLSurface* Surface, EGLContext* Context, int redBits, int greenBits, int blueBits, int alphaBits, int samplebuffers, int samples);
|
||||
GLXPbuffer addPixBuffer(Display *dpy, EGLSurface surface, int Width, int Height, EGLContext Context, Pixmap pixmap, int depth, int emulated);
|
||||
|
||||
static Display *g_display = NULL;
|
||||
static GLXContext glxContext = NULL;
|
||||
static GLXContext fbContext = NULL;
|
||||
#endif //ANDROID
|
||||
|
||||
// hmm...
|
||||
static EGLContext eglContext;
|
||||
|
||||
static int fbcontext_count = 0;
|
||||
|
||||
#ifdef USE_FBIO
|
||||
#ifndef FBIO_WAITFORVSYNC
|
||||
#define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32)
|
||||
#endif
|
||||
static int fbdev = -1;
|
||||
#endif
|
||||
|
||||
static int g_width=0, g_height=0;
|
||||
// RPI stuffs
|
||||
static bool g_bcmhost = false;
|
||||
static bool g_bcm_active = false;
|
||||
void (*bcm_host_init)();
|
||||
void (*bcm_host_deinit)();
|
||||
|
||||
#define SHUT(a) if(!globals4es.nobanner) a
|
||||
|
||||
static int swap_interval = 1;
|
||||
|
||||
static EGLint egl_context_attrib[] = {
|
||||
#ifdef USE_ES2
|
||||
@@ -205,70 +230,13 @@ static int get_config_default(Display *display, int attribute, int *value) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static Display *g_display = NULL;
|
||||
static GLXContext glxContext = NULL;
|
||||
static GLXContext fbContext = NULL;
|
||||
static bool g_usepbuffer = false;
|
||||
#endif //ANDROID
|
||||
|
||||
// hmm...
|
||||
static EGLContext eglContext;
|
||||
|
||||
static int fbcontext_count = 0;
|
||||
static int glx_surface_srgb = 0;
|
||||
|
||||
#ifdef USE_FBIO
|
||||
#ifndef FBIO_WAITFORVSYNC
|
||||
#define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32)
|
||||
#endif
|
||||
#ifdef PANDORA
|
||||
static float pandora_gamma = 0.0f;
|
||||
#endif
|
||||
static int fbdev = -1;
|
||||
static bool g_vsync = false;
|
||||
#endif
|
||||
static bool g_showfps = false;
|
||||
static bool g_usefb = false;
|
||||
static bool g_usefbo = false;
|
||||
static bool g_xrefresh = false;
|
||||
static bool g_stacktrace = false;
|
||||
extern int automipmap;
|
||||
extern int texcopydata;
|
||||
extern int tested_env;
|
||||
extern int texshrink;
|
||||
extern int texdump;
|
||||
extern int alphahack;
|
||||
extern int texstream;
|
||||
extern int copytex;
|
||||
extern int nolumalpha;
|
||||
extern int blendhack;
|
||||
extern int export_blendcolor;
|
||||
extern int glshim_noerror;
|
||||
extern char glshim_version[50];
|
||||
extern int glshim_nobanner;
|
||||
extern int glshim_npot;
|
||||
int export_silentstub = 0;
|
||||
int glshim_queries = 1;
|
||||
|
||||
bool g_recyclefbo = false;
|
||||
static int g_width=0, g_height=0;
|
||||
// RPI stuffs
|
||||
static bool g_bcmhost = false;
|
||||
static bool g_bcm_active = false;
|
||||
void (*bcm_host_init)();
|
||||
void (*bcm_host_deinit)();
|
||||
|
||||
#define SHUT(a) if(!glshim_nobanner) a
|
||||
|
||||
static int swap_interval = 1;
|
||||
#ifndef ANDROID
|
||||
static void init_display(Display *display) {
|
||||
LOAD_EGL(eglGetDisplay);
|
||||
|
||||
if (! g_display) {
|
||||
g_display = display;//XOpenDisplay(NULL);
|
||||
}
|
||||
if (g_usefb) {
|
||||
if (globals4es.usefb) {
|
||||
eglDisplay = egl_eglGetDisplay(EGL_DEFAULT_DISPLAY);
|
||||
} else {
|
||||
eglDisplay = egl_eglGetDisplay(display);
|
||||
@@ -290,20 +258,20 @@ static void xrefresh() {
|
||||
|
||||
#ifdef PANDORA
|
||||
static void pandora_reset_gamma() {
|
||||
if(pandora_gamma>0.0f)
|
||||
if(globals4es.gamma>0.0f)
|
||||
system("sudo /usr/pandora/scripts/op_gamma.sh 0");
|
||||
}
|
||||
static void pandora_set_gamma() {
|
||||
if(pandora_gamma>0.0f) {
|
||||
if(globals4es.gamma>0.0f) {
|
||||
char buf[50];
|
||||
sprintf(buf, "sudo /usr/pandora/scripts/op_gamma.sh %.2f", pandora_gamma);
|
||||
sprintf(buf, "sudo /usr/pandora/scripts/op_gamma.sh %.2f", globals4es.gamma);
|
||||
int dummy = system(buf);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void signal_handler(int sig) {
|
||||
if (g_xrefresh)
|
||||
if (globals4es.xrefresh)
|
||||
xrefresh();
|
||||
#ifdef PANDORA
|
||||
pandora_reset_gamma();
|
||||
@@ -316,7 +284,7 @@ static void signal_handler(int sig) {
|
||||
}
|
||||
#endif
|
||||
#ifndef ANDROID
|
||||
if (g_stacktrace) {
|
||||
if (globals4es.stacktrace) {
|
||||
switch (sig) {
|
||||
case SIGBUS:
|
||||
case SIGFPE:
|
||||
@@ -360,53 +328,14 @@ static void init_liveinfo() {
|
||||
fcntl(sock, F_SETFL, O_NONBLOCK);
|
||||
}
|
||||
|
||||
static void fast_math() {
|
||||
// enable Cortex A8 RunFast
|
||||
int v = 0;
|
||||
__asm__ __volatile__ (
|
||||
"vmrs %0, fpscr\n"
|
||||
"orr %0, #((1<<25)|(1<<24))\n" // default NaN, flush-to-zero
|
||||
"vmsr fpscr, %0\n"
|
||||
//"vmrs %0, fpscr\n"
|
||||
: "=&r"(v));
|
||||
}
|
||||
#endif
|
||||
extern void initialize_glshim();
|
||||
extern int initialized;
|
||||
void scan_env() {
|
||||
static bool first = true;
|
||||
if (! first)
|
||||
return;
|
||||
first = false;
|
||||
if (! initialized)
|
||||
{
|
||||
initialize_glshim();
|
||||
}
|
||||
/* Check for some corruption inside state.... */
|
||||
/*
|
||||
if ((glstate->texture.active < 0) || (glstate->texture.active > MAX_TEX) ||
|
||||
(glstate->vao->pointers.vertex.buffer!= 0) || (glstate->vao->vertex != 0) || (glstate->list.active!=0)) {
|
||||
SHUT(LOGD("LIBGL: Warning, memory corruption detected at init, trying to compensate\n"));
|
||||
initialize_glshim();
|
||||
}
|
||||
*/
|
||||
// initialise MapDrawable too
|
||||
{
|
||||
int ret;
|
||||
MapDrawable = kh_init(mapdrawable);
|
||||
kh_put(mapdrawable, MapDrawable, 1, &ret);
|
||||
kh_del(mapdrawable, MapDrawable, 1);
|
||||
}
|
||||
SHUT(LOGD("LIBGL: built on %s %s\n", __DATE__, __TIME__));
|
||||
#define env(name, global, message) \
|
||||
char *env_##name = getenv(#name); \
|
||||
if (env_##name && strcmp(env_##name, "1") == 0) { \
|
||||
SHUT(LOGD("LIBGL: " message "\n")); \
|
||||
global = true; \
|
||||
}
|
||||
|
||||
env(LIBGL_XREFRESH, g_xrefresh, "xrefresh will be called on cleanup");
|
||||
env(LIBGL_STACKTRACE, g_stacktrace, "stacktrace will be printed on crash");
|
||||
void glx_init() {
|
||||
// init map_drawable
|
||||
int ret;
|
||||
MapDrawable = kh_init(mapdrawable);
|
||||
kh_put(mapdrawable, MapDrawable, 1, &ret);
|
||||
kh_del(mapdrawable, MapDrawable, 1);
|
||||
// if ok, grab the init/deinit functions
|
||||
if (bcm_host) {
|
||||
bcm_host_init = dlsym(bcm_host, "bcm_host_init");
|
||||
@@ -414,18 +343,18 @@ void scan_env() {
|
||||
if (bcm_host_init && bcm_host_deinit)
|
||||
g_bcmhost = true;
|
||||
}
|
||||
if (g_xrefresh || g_stacktrace || g_bcmhost) {
|
||||
if (globals4es.xrefresh || globals4es.stacktrace || g_bcmhost) {
|
||||
// TODO: a bit gross. Maybe look at this: http://stackoverflow.com/a/13290134/293352
|
||||
signal(SIGBUS, signal_handler);
|
||||
signal(SIGFPE, signal_handler);
|
||||
signal(SIGILL, signal_handler);
|
||||
signal(SIGSEGV, signal_handler);
|
||||
if (g_xrefresh || g_bcmhost) {
|
||||
if (globals4es.xrefresh || g_bcmhost) {
|
||||
signal(SIGINT, signal_handler);
|
||||
signal(SIGQUIT, signal_handler);
|
||||
signal(SIGTERM, signal_handler);
|
||||
}
|
||||
if (g_xrefresh)
|
||||
if (globals4es.xrefresh)
|
||||
atexit(xrefresh);
|
||||
#ifndef ANDROID
|
||||
#ifdef BCMHOST
|
||||
@@ -433,193 +362,20 @@ void scan_env() {
|
||||
#endif
|
||||
#endif //ANDROID
|
||||
}
|
||||
char *env_fb = getenv("LIBGL_FB");
|
||||
if (env_fb && strcmp(env_fb, "1") == 0) {
|
||||
SHUT(LOGD("LIBGL: framebuffer output enabled\n"));
|
||||
g_usefb = true;
|
||||
}
|
||||
if (env_fb && strcmp(env_fb, "2") == 0) {
|
||||
SHUT(LOGD("LIBGL: using framebuffer + fbo\n"));
|
||||
g_usefb = true;
|
||||
g_usefbo = true;
|
||||
}
|
||||
#ifndef ANDROID
|
||||
if (env_fb && strcmp(env_fb, "3") == 0) {
|
||||
SHUT(LOGD("LIBGL: using pbuffer\n"));
|
||||
g_usefb = true;
|
||||
g_usepbuffer = true;
|
||||
}
|
||||
#endif
|
||||
env(LIBGL_FPS, g_showfps, "fps counter enabled");
|
||||
#ifdef USE_FBIO
|
||||
env(LIBGL_VSYNC, g_vsync, "vsync enabled");
|
||||
if (g_vsync) {
|
||||
//V-Sync
|
||||
if (globals4es.vsync) {
|
||||
init_vsync();
|
||||
}
|
||||
#endif
|
||||
#ifdef PANDORA
|
||||
|
||||
init_liveinfo();
|
||||
if (sock>-1) {
|
||||
SHUT(LOGD("LIBGL: LiveInfo detected, fps will be shown\n"));
|
||||
}
|
||||
#endif
|
||||
int glshim_notest = 0;
|
||||
char *env_notest = getenv("LIBGL_NOTEST");
|
||||
if (env_notest && strcmp(env_notest, "1") == 0) {
|
||||
glshim_notest = 1;
|
||||
}
|
||||
GetHardwareExtensions(glshim_notest);
|
||||
|
||||
env(LIBGL_RECYCLEFBO, g_recyclefbo, "Recycling of FBO enabled");
|
||||
// Texture hacks
|
||||
char *env_mipmap = getenv("LIBGL_MIPMAP");
|
||||
if (env_mipmap && strcmp(env_mipmap, "1") == 0) {
|
||||
automipmap = 1;
|
||||
SHUT(LOGD("LIBGL: AutoMipMap forced\n"));
|
||||
}
|
||||
if (env_mipmap && strcmp(env_mipmap, "2") == 0) {
|
||||
automipmap = 2;
|
||||
SHUT(LOGD("LIBGL: guess AutoMipMap\n"));
|
||||
}
|
||||
if (env_mipmap && strcmp(env_mipmap, "3") == 0) {
|
||||
automipmap = 3;
|
||||
SHUT(LOGD("LIBGL: ignore MipMap\n"));
|
||||
}
|
||||
if (env_mipmap && strcmp(env_mipmap, "4") == 0) {
|
||||
automipmap = 4;
|
||||
SHUT(LOGD("LIBGL: ignore AutoMipMap on non-squared textures\n"));
|
||||
}
|
||||
char *env_texcopy = getenv("LIBGL_TEXCOPY");
|
||||
if (env_texcopy && strcmp(env_texcopy, "1") == 0) {
|
||||
texcopydata = 1;
|
||||
SHUT(LOGD("LIBGL: Texture copy enabled\n"));
|
||||
}
|
||||
char *env_shrink = getenv("LIBGL_SHRINK");
|
||||
if (env_shrink && strcmp(env_shrink, "1") == 0) {
|
||||
texshrink = 1;
|
||||
SHUT(LOGD("LIBGL: Texture shink, mode 1 selected (everything / 2)\n"));
|
||||
}
|
||||
if (env_shrink && strcmp(env_shrink, "2") == 0) {
|
||||
texshrink = 2;
|
||||
SHUT(LOGD("LIBGL: Texture shink, mode 2 selected (only > 512 /2 )\n"));
|
||||
}
|
||||
if (env_shrink && strcmp(env_shrink, "3") == 0) {
|
||||
texshrink = 3;
|
||||
SHUT(LOGD("LIBGL: Texture shink, mode 3 selected (only > 256 /2 )\n"));
|
||||
}
|
||||
if (env_shrink && strcmp(env_shrink, "4") == 0) {
|
||||
texshrink = 4;
|
||||
SHUT(LOGD("LIBGL: Texture shink, mode 4 selected (only > 256 /2, >=1024 /4 )\n"));
|
||||
}
|
||||
if (env_shrink && strcmp(env_shrink, "5") == 0) {
|
||||
texshrink = 5;
|
||||
SHUT(LOGD("LIBGL: Texture shink, mode 5 selected (every > 256 is downscaled to 256 ), but not for empty texture\n"));
|
||||
}
|
||||
if (env_shrink && strcmp(env_shrink, "6") == 0) {
|
||||
texshrink = 6;
|
||||
SHUT(LOGD("LIBGL: Texture shink, mode 6 selected (only > 128 /2, >=512 is downscaled to 256 ), but not for empty texture\n"));
|
||||
}
|
||||
if (env_shrink && strcmp(env_shrink, "7") == 0) {
|
||||
texshrink = 7;
|
||||
SHUT(LOGD("LIBGL: Texture shink, mode 7 selected (only > 512 /2 ), but not for empty texture\n"));
|
||||
}
|
||||
if (env_shrink && strcmp(env_shrink, "8") == 0) {
|
||||
texshrink = 8;
|
||||
SHUT(LOGD("LIBGL: Texture shink, mode 8 selected (advertise 8192 max texture size, but >2048 are shrinked to 2048)\n"));
|
||||
}
|
||||
if (env_shrink && strcmp(env_shrink, "9") == 0) {
|
||||
texshrink = 9;
|
||||
SHUT(LOGD("LIBGL: Texture shink, mode 9 selected (advertise 8192 max texture size, but >4096 are quadshrinked and > 512 are shrinked), but not for empty texture\n"));
|
||||
}
|
||||
if (env_shrink && strcmp(env_shrink, "10") == 0) {
|
||||
texshrink = 10;
|
||||
SHUT(LOGD("LIBGL: Texture shink, mode 10 selected (advertise 8192 max texture size, but >2048 are quadshrinked and > 512 are shrinked), but not for empty texture\n"));
|
||||
}
|
||||
char *env_dump = getenv("LIBGL_TEXDUMP");
|
||||
if (env_dump && strcmp(env_dump, "1") == 0) {
|
||||
texdump = 1;
|
||||
SHUT(LOGD("LIBGL: Texture dump enabled\n"));
|
||||
}
|
||||
char *env_alpha = getenv("LIBGL_ALPHAHACK");
|
||||
if (env_alpha && strcmp(env_alpha, "1") == 0) {
|
||||
alphahack = 1;
|
||||
SHUT(LOGD("LIBGL: Alpha Hack enabled\n"));
|
||||
}
|
||||
#ifdef TEXSTREAM
|
||||
char *env_stream = getenv("LIBGL_STREAM");
|
||||
if (env_stream && strcmp(env_stream, "1") == 0) {
|
||||
texstream = InitStreamingCache();
|
||||
SHUT(LOGD("LIBGL: Streaming texture %s\n",(texstream)?"enabled":"not available"));
|
||||
//FreeStreamed(AddStreamed(1024, 512, 0));
|
||||
}
|
||||
if (env_stream && strcmp(env_stream, "2") == 0) {
|
||||
texstream = InitStreamingCache()?2:0;
|
||||
SHUT(LOGD("LIBGL: Streaming texture %s\n",(texstream)?"forced":"not available"));
|
||||
//FreeStreamed(AddStreamed(1024, 512, 0));
|
||||
}
|
||||
#endif
|
||||
char *env_copy = getenv("LIBGL_COPY");
|
||||
if (env_copy && strcmp(env_copy, "1") == 0) {
|
||||
SHUT(LOGD("LIBGL: No glCopyTexImage2D / glCopyTexSubImage2D hack\n"));
|
||||
copytex = 1;
|
||||
}
|
||||
char *env_lumalpha = getenv("LIBGL_NOLUMALPHA");
|
||||
if (env_lumalpha && strcmp(env_lumalpha, "1") == 0) {
|
||||
nolumalpha = 1;
|
||||
SHUT(LOGD("LIBGL: GL_LUMINANCE_ALPHA hardware support disabled\n"));
|
||||
}
|
||||
|
||||
env(LIBGL_BLENDHACK, blendhack, "Change Blend GL_SRC_ALPHA, GL_ONE to GL_ONE, GL_ONE");
|
||||
env(LIBGL_BLENDCOLOR, export_blendcolor, "Export a (faked) glBlendColor");
|
||||
env(LIBGL_NOERROR, glshim_noerror, "glGetError() always return GL_NOERROR");
|
||||
env(LIBGL_SILENTSTUB, export_silentstub, "Stub/non present functions are not printed");
|
||||
|
||||
char *env_version = getenv("LIBGL_VERSION");
|
||||
if (env_version) {
|
||||
SHUT(LOGD("LIBGL: Overide version string with \"%s\" (should be in the form of \"1.x\")\n", env_version));
|
||||
}
|
||||
snprintf(glshim_version, 49, "%s glshim wrapper", (env_version)?env_version:"1.5");
|
||||
#ifdef PANDORA
|
||||
char *env_gamma = getenv("LIBGL_GAMMA");
|
||||
if (env_gamma) {
|
||||
pandora_gamma=atof(env_gamma);
|
||||
SHUT(LOGD("LIBGL: Set gamma to %.2f\n", pandora_gamma));
|
||||
if (globals4es.gamma != 0) {
|
||||
atexit(pandora_reset_gamma);
|
||||
}
|
||||
#endif
|
||||
char *env_srgb = getenv("LIBGL_SRGB");
|
||||
if (env_srgb && strcmp(env_srgb, "1") == 0 && hardext.srgb) {
|
||||
glx_surface_srgb = 2;
|
||||
SHUT(LOGD("LIBGL: enabling sRGB support\n"));
|
||||
}
|
||||
char *env_fastmath = getenv("LIBGL_FASTMATH");
|
||||
if (env_fastmath && strcmp(env_fastmath, "1") == 0) {
|
||||
#ifdef PANDORA
|
||||
SHUT(LOGD("LIBGL: Enable FastMath for cortex-a8\n"));
|
||||
fast_math();
|
||||
#else
|
||||
SHUT(LOGD("LIBGL: No FastMath on this platform\n"));
|
||||
#endif
|
||||
}
|
||||
char *env_npot = getenv("LIBGL_NPOT");
|
||||
glshim_npot = hardext.npot;
|
||||
if (env_npot && strcmp(env_npot, "1") == 0 && glshim_npot<1) {
|
||||
glshim_npot = 1;
|
||||
SHUT(LOGD("LIBGL: Expose limited NPOT extension\n"));
|
||||
}
|
||||
if (env_npot && strcmp(env_npot, "2") == 0 && glshim_npot<2) {
|
||||
glshim_npot = 2;
|
||||
SHUT(LOGD("LIBGL: Expose GL_ARB_texture_non_power_of_two extension\n"));
|
||||
}
|
||||
char *env_queries = getenv("LIBGL_GLQUERIES");
|
||||
if (env_queries && strcmp(env_queries, "0") == 0) {
|
||||
glshim_queries = 0;
|
||||
SHUT(LOGD("LIBGL: Dont't expose fake glQueries functions\n"));
|
||||
}
|
||||
|
||||
char cwd[1024];
|
||||
if (getcwd(cwd, sizeof(cwd))!= NULL)
|
||||
SHUT(LOGD("LIBGL: Current folder is:%s\n", cwd));
|
||||
}
|
||||
|
||||
#ifndef ANDROID
|
||||
@@ -645,9 +401,7 @@ EXPORT GLXContext glXCreateContext(Display *display,
|
||||
EGL_NONE
|
||||
};
|
||||
|
||||
scan_env();
|
||||
|
||||
if (g_usefb && fbcontext_count>0) {
|
||||
if (globals4es.usefb && fbcontext_count>0) {
|
||||
// don't create a new context, one FB is enough...
|
||||
fbcontext_count++;
|
||||
return fbContext;
|
||||
@@ -672,7 +426,7 @@ EXPORT GLXContext glXCreateContext(Display *display,
|
||||
GLXContext fake = malloc(sizeof(struct __GLXContextRec));
|
||||
memset(fake, 0, sizeof(struct __GLXContextRec));
|
||||
|
||||
if(g_usefb)
|
||||
if(globals4es.usefb)
|
||||
fbContext = fake;
|
||||
// make an egl context here...
|
||||
EGLBoolean result;
|
||||
@@ -699,7 +453,7 @@ EXPORT GLXContext glXCreateContext(Display *display,
|
||||
|
||||
int configsFound;
|
||||
result = egl_eglChooseConfig(eglDisplay, configAttribs, fake->eglConfigs, 1, &configsFound);
|
||||
if(g_usefb)
|
||||
if(globals4es.usefb)
|
||||
eglConfigs[0] = fake->eglConfigs[0];
|
||||
|
||||
CheckEGLErrors();
|
||||
@@ -710,13 +464,13 @@ EXPORT GLXContext glXCreateContext(Display *display,
|
||||
}
|
||||
EGLContext shared = (shareList)?shareList->eglContext:EGL_NO_CONTEXT;
|
||||
fake->eglContext = egl_eglCreateContext(eglDisplay, fake->eglConfigs[0], shared, egl_context_attrib);
|
||||
if(g_usefb)
|
||||
if(globals4es.usefb)
|
||||
eglContext = fake->eglContext;
|
||||
|
||||
CheckEGLErrors();
|
||||
|
||||
// need to return a glx context pointing at it
|
||||
fake->display = (g_usefb)?g_display:display;
|
||||
fake->display = (globals4es.usefb)?g_display:display;
|
||||
fake->direct = true;
|
||||
fake->xid = 1; //TODO: Proper handling of that id...
|
||||
fake->contextType = 0; //Window
|
||||
@@ -730,7 +484,7 @@ EXPORT GLXContext glXCreateContext(Display *display,
|
||||
fake->glstate = NewGLState((shareList)?shareList->glstate:NULL);
|
||||
/*
|
||||
// why unassign the context, it's not assigned yet
|
||||
if (!g_usefb) {
|
||||
if (!globals4es.usefb) {
|
||||
// unassign the context, it's not supposed to be active at the creation
|
||||
egl_eglMakeCurrent(eglDisplay, NULL, NULL, EGL_NO_CONTEXT);
|
||||
}
|
||||
@@ -766,7 +520,7 @@ GLXContext createPBufferContext(Display *display, GLXContext shareList, GLXFBCon
|
||||
// Init what need to be done
|
||||
EGLBoolean result;
|
||||
if (eglDisplay == NULL || eglDisplay == EGL_NO_DISPLAY) {
|
||||
init_display((g_usefb)?g_display:display);
|
||||
init_display((globals4es.usefb)?g_display:display);
|
||||
if (eglDisplay == EGL_NO_DISPLAY) {
|
||||
LOGE("LIBGL: Unable to create EGL display.\n");
|
||||
return 0;
|
||||
@@ -806,7 +560,7 @@ GLXContext createPBufferContext(Display *display, GLXContext shareList, GLXFBCon
|
||||
CheckEGLErrors();
|
||||
|
||||
// need to return a glx context pointing at it
|
||||
fake->display = (g_usefb)?g_display:display;
|
||||
fake->display = (globals4es.usefb)?g_display:display;
|
||||
fake->direct = true;
|
||||
fake->xid = 1; //TODO: Proper handling of that id...
|
||||
fake->contextType = 1; //PBuffer
|
||||
@@ -852,9 +606,7 @@ EXPORT GLXContext glXCreateContextAttribsARB(Display *display, GLXFBConfig confi
|
||||
EGL_NONE
|
||||
};
|
||||
|
||||
scan_env();
|
||||
|
||||
if (g_usefb && fbcontext_count>0) {
|
||||
if (globals4es.usefb && fbcontext_count>0) {
|
||||
// don't create a new context, one FB is enough...
|
||||
fbcontext_count++;
|
||||
return fbContext;
|
||||
@@ -881,7 +633,7 @@ EXPORT GLXContext glXCreateContextAttribsARB(Display *display, GLXFBConfig confi
|
||||
memset(fake, 0, sizeof(struct __GLXContextRec));
|
||||
|
||||
fake->glstate = NewGLState((share_context)?share_context->glstate:NULL);
|
||||
if(g_usefb)
|
||||
if(globals4es.usefb)
|
||||
fbContext = fake;
|
||||
// make an egl context here...
|
||||
EGLBoolean result;
|
||||
@@ -906,7 +658,7 @@ EXPORT GLXContext glXCreateContextAttribsARB(Display *display, GLXFBConfig confi
|
||||
|
||||
int configsFound;
|
||||
result = egl_eglChooseConfig(eglDisplay, configAttribs, fake->eglConfigs, 1, &configsFound);
|
||||
if(g_usefb)
|
||||
if(globals4es.usefb)
|
||||
eglConfigs[0] = fake->eglConfigs[0];
|
||||
|
||||
CheckEGLErrors();
|
||||
@@ -916,13 +668,13 @@ EXPORT GLXContext glXCreateContextAttribsARB(Display *display, GLXFBConfig confi
|
||||
}
|
||||
EGLContext shared = (share_context)?share_context->eglContext:EGL_NO_CONTEXT;
|
||||
fake->eglContext = egl_eglCreateContext(eglDisplay, fake->eglConfigs[0], shared, egl_context_attrib);
|
||||
if(g_usefb)
|
||||
if(globals4es.usefb)
|
||||
eglContext = fake->eglContext;
|
||||
|
||||
CheckEGLErrors();
|
||||
|
||||
// need to return a glx context pointing at it
|
||||
fake->display = (g_usefb)?g_display:display;
|
||||
fake->display = (globals4es.usefb)?g_display:display;
|
||||
fake->direct = true;
|
||||
fake->xid = 1; //TODO: Proper handling of that id...
|
||||
fake->contextType = 0; //Window
|
||||
@@ -942,14 +694,14 @@ EXPORT GLXContext glXCreateContextAttribsARB(Display *display, GLXFBConfig confi
|
||||
|
||||
EXPORT void glXDestroyContext(Display *display, GLXContext ctx) {
|
||||
//printf("glXDestroyContext(%p, %p)\n", display, ctx);
|
||||
if (g_usefb && ctx->contextType==0) {
|
||||
if (globals4es.usefb && ctx->contextType==0) {
|
||||
if (fbcontext_count==0)
|
||||
return; // Should not happens!
|
||||
if (--fbcontext_count > 0)
|
||||
return; // Nothing to do...
|
||||
}
|
||||
if ((!g_usefb && ctx->eglContext) || (g_usefb && eglContext)) {
|
||||
if (g_usefbo && ctx->contextType==0) {
|
||||
if ((!globals4es.usefb && ctx->eglContext) || (globals4es.usefb && eglContext)) {
|
||||
if (globals4es.usefbo && ctx->contextType==0) {
|
||||
deleteMainFBO();
|
||||
}
|
||||
|
||||
@@ -964,7 +716,7 @@ EXPORT void glXDestroyContext(Display *display, GLXContext ctx) {
|
||||
egl_eglDestroySurface(eglDisplay, ctx->eglSurface);
|
||||
ctx->eglSurface = 0;
|
||||
}
|
||||
if(g_usefb && ctx->contextType==0) {
|
||||
if(globals4es.usefb && ctx->contextType==0) {
|
||||
// clean global eglFB too
|
||||
eglSurface = 0;
|
||||
eglContext = 0;
|
||||
@@ -978,14 +730,14 @@ EXPORT void glXDestroyContext(Display *display, GLXContext ctx) {
|
||||
fbdev = -1;
|
||||
}*/
|
||||
}
|
||||
if (g_usefb)
|
||||
if (globals4es.usefb)
|
||||
fbContext = NULL;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
EXPORT Display *glXGetCurrentDisplay() {
|
||||
if (!g_usefb)
|
||||
if (!globals4es.usefb)
|
||||
return XOpenDisplay(NULL);
|
||||
else
|
||||
if (g_display && eglContext) {
|
||||
@@ -1055,8 +807,8 @@ EXPORT Bool glXMakeCurrent(Display *display,
|
||||
#endif
|
||||
} else {
|
||||
#ifndef ANDROID
|
||||
if(g_usefb) {
|
||||
if(g_usepbuffer) {
|
||||
if(globals4es.usefb) {
|
||||
if(globals4es.usepbuffer) {
|
||||
// Get Window size and all...
|
||||
unsigned int width, height, border, depth;
|
||||
Window root;
|
||||
@@ -1092,11 +844,11 @@ EXPORT Bool glXMakeCurrent(Display *display,
|
||||
if(eglSurface)
|
||||
eglSurf = context->eglSurface = eglSurface;
|
||||
else
|
||||
eglSurface = eglSurf = context->eglSurface = egl_eglCreateWindowSurface(eglDisplay, context->eglConfigs[0], 0, (glx_surface_srgb)?sRGB:NULL);
|
||||
eglSurface = eglSurf = context->eglSurface = egl_eglCreateWindowSurface(eglDisplay, context->eglConfigs[0], 0, (globals4es.glx_surface_srgb)?sRGB:NULL);
|
||||
} else {
|
||||
if(context->eglSurface)
|
||||
egl_eglDestroySurface(eglDisplay, context->eglSurface);
|
||||
eglSurf = context->eglSurface = egl_eglCreateWindowSurface(eglDisplay, context->eglConfigs[0], drawable, (glx_surface_srgb)?sRGB:NULL);
|
||||
eglSurf = context->eglSurface = egl_eglCreateWindowSurface(eglDisplay, context->eglConfigs[0], drawable, (globals4es.glx_surface_srgb)?sRGB:NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1139,7 +891,7 @@ EXPORT Bool glXMakeCurrent(Display *display,
|
||||
|
||||
CheckEGLErrors();
|
||||
if (result) {
|
||||
if (g_usefbo && created) {
|
||||
if (globals4es.usefbo && created) {
|
||||
// get size of the surface...
|
||||
egl_eglQuerySurface(eglDisplay,eglSurf,EGL_WIDTH,&g_width);
|
||||
egl_eglQuerySurface(eglDisplay,eglSurf,EGL_HEIGHT,&g_height);
|
||||
@@ -1184,7 +936,7 @@ EXPORT void glXSwapBuffers(Display *display,
|
||||
}
|
||||
}
|
||||
#ifdef USE_FBIO
|
||||
if (g_vsync && fbdev >= 0 && PBuffer==0) {
|
||||
if (globals4es.vsync && fbdev >= 0 && PBuffer==0) {
|
||||
// TODO: can I just return if I don't meet vsync over multiple frames?
|
||||
// this will just block otherwise.
|
||||
int arg = 0;
|
||||
@@ -1193,7 +945,7 @@ EXPORT void glXSwapBuffers(Display *display,
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (g_usefbo && PBuffer==0) {
|
||||
if (globals4es.usefbo && PBuffer==0) {
|
||||
glstate->gl_batch = 0;
|
||||
unbindMainFBO();
|
||||
blitMainFBO();
|
||||
@@ -1208,7 +960,7 @@ EXPORT void glXSwapBuffers(Display *display,
|
||||
egl_eglSwapBuffers(eglDisplay, surface);
|
||||
CheckEGLErrors();
|
||||
#ifdef PANDORA
|
||||
if (g_showfps || (sock>-1)) {
|
||||
if (globals4es.showfps || (sock>-1)) {
|
||||
// framerate counter
|
||||
static float avg, fps = 0;
|
||||
static int frame1, last_frame, frame, now, current_frames;
|
||||
@@ -1232,7 +984,7 @@ EXPORT void glXSwapBuffers(Display *display,
|
||||
current_frames = 0;
|
||||
|
||||
avg = frame / (float)(now - frame1);
|
||||
if (g_showfps) LOGD("LIBGL: fps: %.2f, avg: %.2f\n", fps, avg);
|
||||
if (globals4es.showfps) LOGD("LIBGL: fps: %.2f, avg: %.2f\n", fps, avg);
|
||||
if (sock>-1) {
|
||||
char tmp[60];
|
||||
snprintf(tmp, 60, "gl: %2.2f", fps);
|
||||
@@ -1243,7 +995,7 @@ EXPORT void glXSwapBuffers(Display *display,
|
||||
last_frame = now;
|
||||
}
|
||||
#endif
|
||||
if (g_usefbo && PBuffer==0) {
|
||||
if (globals4es.usefbo && PBuffer==0) {
|
||||
glstate->gl_batch = old_batch;
|
||||
bindMainFBO();
|
||||
}
|
||||
@@ -1317,7 +1069,7 @@ EXPORT void glXQueryDrawable( Display *dpy, int draw, int attribute,
|
||||
// stubs for glfw (GLX 1.3)
|
||||
EXPORT GLXContext glXGetCurrentContext() {
|
||||
// hack to make some games start
|
||||
if (g_usefb)
|
||||
if (globals4es.usefb)
|
||||
return glxContext ? glxContext : fbContext;
|
||||
else
|
||||
return glxContext;
|
||||
@@ -1499,7 +1251,7 @@ EXPORT GLXContext glXCreateNewContext(Display *display, GLXFBConfig config,
|
||||
EXPORT void glXSwapIntervalMESA(int interval) {
|
||||
//LOGD("glXSwapInterval(%i)\n", interval);
|
||||
#ifdef USE_FBIO
|
||||
if (! g_vsync)
|
||||
if (! globals4es.vsync)
|
||||
LOGD("LIBGL: Enable LIBGL_VSYNC=1 if you want to use vsync.\n");
|
||||
swap_interval = interval;
|
||||
#else
|
||||
@@ -1551,7 +1303,7 @@ EXPORT void glXUseXFont(Font font, int first, int count, int listBase) {
|
||||
GLubyte *bm;
|
||||
Display *dpy;
|
||||
Window win;
|
||||
if (g_usefb) {
|
||||
if (globals4es.usefb) {
|
||||
dpy = g_display;
|
||||
win = RootWindow(dpy, XDefaultScreen(dpy));
|
||||
} else {
|
||||
@@ -1578,19 +1330,19 @@ EXPORT void glXUseXFont(Font font, int first, int count, int listBase) {
|
||||
// Save GL texture parameters
|
||||
GLint swapbytes, lsbfirst, rowlength;
|
||||
GLint skiprows, skippixels, alignment;
|
||||
glshim_glGetIntegerv(GL_UNPACK_SWAP_BYTES, &swapbytes);
|
||||
glshim_glGetIntegerv(GL_UNPACK_LSB_FIRST, &lsbfirst);
|
||||
glshim_glGetIntegerv(GL_UNPACK_ROW_LENGTH, &rowlength);
|
||||
glshim_glGetIntegerv(GL_UNPACK_SKIP_ROWS, &skiprows);
|
||||
glshim_glGetIntegerv(GL_UNPACK_SKIP_PIXELS, &skippixels);
|
||||
glshim_glGetIntegerv(GL_UNPACK_ALIGNMENT, &alignment);
|
||||
gl4es_glGetIntegerv(GL_UNPACK_SWAP_BYTES, &swapbytes);
|
||||
gl4es_glGetIntegerv(GL_UNPACK_LSB_FIRST, &lsbfirst);
|
||||
gl4es_glGetIntegerv(GL_UNPACK_ROW_LENGTH, &rowlength);
|
||||
gl4es_glGetIntegerv(GL_UNPACK_SKIP_ROWS, &skiprows);
|
||||
gl4es_glGetIntegerv(GL_UNPACK_SKIP_PIXELS, &skippixels);
|
||||
gl4es_glGetIntegerv(GL_UNPACK_ALIGNMENT, &alignment);
|
||||
// Set Safe Texture params
|
||||
glshim_glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE);
|
||||
glshim_glPixelStorei(GL_UNPACK_LSB_FIRST, GL_FALSE);
|
||||
glshim_glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
|
||||
glshim_glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
|
||||
glshim_glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
|
||||
glshim_glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
gl4es_glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE);
|
||||
gl4es_glPixelStorei(GL_UNPACK_LSB_FIRST, GL_FALSE);
|
||||
gl4es_glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
|
||||
gl4es_glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
|
||||
gl4es_glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
|
||||
gl4es_glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
// Create GC and Pixmap
|
||||
pixmap = XCreatePixmap(dpy, win, 10, 10, 1);
|
||||
values.foreground = BlackPixel(dpy, DefaultScreen(dpy));
|
||||
@@ -1634,18 +1386,18 @@ EXPORT void glXUseXFont(Font font, int first, int count, int listBase) {
|
||||
inefficient, but it makes the OpenGL part real easy. */
|
||||
bm_width = (width + 7) / 8;
|
||||
bm_height = height;
|
||||
glshim_glNewList(list, GL_COMPILE);
|
||||
gl4es_glNewList(list, GL_COMPILE);
|
||||
if (valid && (bm_width > 0) && (bm_height > 0)) {
|
||||
|
||||
memset(bm, '\0', bm_width * bm_height);
|
||||
fill_bitmap(dpy, win, gc, bm_width, bm_height, x, y, c, bm);
|
||||
|
||||
glshim_glBitmap(width, height, x0, y0, dx, dy, bm);
|
||||
gl4es_glBitmap(width, height, x0, y0, dx, dy, bm);
|
||||
}
|
||||
else {
|
||||
glshim_glBitmap(0, 0, 0.0, 0.0, dx, dy, NULL);
|
||||
gl4es_glBitmap(0, 0, 0.0, 0.0, dx, dy, NULL);
|
||||
}
|
||||
glshim_glEndList();
|
||||
gl4es_glEndList();
|
||||
}
|
||||
|
||||
// Free GC & Pixmap
|
||||
@@ -1654,12 +1406,12 @@ EXPORT void glXUseXFont(Font font, int first, int count, int listBase) {
|
||||
XFreeGC(dpy, gc);
|
||||
|
||||
// Restore saved packing modes.
|
||||
glshim_glPixelStorei(GL_UNPACK_SWAP_BYTES, swapbytes);
|
||||
glshim_glPixelStorei(GL_UNPACK_LSB_FIRST, lsbfirst);
|
||||
glshim_glPixelStorei(GL_UNPACK_ROW_LENGTH, rowlength);
|
||||
glshim_glPixelStorei(GL_UNPACK_SKIP_ROWS, skiprows);
|
||||
glshim_glPixelStorei(GL_UNPACK_SKIP_PIXELS, skippixels);
|
||||
glshim_glPixelStorei(GL_UNPACK_ALIGNMENT, alignment);
|
||||
gl4es_glPixelStorei(GL_UNPACK_SWAP_BYTES, swapbytes);
|
||||
gl4es_glPixelStorei(GL_UNPACK_LSB_FIRST, lsbfirst);
|
||||
gl4es_glPixelStorei(GL_UNPACK_ROW_LENGTH, rowlength);
|
||||
gl4es_glPixelStorei(GL_UNPACK_SKIP_ROWS, skiprows);
|
||||
gl4es_glPixelStorei(GL_UNPACK_SKIP_PIXELS, skippixels);
|
||||
gl4es_glPixelStorei(GL_UNPACK_ALIGNMENT, alignment);
|
||||
// All done
|
||||
}
|
||||
#endif //ANDROID
|
||||
@@ -1754,7 +1506,7 @@ int createPBuffer(Display * dpy, const EGLint * egl_attribs, EGLSurface* Surface
|
||||
// Init what need to be done
|
||||
EGLBoolean result;
|
||||
if (eglDisplay == NULL || eglDisplay == EGL_NO_DISPLAY) {
|
||||
init_display((g_usefb)?g_display:dpy);
|
||||
init_display((globals4es.usefb)?g_display:dpy);
|
||||
if (eglDisplay == EGL_NO_DISPLAY) {
|
||||
LOGD("LIBGL: Unable to create EGL display.\n");
|
||||
return 0;
|
||||
@@ -1909,7 +1661,7 @@ int createPixBuffer(Display * dpy, int bpp, const EGLint * egl_attribs, NativePi
|
||||
// Init what need to be done
|
||||
EGLBoolean result;
|
||||
if (eglDisplay == NULL || eglDisplay == EGL_NO_DISPLAY) {
|
||||
init_display((g_usefb)?g_display:dpy);
|
||||
init_display((globals4es.usefb)?g_display:dpy);
|
||||
if (eglDisplay == EGL_NO_DISPLAY) {
|
||||
LOGE("LIBGL: Unable to create EGL display.\n");
|
||||
return 0;
|
||||
@@ -1964,7 +1716,7 @@ EXPORT GLXPixmap glXCreateGLXPixmap(Display *display, XVisualInfo * visual, Pixm
|
||||
int emulated = 0;
|
||||
XGetGeometry(display, pixmap, &root, &x, &y, &width, &height, &border, &depth);
|
||||
// let's try to create a PixmapSurface directly
|
||||
if(g_usefb || createPixBuffer(display, depth, NULL, (NativePixmapType)pixmap, &Surface, &Context)==0) {
|
||||
if(globals4es.usefb || createPixBuffer(display, depth, NULL, (NativePixmapType)pixmap, &Surface, &Context)==0) {
|
||||
// fail, so emulate with a PBuffer
|
||||
SHUT(LOGE("LIBGL: Pixmap creation failed, trying PBuffer instead\n"));
|
||||
//let's create a PixBuffer attributes
|
||||
@@ -2085,7 +1837,7 @@ void BlitEmulatedPixmap() {
|
||||
}
|
||||
}
|
||||
#else
|
||||
glshim_glReadPixels(0, 0, Width, Height, (Depth==16)?GL_RGB:GL_BGRA, (Depth==16)?GL_UNSIGNED_SHORT_5_6_5:GL_UNSIGNED_BYTE, (void*)pix);
|
||||
gl4es_glReadPixels(0, 0, Width, Height, (Depth==16)?GL_RGB:GL_BGRA, (Depth==16)?GL_UNSIGNED_SHORT_5_6_5:GL_UNSIGNED_BYTE, (void*)pix);
|
||||
if(reverse) {
|
||||
int stride = Width * (Depth==16?2:4);
|
||||
uintptr_t end=pix+sbuf-stride;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#include "../gl/gl.h"
|
||||
#include "hardext.h"
|
||||
#include "../gl/init.h"
|
||||
|
||||
static int tested = 0;
|
||||
|
||||
hardext_t hardext;
|
||||
|
||||
extern int glshim_nobanner;
|
||||
#define SHUT(a) if(!glshim_nobanner) a
|
||||
#define SHUT(a) if(!globals4es.nobanner) a
|
||||
|
||||
void GetHardwareExtensions(int notest)
|
||||
{
|
||||
|
||||
@@ -3,16 +3,13 @@
|
||||
#endif
|
||||
#include "glx.h"
|
||||
#include "hardext.h"
|
||||
|
||||
#include "../gl/init.h"
|
||||
#include "../gl/directstate.h"
|
||||
|
||||
#define EXPORT __attribute__((visibility("default")))
|
||||
|
||||
//#define DEBUG_ADDRESS
|
||||
|
||||
extern int export_blendcolor;
|
||||
extern int export_silentstub;
|
||||
|
||||
#ifdef DEBUG_ADDRESS
|
||||
#define MAP(func_name, func) \
|
||||
if (strcmp(name, func_name) == 0) return (void *)func;
|
||||
@@ -30,15 +27,15 @@ extern int export_silentstub;
|
||||
|
||||
#define EXT(func_name) MAP(#func_name "EXT", func_name)
|
||||
|
||||
#define _EX(func_name) MAP(#func_name, glshim_ ## func_name)
|
||||
#define _EX(func_name) MAP(#func_name, gl4es_ ## func_name)
|
||||
|
||||
#define _ARB(func_name) MAP(#func_name "ARB", glshim_ ## func_name)
|
||||
#define _ARB(func_name) MAP(#func_name "ARB", gl4es_ ## func_name)
|
||||
|
||||
#define _EXT(func_name) MAP(#func_name "EXT", glshim_ ## func_name)
|
||||
#define _EXT(func_name) MAP(#func_name "EXT", gl4es_ ## func_name)
|
||||
|
||||
#define STUB(func_name) \
|
||||
if (strcmp(name, #func_name) == 0) { \
|
||||
if(!export_silentstub) LOGD("glX stub: %s\n", #func_name); \
|
||||
if(!globals4es.silentstub) LOGD("glX stub: %s\n", #func_name); \
|
||||
return (void *)glXStub; \
|
||||
}
|
||||
|
||||
@@ -46,8 +43,6 @@ void glXStub(void *x, ...) {
|
||||
return;
|
||||
}
|
||||
|
||||
extern int glshim_queries;
|
||||
|
||||
EXPORT void *glXGetProcAddressARB(const char *name) {
|
||||
LOAD_EGL(eglGetProcAddress);
|
||||
#ifdef DEBUG_ADDRESS
|
||||
@@ -330,7 +325,7 @@ EXPORT void *glXGetProcAddressARB(const char *name) {
|
||||
_EX(glArrayElement);
|
||||
_EX(glBegin);
|
||||
_EX(glBitmap);
|
||||
if(export_blendcolor || hardext.blendcolor) {
|
||||
if(globals4es.blendcolor || hardext.blendcolor) {
|
||||
_EX(glBlendColor);
|
||||
_EXT(glBlendColor);
|
||||
_ARB(glBlendColor);
|
||||
@@ -634,7 +629,7 @@ EXPORT void *glXGetProcAddressARB(const char *name) {
|
||||
_EX(glMatrixMultTransposef);
|
||||
_EX(glMatrixMultTransposed);
|
||||
|
||||
if(glshim_queries) {
|
||||
if(globals4es.queries) {
|
||||
_EX(glGenQueries);
|
||||
_EX(glIsQuery);
|
||||
_EX(glDeleteQueries);
|
||||
@@ -648,7 +643,7 @@ EXPORT void *glXGetProcAddressARB(const char *name) {
|
||||
// GL_ARB_multisample
|
||||
_ARB(glSampleCoverage);
|
||||
|
||||
if (!export_silentstub) LOGD("glXGetProcAddress: %s not found.\n", name);
|
||||
if (!globals4es.silentstub) LOGD("glXGetProcAddress: %s not found.\n", name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -260,8 +260,8 @@ void ApplyFilterID(int ID, GLenum min_filter, GLenum mag_filter) {
|
||||
return;
|
||||
if (!stream_cache[ID].active)
|
||||
return;
|
||||
glshim_glTexParameterf(GL_TEXTURE_STREAM_IMG, GL_TEXTURE_MIN_FILTER, min_filter);
|
||||
glshim_glTexParameterf(GL_TEXTURE_STREAM_IMG, GL_TEXTURE_MAG_FILTER, mag_filter);
|
||||
gl4es_glTexParameterf(GL_TEXTURE_STREAM_IMG, GL_TEXTURE_MIN_FILTER, min_filter);
|
||||
gl4es_glTexParameterf(GL_TEXTURE_STREAM_IMG, GL_TEXTURE_MAG_FILTER, mag_filter);
|
||||
}
|
||||
|
||||
// Function to activate the Steaming texture ID on current tex...
|
||||
|
||||
@@ -1,77 +0,0 @@
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#include <SDL/SDL.h>
|
||||
#include <dlfcn.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
/*
|
||||
SDL_GrabMode SDL_WM_GrabInput(SDL_GrabMode mode) {
|
||||
printf("SDL_WM_GrabInput\n");
|
||||
return mode;
|
||||
}
|
||||
int SDL_ShowCursor(int toggle) {
|
||||
printf("SDL_ShowCursor(%i)\n", toggle);
|
||||
return toggle;
|
||||
}
|
||||
void SDL_WarpMouse(Uint16 x, Uint16 y) {
|
||||
printf("SDL_WM_WarpMouse\n");
|
||||
}
|
||||
int SDL_PollEvent(SDL_Event *event) {
|
||||
return 0;
|
||||
}
|
||||
*/
|
||||
|
||||
int SDL_SetGamma(float r, float g, float b) {
|
||||
printf("-!- Skipping SDL_SetGamma(%.2f, %.2f, %.2f)\n", r, g, b);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static Display *g_display;
|
||||
static int displayRefs = 0;
|
||||
typedef Display *(*XOPENDISPLAYPTR)(const char *);
|
||||
Display *XOpenDisplay(const char *display_name) {
|
||||
static XOPENDISPLAYPTR real_XOpenDisplay;
|
||||
if (!real_XOpenDisplay) {
|
||||
real_XOpenDisplay = (XOPENDISPLAYPTR)dlsym(RTLD_NEXT, "XOpenDisplay");
|
||||
}
|
||||
if (!g_display) {
|
||||
g_display = real_XOpenDisplay(display_name);
|
||||
}
|
||||
displayRefs++;
|
||||
return g_display;
|
||||
}
|
||||
|
||||
typedef int (*XCLOSEDISPLAYPTR)(Display *);
|
||||
int XCloseDisplay(Display *display) {
|
||||
static XCLOSEDISPLAYPTR real_XCloseDisplay;
|
||||
if (!real_XCloseDisplay) {
|
||||
real_XCloseDisplay = (XCLOSEDISPLAYPTR)dlsym(RTLD_NEXT, "XCloseDisplay");
|
||||
}
|
||||
if (g_display == display && displayRefs > 0) {
|
||||
if (displayRefs-- == 0) {
|
||||
g_display = NULL;
|
||||
return real_XCloseDisplay(display);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Pandora crashes on mouse events caused by libxi. Workaround by overriding this... */
|
||||
int XIQueryVersion(void *display, int *major, int *minor) {
|
||||
printf("-!- Skipping Xinput(%d, %d) query for display: %p\n", (major?*major:0), (minor?*minor:0), display);
|
||||
return 1; // BadRequest
|
||||
}
|
||||
|
||||
/*
|
||||
typedef int (*XSYNCPTR)(Display *, Bool);
|
||||
int XSync(Display *display, Bool discard) {
|
||||
// discard = 1;
|
||||
|
||||
static XSYNCPTR real_XSync;
|
||||
if (!real_XSync) {
|
||||
real_XSync = (XSYNCPTR)dlsym(RTLD_NEXT, "XSync");
|
||||
}
|
||||
return real_XSync(display, discard);
|
||||
}
|
||||
*/
|
||||
@@ -1,8 +0,0 @@
|
||||
aux_source_directory(host HOST_SOURCES)
|
||||
add_library(proxyhost SHARED EXCLUDE_FROM_ALL ${HOST_SOURCES})
|
||||
target_link_libraries(proxyhost GL asound)
|
||||
|
||||
add_library(proxyhost_static STATIC EXCLUDE_FROM_ALL ${HOST_SOURCES})
|
||||
set_target_properties(proxyhost_static PROPERTIES OUTPUT_NAME proxyhost)
|
||||
|
||||
add_subdirectory(client)
|
||||
@@ -1,13 +0,0 @@
|
||||
aux_source_directory(src CLIENT_SOURCES)
|
||||
add_library(proxyclient SHARED EXCLUDE_FROM_ALL ${CLIENT_SOURCES})
|
||||
include_directories(.)
|
||||
|
||||
set_target_properties(proxyclient PROPERTIES
|
||||
VERSION "2.0.0"
|
||||
SOVERSION "2"
|
||||
)
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-version-script=Versions")
|
||||
|
||||
if(CMAKE_SHARED_LIBRARY_SUFFIX MATCHES ".so")
|
||||
set_target_properties(proxyclient PROPERTIES SUFFIX ".so.1")
|
||||
endif()
|
||||
@@ -1,292 +0,0 @@
|
||||
ALSA_0.9 {
|
||||
global:
|
||||
gl*;
|
||||
__snd_*;
|
||||
_snd_*;
|
||||
snd_*;
|
||||
snd_pcm_recover;
|
||||
local:
|
||||
*;
|
||||
};
|
||||
|
||||
ALSA_0.9.0rc4 {
|
||||
global:
|
||||
|
||||
snd_pcm_hw_params_get_access;
|
||||
snd_pcm_hw_params_set_access_first;
|
||||
snd_pcm_hw_params_set_access_last;
|
||||
|
||||
snd_pcm_hw_params_get_format;
|
||||
snd_pcm_hw_params_set_format_first;
|
||||
snd_pcm_hw_params_set_format_last;
|
||||
|
||||
snd_pcm_hw_params_get_subformat;
|
||||
snd_pcm_hw_params_set_subformat_first;
|
||||
snd_pcm_hw_params_set_subformat_last;
|
||||
|
||||
snd_pcm_hw_params_get_channels;
|
||||
snd_pcm_hw_params_get_channels_min;
|
||||
snd_pcm_hw_params_get_channels_max;
|
||||
snd_pcm_hw_params_set_channels_near;
|
||||
snd_pcm_hw_params_set_channels_first;
|
||||
snd_pcm_hw_params_set_channels_last;
|
||||
|
||||
snd_pcm_hw_params_get_rate;
|
||||
snd_pcm_hw_params_get_rate_min;
|
||||
snd_pcm_hw_params_get_rate_max;
|
||||
snd_pcm_hw_params_set_rate_near;
|
||||
snd_pcm_hw_params_set_rate_first;
|
||||
snd_pcm_hw_params_set_rate_last;
|
||||
|
||||
snd_pcm_hw_params_get_period_time;
|
||||
snd_pcm_hw_params_get_period_time_min;
|
||||
snd_pcm_hw_params_get_period_time_max;
|
||||
snd_pcm_hw_params_set_period_time_near;
|
||||
snd_pcm_hw_params_set_period_time_first;
|
||||
snd_pcm_hw_params_set_period_time_last;
|
||||
|
||||
snd_pcm_hw_params_get_period_size;
|
||||
snd_pcm_hw_params_get_period_size_min;
|
||||
snd_pcm_hw_params_get_period_size_max;
|
||||
snd_pcm_hw_params_set_period_size_near;
|
||||
snd_pcm_hw_params_set_period_size_first;
|
||||
snd_pcm_hw_params_set_period_size_last;
|
||||
|
||||
snd_pcm_hw_params_get_periods;
|
||||
snd_pcm_hw_params_get_periods_min;
|
||||
snd_pcm_hw_params_get_periods_max;
|
||||
snd_pcm_hw_params_set_periods_near;
|
||||
snd_pcm_hw_params_set_periods_first;
|
||||
snd_pcm_hw_params_set_periods_last;
|
||||
|
||||
snd_pcm_hw_params_get_buffer_time;
|
||||
snd_pcm_hw_params_get_buffer_time_min;
|
||||
snd_pcm_hw_params_get_buffer_time_max;
|
||||
snd_pcm_hw_params_set_buffer_time_near;
|
||||
snd_pcm_hw_params_set_buffer_time_first;
|
||||
snd_pcm_hw_params_set_buffer_time_last;
|
||||
|
||||
snd_pcm_hw_params_get_buffer_size;
|
||||
snd_pcm_hw_params_get_buffer_size_min;
|
||||
snd_pcm_hw_params_get_buffer_size_max;
|
||||
snd_pcm_hw_params_set_buffer_size_near;
|
||||
snd_pcm_hw_params_set_buffer_size_first;
|
||||
snd_pcm_hw_params_set_buffer_size_last;
|
||||
|
||||
snd_pcm_hw_params_get_tick_time;
|
||||
snd_pcm_hw_params_get_tick_time_min;
|
||||
snd_pcm_hw_params_get_tick_time_max;
|
||||
snd_pcm_hw_params_set_tick_time_near;
|
||||
snd_pcm_hw_params_set_tick_time_first;
|
||||
snd_pcm_hw_params_set_tick_time_last;
|
||||
|
||||
} ALSA_0.9;
|
||||
|
||||
ALSA_0.9.0rc8 {
|
||||
global:
|
||||
|
||||
snd_pcm_forward;
|
||||
snd_pcm_status_get_trigger_htstamp;
|
||||
snd_pcm_status_get_htstamp;
|
||||
|
||||
} ALSA_0.9.0rc4;
|
||||
|
||||
ALSA_0.9.0 {
|
||||
global:
|
||||
|
||||
snd_pcm_type_name;
|
||||
snd_timer_query_info;
|
||||
snd_timer_query_params;
|
||||
snd_timer_query_status;
|
||||
snd_timer_params_set_exclusive;
|
||||
snd_timer_params_get_exclusive;
|
||||
snd_timer_params_set_filter;
|
||||
snd_timer_params_get_filter;
|
||||
} ALSA_0.9.0rc8;
|
||||
|
||||
ALSA_0.9.3 {
|
||||
global:
|
||||
|
||||
snd_ctl_elem_info_get_dimensions;
|
||||
snd_ctl_elem_info_get_dimension;
|
||||
} ALSA_0.9.0;
|
||||
|
||||
ALSA_0.9.5 {
|
||||
global:
|
||||
|
||||
alsa_lisp;
|
||||
} ALSA_0.9.3;
|
||||
|
||||
ALSA_0.9.6 {
|
||||
global:
|
||||
|
||||
snd_hctl_open_ctl;
|
||||
snd_seq_port_info_get_timestamping;
|
||||
snd_seq_port_info_get_timestamp_real;
|
||||
snd_seq_port_info_get_timestamp_queue;
|
||||
snd_seq_port_info_set_timestamping;
|
||||
snd_seq_port_info_set_timestamp_real;
|
||||
snd_seq_port_info_set_timestamp_queue;
|
||||
} ALSA_0.9.5;
|
||||
|
||||
ALSA_0.9.7 {
|
||||
global:
|
||||
|
||||
snd_user_file;
|
||||
snd_hctl_ctl;
|
||||
sndo_*;
|
||||
alsa_lisp_*;
|
||||
} ALSA_0.9.6;
|
||||
|
||||
ALSA_0.9.8 {
|
||||
global:
|
||||
|
||||
snd_ctl_elem_add;
|
||||
snd_ctl_elem_replace;
|
||||
snd_ctl_elem_remove;
|
||||
snd_hctl_poll_descriptors_revents;
|
||||
} ALSA_0.9.7;
|
||||
|
||||
ALSA_1.0.4 {
|
||||
global:
|
||||
|
||||
snd_spcm_init;
|
||||
snd_spcm_init_duplex;
|
||||
snd_spcm_init_get_params;
|
||||
} ALSA_0.9.8;
|
||||
|
||||
ALSA_1.0.5 {
|
||||
global:
|
||||
|
||||
snd_asoundlib_version;
|
||||
snd_timer_params_set_early_event;
|
||||
snd_timer_params_get_early_event;
|
||||
} ALSA_1.0.4;
|
||||
|
||||
ALSA_1.0.8 {
|
||||
global:
|
||||
|
||||
snd_ctl_elem_add_integer;
|
||||
snd_ctl_elem_add_integer64;
|
||||
snd_ctl_elem_add_boolean;
|
||||
snd_ctl_elem_add_iec958;
|
||||
snd_ctl_elem_remove;
|
||||
} ALSA_1.0.5;
|
||||
|
||||
ALSA_1.0.9 {
|
||||
global:
|
||||
|
||||
snd_names_list;
|
||||
snd_names_list_free;
|
||||
|
||||
snd_pcm_hw_params_set_rate_resample;
|
||||
snd_pcm_hw_params_get_rate_resample;
|
||||
snd_pcm_hw_params_set_export_buffer;
|
||||
snd_pcm_hw_params_get_export_buffer;
|
||||
|
||||
snd_pcm_ioplug_create;
|
||||
snd_pcm_ioplug_delete;
|
||||
snd_pcm_ioplug_reinit_status;
|
||||
snd_pcm_ioplug_params_reset;
|
||||
snd_pcm_ioplug_set_param_minmax;
|
||||
snd_pcm_ioplug_set_param_list;
|
||||
|
||||
snd_pcm_extplug_create;
|
||||
snd_pcm_extplug_delete;
|
||||
snd_pcm_extplug_params_reset;
|
||||
snd_pcm_extplug_set_param_list;
|
||||
snd_pcm_extplug_set_param_minmax;
|
||||
snd_pcm_extplug_set_slave_param_list;
|
||||
snd_pcm_extplug_set_slave_param_minmax;
|
||||
|
||||
snd_pcm_parse_control_id;
|
||||
|
||||
snd_async_add_timer_handler;
|
||||
snd_async_handler_get_timer;
|
||||
|
||||
snd_timer_ginfo_sizeof;
|
||||
snd_timer_ginfo_malloc;
|
||||
snd_timer_ginfo_free;
|
||||
snd_timer_ginfo_copy;
|
||||
snd_timer_ginfo_set_tid;
|
||||
snd_timer_ginfo_get_tid;
|
||||
snd_timer_ginfo_get_flags;
|
||||
snd_timer_ginfo_get_card;
|
||||
snd_timer_ginfo_get_id;
|
||||
snd_timer_ginfo_get_name;
|
||||
snd_timer_ginfo_get_resolution;
|
||||
snd_timer_ginfo_get_resolution_min;
|
||||
snd_timer_ginfo_get_resolution_max;
|
||||
snd_timer_ginfo_get_clients;
|
||||
|
||||
} ALSA_1.0.8;
|
||||
|
||||
ALSA_1.0.10 {
|
||||
global:
|
||||
|
||||
snd_mixer_get_hctl;
|
||||
snd_mixer_elem_get_private;
|
||||
snd_mixer_attach_hctl;
|
||||
snd_mixer_detach_hctl;
|
||||
|
||||
snd_mixer_class_register;
|
||||
snd_mixer_add_elem;
|
||||
snd_mixer_remove_elem;
|
||||
snd_mixer_elem_new;
|
||||
snd_mixer_elem_add;
|
||||
snd_mixer_elem_remove;
|
||||
snd_mixer_elem_free;
|
||||
snd_mixer_elem_info;
|
||||
snd_mixer_elem_value;
|
||||
snd_mixer_elem_attach;
|
||||
snd_mixer_elem_detach;
|
||||
snd_mixer_elem_empty;
|
||||
|
||||
snd_mixer_class_malloc;
|
||||
snd_mixer_class_free;
|
||||
snd_mixer_class_copy;
|
||||
snd_mixer_class_get_mixer;
|
||||
snd_mixer_class_get_event;
|
||||
snd_mixer_class_get_private;
|
||||
snd_mixer_class_get_compare;
|
||||
snd_mixer_class_set_event;
|
||||
snd_mixer_class_set_private;
|
||||
snd_mixer_class_set_private_free;
|
||||
snd_mixer_class_set_compare;
|
||||
|
||||
snd_mixer_selem_set_playback_dB_all;
|
||||
snd_mixer_selem_set_capture_dB_all;
|
||||
snd_mixer_selem_is_enum_playback;
|
||||
snd_mixer_selem_is_enum_capture;
|
||||
snd_mixer_selem_compare;
|
||||
snd_mixer_sbasic_info;
|
||||
snd_mixer_sbasic_get_private;
|
||||
snd_mixer_sbasic_set_private;
|
||||
snd_mixer_sbasic_set_private_free;
|
||||
|
||||
snd_ctl_ext_create;
|
||||
snd_ctl_ext_delete;
|
||||
|
||||
} ALSA_1.0.9;
|
||||
|
||||
ALSA_1.0.11 {
|
||||
global:
|
||||
|
||||
snd_pcm_recover;
|
||||
snd_pcm_set_params;
|
||||
snd_pcm_get_params;
|
||||
} ALSA_1.0.10;
|
||||
|
||||
ALSA_1.0.12 {
|
||||
global:
|
||||
|
||||
snd_ctl_elem_tlv_read;
|
||||
snd_ctl_elem_tlv_write;
|
||||
snd_ctl_elem_tlv_command;
|
||||
snd_ctl_elem_info_is_tlv_readable;
|
||||
snd_ctl_elem_info_is_tlv_writable;
|
||||
snd_ctl_elem_info_is_tlv_commandable;
|
||||
snd_hctl_elem_tlv_read;
|
||||
snd_hctl_elem_tlv_write;
|
||||
snd_hctl_elem_tlv_command;
|
||||
} ALSA_1.0.11;
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,180 +0,0 @@
|
||||
#define skip_client_glXGetProcAddress
|
||||
#define skip_client_glXGetProcAddressARB
|
||||
|
||||
#define skip_index_glAccum
|
||||
#define skip_index_glBeginQuery
|
||||
#define skip_index_glBlendColor
|
||||
#define skip_index_glBlendEquation
|
||||
#define skip_index_glClearIndex
|
||||
#define skip_index_glColorSubTable
|
||||
#define skip_index_glColorTable
|
||||
#define skip_index_glColorTableParameterfv
|
||||
#define skip_index_glColorTableParameteriv
|
||||
#define skip_index_glCompressedTexImage1D
|
||||
#define skip_index_glCompressedTexImage3D
|
||||
#define skip_index_glCompressedTexSubImage1D
|
||||
#define skip_index_glCompressedTexSubImage3D
|
||||
#define skip_index_glConvolutionFilter1D
|
||||
#define skip_index_glConvolutionFilter2D
|
||||
#define skip_index_glConvolutionParameterf
|
||||
#define skip_index_glConvolutionParameterfv
|
||||
#define skip_index_glConvolutionParameteri
|
||||
#define skip_index_glConvolutionParameteriv
|
||||
#define skip_index_glCopyColorSubTable
|
||||
#define skip_index_glCopyColorTable
|
||||
#define skip_index_glCopyConvolutionFilter1D
|
||||
#define skip_index_glCopyConvolutionFilter2D
|
||||
#define skip_index_glCopyTexImage1D
|
||||
#define skip_index_glCopyTexSubImage1D
|
||||
#define skip_index_glCopyTexSubImage3D
|
||||
#define skip_index_glDeleteQueries
|
||||
#define skip_index_glDrawRangeElements
|
||||
#define skip_index_glEdgeFlagPointer
|
||||
#define skip_index_glEdgeFlagv
|
||||
#define skip_index_glEndQuery
|
||||
#define skip_index_glFeedbackBuffer
|
||||
#define skip_index_glFogCoordPointer
|
||||
#define skip_index_glGenQueries
|
||||
#define skip_index_glGetBufferPointerv
|
||||
#define skip_index_glGetBufferSubData
|
||||
#define skip_index_glGetClipPlane
|
||||
#define skip_index_glGetColorTable
|
||||
#define skip_index_glGetColorTableParameterfv
|
||||
#define skip_index_glGetColorTableParameteriv
|
||||
#define skip_index_glGetCompressedTexImage
|
||||
#define skip_index_glGetConvolutionFilter
|
||||
#define skip_index_glGetConvolutionParameterfv
|
||||
#define skip_index_glGetConvolutionParameteriv
|
||||
#define skip_index_glGetHistogram
|
||||
#define skip_index_glGetHistogramParameterfv
|
||||
#define skip_index_glGetHistogramParameteriv
|
||||
#define skip_index_glGetLightiv
|
||||
#define skip_index_glGetMaterialiv
|
||||
#define skip_index_glGetMinmax
|
||||
#define skip_index_glGetMinmaxParameterfv
|
||||
#define skip_index_glGetMinmaxParameteriv
|
||||
#define skip_index_glGetPixelMapfv
|
||||
#define skip_index_glGetPixelMapuiv
|
||||
#define skip_index_glGetPixelMapusv
|
||||
#define skip_index_glGetPolygonStipple
|
||||
#define skip_index_glGetQueryiv
|
||||
#define skip_index_glGetQueryObjectiv
|
||||
#define skip_index_glGetQueryObjectuiv
|
||||
#define skip_index_glGetSeparableFilter
|
||||
#define skip_index_glGetTexGendv
|
||||
#define skip_index_glGetTexGenfv
|
||||
#define skip_index_glGetTexGeniv
|
||||
#define skip_index_glHistogram
|
||||
#define skip_index_glIndexMask
|
||||
#define skip_index_glIndexPointer
|
||||
#define skip_index_glIsQuery
|
||||
#define skip_index_glLoadTransposeMatrixd
|
||||
#define skip_index_glLoadTransposeMatrixf
|
||||
#define skip_index_glMapBuffer
|
||||
#define skip_index_glMaterialiv
|
||||
#define skip_index_glMinmax
|
||||
#define skip_index_glMultiDrawArrays
|
||||
#define skip_index_glMultiDrawElements
|
||||
#define skip_index_glMultiTexCoord1d
|
||||
#define skip_index_glMultiTexCoord1dv
|
||||
#define skip_index_glMultiTexCoord1f
|
||||
#define skip_index_glMultiTexCoord1fv
|
||||
#define skip_index_glMultiTexCoord1i
|
||||
#define skip_index_glMultiTexCoord1iv
|
||||
#define skip_index_glMultiTexCoord1s
|
||||
#define skip_index_glMultiTexCoord1sv
|
||||
#define skip_index_glMultiTexCoord2d
|
||||
#define skip_index_glMultiTexCoord2dv
|
||||
#define skip_index_glMultiTexCoord2fv
|
||||
#define skip_index_glMultiTexCoord2i
|
||||
#define skip_index_glMultiTexCoord2iv
|
||||
#define skip_index_glMultiTexCoord2s
|
||||
#define skip_index_glMultiTexCoord2sv
|
||||
#define skip_index_glMultiTexCoord3d
|
||||
#define skip_index_glMultiTexCoord3dv
|
||||
#define skip_index_glMultiTexCoord3f
|
||||
#define skip_index_glMultiTexCoord3fv
|
||||
#define skip_index_glMultiTexCoord3i
|
||||
#define skip_index_glMultiTexCoord3iv
|
||||
#define skip_index_glMultiTexCoord3s
|
||||
#define skip_index_glMultiTexCoord3sv
|
||||
#define skip_index_glMultiTexCoord4d
|
||||
#define skip_index_glMultiTexCoord4dv
|
||||
#define skip_index_glMultiTexCoord4fv
|
||||
#define skip_index_glMultiTexCoord4i
|
||||
#define skip_index_glMultiTexCoord4iv
|
||||
#define skip_index_glMultiTexCoord4s
|
||||
#define skip_index_glMultiTexCoord4sv
|
||||
#define skip_index_glMultTransposeMatrixd
|
||||
#define skip_index_glMultTransposeMatrixf
|
||||
#define skip_index_glPassThrough
|
||||
#define skip_index_glPixelMapfv
|
||||
#define skip_index_glPixelMapuiv
|
||||
#define skip_index_glPixelMapusv
|
||||
#define skip_index_glPixelStoref
|
||||
#define skip_index_glPointParameteri
|
||||
#define skip_index_glPointParameteriv
|
||||
#define skip_index_glPrioritizeTextures
|
||||
#define skip_index_glResetHistogram
|
||||
#define skip_index_glResetMinmax
|
||||
#define skip_index_glSecondaryColorPointer
|
||||
#define skip_index_glSeparableFilter2D
|
||||
#define skip_index_glUnmapBuffer
|
||||
#define skip_index_glWindowPos2d
|
||||
#define skip_index_glWindowPos2dv
|
||||
#define skip_index_glWindowPos2f
|
||||
#define skip_index_glWindowPos2fv
|
||||
#define skip_index_glWindowPos2i
|
||||
#define skip_index_glWindowPos2iv
|
||||
#define skip_index_glWindowPos2s
|
||||
#define skip_index_glWindowPos2sv
|
||||
#define skip_index_glWindowPos3d
|
||||
#define skip_index_glWindowPos3dv
|
||||
#define skip_index_glWindowPos3f
|
||||
#define skip_index_glWindowPos3fv
|
||||
#define skip_index_glWindowPos3i
|
||||
#define skip_index_glWindowPos3iv
|
||||
#define skip_index_glWindowPos3s
|
||||
#define skip_index_glWindowPos3sv
|
||||
|
||||
#define skip_index_glXCreatePixmap
|
||||
#define skip_index_glXChangeDrawableAttributesSGIX
|
||||
#define skip_index_glXGetDrawableAttributesSGIX
|
||||
#define skip_index_glXVendorPrivate
|
||||
#define skip_index_glXQueryContextInfoEXT
|
||||
#define skip_index_glXGetSelectedEvent
|
||||
#define skip_index_glXDestroyPixmap
|
||||
#define skip_index_glXCreateContextWithConfigSGIX
|
||||
#define skip_index_glXJoinSwapGroupSGIX
|
||||
#define skip_index_glXHyperpipeAttribSGIX
|
||||
#define skip_index_glXQueryDrawable
|
||||
#define skip_index_glXVendorPrivateWithReply
|
||||
#define skip_index_glXQueryHyperpipeConfigSGIX
|
||||
#define skip_index_glXChangeDrawableAttributes
|
||||
#define skip_index_glXMakeCurrentReadSGI
|
||||
#define skip_index_glXQueryHyperpipeNetworkSGIX
|
||||
#define skip_index_glXBindSwapBarrierSGIX
|
||||
#define skip_index_glXGetFBConfigsSGIX
|
||||
#define skip_index_glXBindHyperpipeSGIX
|
||||
#define skip_index_glXDestroyPbuffer
|
||||
#define skip_index_glXGetVisualConfigs
|
||||
#define skip_index_glXRender
|
||||
#define skip_index_glXClientInfo
|
||||
#define skip_index_glXHyperpipeConfigSGIX
|
||||
#define skip_index_glXSelectEvent
|
||||
#define skip_index_glXRenderLarge
|
||||
#define skip_index_glXDestroyHyperpipeConfigSGIX
|
||||
#define skip_index_glXGetDrawableAttributes
|
||||
#define skip_index_glXDestroyGLXVideoSourceSGIX
|
||||
#define skip_index_glXQueryHyperpipeBestAttribSGIX
|
||||
#define skip_index_glXQueryMaxSwapBarriersSGIX
|
||||
#define skip_index_glXDestroyGLXPbufferSGIX
|
||||
#define skip_index_glXCreateGLXPixmapWithConfigSGIX
|
||||
#define skip_index_glXCreateWindow
|
||||
#define skip_index_glXQueryContext
|
||||
#define skip_index_glXCreatePbuffer
|
||||
#define skip_index_glXCreateGLXPbufferSGIX
|
||||
#define skip_index_glXQueryHyperpipeAttribSGIX
|
||||
#define skip_index_glXDestroyWindow
|
||||
#define skip_index_glXCreateGLXVideoSourceSGIX
|
||||
#define skip_index_glXGetCurrentReadDrawable
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,2 +0,0 @@
|
||||
#define SYS_proxy 9999
|
||||
extern void glIndexedCall(const void *packed, void *ret_v);
|
||||
File diff suppressed because it is too large
Load Diff
8
project/jni/gl4es/version.h
Executable file
8
project/jni/gl4es/version.h
Executable file
@@ -0,0 +1,8 @@
|
||||
#ifndef _GL4ES_VERSION_H
|
||||
#define _GL4ES_VERSION_H
|
||||
|
||||
#define MAJOR 0
|
||||
#define MINOR 9
|
||||
#define REVISION 1
|
||||
|
||||
#endif //_GL4ES_VERSION_H
|
||||
Reference in New Issue
Block a user