Merge branch 'sdl_android' of github.com:pelya/commandergenius into sdl_android
This commit is contained in:
@@ -287,7 +287,7 @@ class DataDownloader extends Thread
|
||||
Log.i("SDL", "Downloading data to: '" + outFilesDir + "'");
|
||||
try {
|
||||
File outDir = new File( outFilesDir );
|
||||
if( !(outDir.exists() && outDir.isDirectory()) )
|
||||
if( !outDir.exists() )
|
||||
outDir.mkdirs();
|
||||
OutputStream out = new FileOutputStream( getOutFilePath(".nomedia") );
|
||||
out.flush();
|
||||
|
||||
Submodule project/jni/application/commandergenius/commandergenius updated: 2dc893395b...ee839fb2d3
@@ -7,10 +7,10 @@ AppName="Ninslash"
|
||||
AppFullName=ninslash.com
|
||||
|
||||
# Application version code (integer)
|
||||
AppVersionCode=02117
|
||||
AppVersionCode=02220
|
||||
|
||||
# Application user-visible version name (string)
|
||||
AppVersionName="0.2.1.17"
|
||||
AppVersionName="0.2.2.20"
|
||||
|
||||
# Specify path to download application data in zip archive in the form 'Description|URL|MirrorURL^Description2|URL2|MirrorURL2^...'
|
||||
# If you'll start Description with '!' symbol it will be enabled by default, other downloads should be selected by user from startup config menu
|
||||
@@ -21,10 +21,10 @@ AppVersionName="0.2.1.17"
|
||||
AppDataDownloadUrl="!!Game data|data.zip"
|
||||
|
||||
# Reset SDL config when updating application to the new version (y) / (n)
|
||||
ResetSdlConfigForThisVersion=y
|
||||
ResetSdlConfigForThisVersion=n
|
||||
|
||||
# Delete application data files when upgrading (specify file/dir paths separated by spaces)
|
||||
DeleteFilesOnUpgrade="libsdl-DownloadFinished-0.flag .ninslash/settings.cfg"
|
||||
DeleteFilesOnUpgrade="libsdl-DownloadFinished-0.flag"
|
||||
|
||||
# Here you may type readme text, which will be shown during startup. Format is:
|
||||
# Text in English, use \\\\n to separate lines (that's four backslashes)^de:Text in Deutsch^ru:Text in Russian^button:Button that will open some URL:http://url-to-open/
|
||||
@@ -226,7 +226,7 @@ TouchscreenKeysTheme=2
|
||||
RedefinedKeysGamepad="LCTRL M Q TAB SPACE MOUSE_LEFT MOUSE_RIGHT E SPACE E"
|
||||
|
||||
# How long to show startup menu button, in msec, 0 to disable startup menu
|
||||
StartupMenuButtonTimeout=3000
|
||||
StartupMenuButtonTimeout=0
|
||||
|
||||
# Menu items to hide from startup menu, available menu items:
|
||||
# SettingsMenu.OkButton SettingsMenu.DummyMenu SettingsMenu.MainMenu SettingsMenuMisc.DownloadConfig SettingsMenuMisc.OptionalDownloadConfig SettingsMenuMisc.AudioConfig SettingsMenuMisc.VideoSettingsConfig SettingsMenuMisc.ShowReadme SettingsMenuMisc.GyroscopeCalibration SettingsMenuMisc.CommandlineConfig SettingsMenuMisc.ResetToDefaultsConfig SettingsMenuMouse.MouseConfigMainMenu SettingsMenuMouse.DisplaySizeConfig SettingsMenuMouse.LeftClickConfig SettingsMenuMouse.RightClickConfig SettingsMenuMouse.AdditionalMouseConfig SettingsMenuMouse.JoystickMouseConfig SettingsMenuMouse.TouchPressureMeasurementTool SettingsMenuMouse.CalibrateTouchscreenMenu SettingsMenuKeyboard.KeyboardConfigMainMenu SettingsMenuKeyboard.ScreenKeyboardSizeConfig SettingsMenuKeyboard.ScreenKeyboardDrawSizeConfig SettingsMenuKeyboard.ScreenKeyboardThemeConfig SettingsMenuKeyboard.ScreenKeyboardTransparencyConfig SettingsMenuKeyboard.RemapHwKeysConfig SettingsMenuKeyboard.RemapScreenKbConfig SettingsMenuKeyboard.ScreenGesturesConfig SettingsMenuKeyboard.CustomizeScreenKbLayout SettingsMenuKeyboard.ScreenKeyboardAdvanced
|
||||
|
||||
Submodule project/jni/application/ninslash/src updated: 9b2cee79d1...58d9dd8655
@@ -15,7 +15,7 @@ export ARCH=$1
|
||||
[ -e openttd-$VER-$1/Makefile ] || {
|
||||
rm -f src/src/rev.cpp
|
||||
env PATH=$LOCAL_PATH/..:$PATH \
|
||||
env CLANG=1 ../setEnvironment-$1.sh sh -c "cd openttd-$VER-$1 && env ../src/configure --with-sdl --with-freetype --with-png --with-zlib --with-icu --with-libtimidity --with-lzo2=$LOCAL_PATH/../../../obj/local/$ARCH/liblzo2.so --prefix-dir='.' --data-dir='' --without-allegro --with-fontconfig --with-lzma --endian=LE"
|
||||
env CLANG=1 ../setEnvironment-$1.sh sh -c "cd openttd-$VER-$1 && env ../src/configure --with-sdl --with-freetype --with-png --with-zlib --with-icu --with-libtimidity='pkg-config libtimidity' --with-lzo2=$LOCAL_PATH/../../../obj/local/$ARCH/liblzo2.so --prefix-dir='.' --data-dir='' --without-allegro --with-fontconfig --with-lzma --endian=LE"
|
||||
} || exit 1
|
||||
|
||||
NCPU=4
|
||||
|
||||
Submodule project/jni/application/openttd/src updated: b394d53be8...6fe5779964
10
project/jni/application/supertux/readme.txt
Normal file
10
project/jni/application/supertux/readme.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
To compile Android version:
|
||||
1. Use Debian or Ubuntu or MacOsX. Windows is not supported, but you can try to use Bash shell on Windows 10.
|
||||
2. Install Android SDK: https://developer.android.com/studio/index.html#downloads
|
||||
3. Install Android NDK: https://developer.android.com/ndk/downloads/index.html
|
||||
4. Install Java and Ant: sudo apt-get install ant openjdk-8-jdk build-essential
|
||||
5. Download SDL Git repo: git clone https://github.com/pelya/commandergenius
|
||||
6. git submodule update --init --recursive project/jni/application/supertux/supertux
|
||||
7. ./build.sh supertux
|
||||
|
||||
You may also use source archive at https://sourceforge.net/projects/libsdl-android/files/apk/SuperTux/
|
||||
Submodule project/jni/application/vice/vice updated: 0b817c357e...9f2803c7ab
Submodule project/jni/boost/src updated: 5824acb451...bc9ea9d303
@@ -41,8 +41,6 @@ LOCAL_SRC_FILES := \
|
||||
src/gl/texture.c \
|
||||
src/gl/wrap/gl.c \
|
||||
src/gl/wrap/gles.c \
|
||||
src/gl/wrap/gles2.c \
|
||||
src/gl/wrap/glesext.c \
|
||||
src/gl/wrap/glstub.c \
|
||||
src/gl/math/eval.c \
|
||||
src/glx/hardext.c \
|
||||
|
||||
@@ -227,15 +227,28 @@ Initial Hardware test
|
||||
|
||||
##### LIBGL_NOVAOCACHE
|
||||
VAO Caching
|
||||
* 0 : Default, tr to cache vao to avoid memcpy in render list
|
||||
* 0 : Default, try to cache vao to avoid memcpy in render list
|
||||
* 1 : Don't cache VAO
|
||||
|
||||
##### LIBGL_VABGRA
|
||||
Vertex Array BGRA extension
|
||||
* 0 : Default, GL_ARB_vertex_array_bgra not exposed (still emulated)
|
||||
* 1 : Extension exposed may be faster in some cases (Arx Libertatis mainly)
|
||||
|
||||
----
|
||||
|
||||
Version history
|
||||
----
|
||||
|
||||
##### current version
|
||||
##### Current version
|
||||
* Added some optimisations for sequencial glBegin/glEnd blocks
|
||||
* Fixed many issue with Lights introduced with 0.9.4
|
||||
* Fixed Android build introduced with 0.9.4
|
||||
|
||||
##### 0.9.4
|
||||
* Fixed some extended functions (like glBlendFuncSeparate) not working inside list (fixing some issues with Batch mode)
|
||||
* Added back GL_TEXTURE_RECTANGLE_ARB handling (and using npot texture, even limited, if available)
|
||||
* Added tracking of Lights and Materials
|
||||
* Fixed (Added in fact) support for Multisampling on the GLX Context creation (a bit hacky, but seems to works)
|
||||
* Added LIBGL_NODOWNSAMPLING and associated Hint
|
||||
* Try to implement some caching on VAO to avoid some memcpy in renderlist (with a way to disable it just in case)
|
||||
|
||||
@@ -2,18 +2,16 @@
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
base=../src/
|
||||
gles1=$(ls -1 yml/*-1.1.yml | tr '\n' ',' | sed -e 's/,$//')
|
||||
if [ -e yml/gles-1.1-full.yml ]; then rm yml/gles-1.1-full.yml ;fi
|
||||
touch yml/gles-1.1-full.yml
|
||||
cat yml/*-1.1.yml >> yml/gles-1.1-full.yml
|
||||
gles1=$(ls -1 yml/*-1.1-full.yml | tr '\n' ',' | sed -e 's/,$//')
|
||||
gles=$(ls -1 yml/*es-1.1.yml | tr '\n' ',' | sed -e 's/,$//')
|
||||
glext=$(ls -1 yml/*ext-1.1.yml | tr '\n' ',' | sed -e 's/,$//')
|
||||
#gles2=$(ls -1 yml/*-2.0.yml | tr '\n' ',' | sed -e 's/,$//')
|
||||
|
||||
./gen.py "$gles" --ifndef USE_ES2 gleswrap.c.j2 gleswrap.c gles.h > "$base/gl/wrap/gles.c"
|
||||
./gen.py "$glext" --ifndef USE_ES2 glextwrap.c.j2 glextwrap.c gles.h > "$base/gl/wrap/glesext.c"
|
||||
./gen.py "$gles1" --ifndef USE_ES2 glwrap.h.j2 gleswrap.h ../gl.h > "$base/gl/wrap/gles.h"
|
||||
./gen.py "$gles1" --ifndef USE_ES2 glxfuncs.j2 glxfuncs.inc ../gl/gl.h > "$base/glx/glesfuncs.inc"
|
||||
#./gen.py "$gles" gleswrap.c.j2 gleswrap.c gles.h > "$base/gl/wrap/gles.c"
|
||||
#./gen.py "$glext" glextwrap.c.j2 glextwrap.c gles.h > "$base/gl/wrap/glesext.c"
|
||||
./gen.py "$gles1" gleswrap.c.j2 gleswrap.c gles.h > "$base/gl/wrap/gles.c"
|
||||
./gen.py "$gles1" glwrap.h.j2 gleswrap.h ../gl.h > "$base/gl/wrap/gles.h"
|
||||
./gen.py "$gles1" glxfuncs.j2 glxfuncs.inc ../gl/gl.h > "$base/glx/glesfuncs.inc"
|
||||
|
||||
#./gen.py "$gles2" --ifdef USE_ES2 gleswrap.c.j2 gles2wrap.c gles2.h > "$base/gl/wrap/gles2.c"
|
||||
#./gen.py "$gles2" --ifdef USE_ES2 glwrap.h.j2 gles2wrap.h ../gl.h > "$base/gl/wrap/gles2.h"
|
||||
#./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" &
|
||||
|
||||
@@ -91,6 +91,11 @@ def gen(files, template, guard_name, headers,
|
||||
else:
|
||||
ret = 'void'
|
||||
|
||||
loadlib = 'LOAD_GLES'
|
||||
if name.endswith('_OES_'):
|
||||
loadlib = 'LOAD_GLES_OES'
|
||||
name = name[:-5]
|
||||
|
||||
args = [split_arg(arg) for arg in args if not arg == 'void']
|
||||
if any(arg.get('type') == 'unknown' for arg in args):
|
||||
continue
|
||||
@@ -112,6 +117,7 @@ def gen(files, template, guard_name, headers,
|
||||
'args': args,
|
||||
'types': types,
|
||||
'void': ret == 'void',
|
||||
'loadlib': loadlib,
|
||||
})
|
||||
if not types in unique_formats:
|
||||
unique_formats.add(types)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
{% include "base/headers.j2" %}
|
||||
{% for func in functions %}
|
||||
{% block definition scoped %}
|
||||
{{ func.return }} glshim_{{ func.name }}({{ func.args|args }}) {
|
||||
{{ func.return }} gl4es_{{ func.name }}({{ func.args|args }}) {
|
||||
{% block load scoped %}{% endblock %}
|
||||
{% block call scoped %}
|
||||
{% if not func.void %}return {% endif %}{% block prefix %}wrap{% endblock %}_{{ func.name }}({{ func.args|args(0) }});
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#endif
|
||||
{% endblock %}
|
||||
{% block load %}
|
||||
LOAD_GLES({{ func.name }});
|
||||
{{ func.loadlib }}({{ func.name }});
|
||||
{% endblock %}
|
||||
{% block call %}
|
||||
#ifndef direct_{{ func.name }}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#endif
|
||||
{% endblock %}
|
||||
{% block load %}
|
||||
LOAD_GLES_OES({{ func.name }});
|
||||
{{ func.loadlib }}({{ func.name }});
|
||||
{% endblock %}
|
||||
{% block call %}
|
||||
#ifndef direct_{{ func.name }}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#define push_{{ func.name }}({{ func.args|args(0) }}) { \
|
||||
{{ func.name }}_PACKED *packed_data = malloc(sizeof({{ func.name }}_PACKED)); \
|
||||
packed_data->format = {{ func.name }}_FORMAT; \
|
||||
packed_data->func = glshim_{{ func.name }}; \
|
||||
packed_data->func = gl4es_{{ func.name }}; \
|
||||
{% if func.args %}
|
||||
{% for arg in func.args %}
|
||||
packed_data->args.a{{ loop.index }} = ({{ arg.type|unconst }}){{ arg.name }}; \
|
||||
|
||||
@@ -1,30 +1,30 @@
|
||||
glBlendColor: [void, GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha]
|
||||
glBlendEquation: [void, GLenum mode]
|
||||
glBlendEquationSeparate: [void, GLenum modeRGB, GLenum modeA]
|
||||
glBlendFuncSeparate: [void, GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha]
|
||||
# glTexGenfOES: [void, GLenum coord, GLenum pname, GLfloat param]
|
||||
glTexGenfv: [void, GLenum coord, GLenum pname, "const GLfloat *params"]
|
||||
glTexGeni: [void, GLenum coord, GLenum pname, GLint param]
|
||||
# glTexGenivOES: [void, GLenum coord, GLenum pname, "const GLint *params"]
|
||||
glBlendColor_OES_: [void, GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha]
|
||||
glBlendEquation_OES_: [void, GLenum mode]
|
||||
glBlendEquationSeparate_OES_: [void, GLenum modeRGB, GLenum modeA]
|
||||
glBlendFuncSeparate_OES_: [void, GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha]
|
||||
# glTexGenfOES_OES_: [void, GLenum coord, GLenum pname, GLfloat param]
|
||||
glTexGenfv_OES_: [void, GLenum coord, GLenum pname, "const GLfloat *params"]
|
||||
glTexGeni_OES_: [void, GLenum coord, GLenum pname, GLint param]
|
||||
# glTexGenivOES_OES_: [void, GLenum coord, GLenum pname, "const GLint *params"]
|
||||
|
||||
glGenFramebuffers: [void, GLsizei n, "GLuint *ids"]
|
||||
glDeleteFramebuffers: [void, GLsizei n, "GLuint *framebuffers"]
|
||||
glIsFramebuffer: [GLboolean, GLuint framebuffer]
|
||||
glCheckFramebufferStatus: [GLenum, GLenum target]
|
||||
glBindFramebuffer: [void, GLenum target, GLuint framebuffer]
|
||||
glFramebufferTexture2D: [void, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level]
|
||||
glGenRenderbuffers: [void, GLsizei n, "GLuint *renderbuffers"]
|
||||
glFramebufferRenderbuffer: [void, GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer]
|
||||
glDeleteRenderbuffers: [void, GLsizei n, "GLuint *renderbuffers"]
|
||||
glRenderbufferStorage: [void, GLenum target, GLenum internalformat, GLsizei width, GLsizei height]
|
||||
glBindRenderbuffer: [void, GLenum target, GLuint renderbuffer]
|
||||
glIsRenderbuffer: [GLboolean, GLuint renderbuffer]
|
||||
glGenerateMipmap: [void, GLenum target]
|
||||
glGetFramebufferAttachmentParameteriv: [void, GLenum target, GLenum attachment, GLenum pname, "GLint *params"]
|
||||
glGetRenderbufferParameteriv: [void, GLenum target, GLenum pname, "GLint * params"]
|
||||
glGenFramebuffers_OES_: [void, GLsizei n, "GLuint *ids"]
|
||||
glDeleteFramebuffers_OES_: [void, GLsizei n, "GLuint *framebuffers"]
|
||||
glIsFramebuffer_OES_: [GLboolean, GLuint framebuffer]
|
||||
glCheckFramebufferStatus_OES_: [GLenum, GLenum target]
|
||||
glBindFramebuffer_OES_: [void, GLenum target, GLuint framebuffer]
|
||||
glFramebufferTexture2D_OES_: [void, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level]
|
||||
glGenRenderbuffers_OES_: [void, GLsizei n, "GLuint *renderbuffers"]
|
||||
glFramebufferRenderbuffer_OES_: [void, GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer]
|
||||
glDeleteRenderbuffers_OES_: [void, GLsizei n, "GLuint *renderbuffers"]
|
||||
glRenderbufferStorage_OES_: [void, GLenum target, GLenum internalformat, GLsizei width, GLsizei height]
|
||||
glBindRenderbuffer_OES_: [void, GLenum target, GLuint renderbuffer]
|
||||
glIsRenderbuffer_OES_: [GLboolean, GLuint renderbuffer]
|
||||
glGenerateMipmap_OES_: [void, GLenum target]
|
||||
glGetFramebufferAttachmentParameteriv_OES_: [void, GLenum target, GLenum attachment, GLenum pname, "GLint *params"]
|
||||
glGetRenderbufferParameteriv_OES_: [void, GLenum target, GLenum pname, "GLint * params"]
|
||||
|
||||
glDrawTexi: [void, GLint x, GLint y, GLint z, GLint width, GLint height]
|
||||
glDrawTexf: [void, GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height]
|
||||
glDrawTexi_OES_: [void, GLint x, GLint y, GLint z, GLint width, GLint height]
|
||||
glDrawTexf_OES_: [void, GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height]
|
||||
|
||||
glMultiDrawArrays: [void, GLenum mode, "const GLint *first", "const GLsizei *count", GLsizei primcount]
|
||||
glMultiDrawElements: [void, GLenum mode, "GLsizei *count", GLenum type, "const void * const *indices", GLsizei primcount]
|
||||
glMultiDrawArrays_OES_: [void, GLenum mode, "const GLint *first", "const GLsizei *count", GLsizei primcount]
|
||||
glMultiDrawElements_OES_: [void, GLenum mode, "GLsizei *count", GLenum type, "const void * const *indices", GLsizei primcount]
|
||||
|
||||
@@ -28,8 +28,6 @@ SET(GL_SRC
|
||||
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
|
||||
)
|
||||
@@ -67,7 +65,6 @@ SET(GL_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
|
||||
|
||||
@@ -15,8 +15,6 @@
|
||||
#define skip_glDisable
|
||||
#define skip_glEnable
|
||||
#define skip_glIsEnabled
|
||||
#define skip_glMaterialfv
|
||||
#define skip_glMaterialf
|
||||
#define skip_glNormal3f
|
||||
|
||||
#define skip_glBindBuffer
|
||||
@@ -51,6 +49,8 @@
|
||||
#define skip_glGetIntegerv
|
||||
#define skip_glGetFloatv
|
||||
#define skip_glGetString
|
||||
#define skip_glGetLightfv
|
||||
#define skip_glGetMaterialfv
|
||||
|
||||
// hint.c
|
||||
#define skip_glHint
|
||||
@@ -60,6 +60,8 @@
|
||||
#define skip_glLightModelfv
|
||||
#define skip_glLightfv
|
||||
#define skip_glLightf
|
||||
#define skip_glMaterialfv
|
||||
#define skip_glMaterialf
|
||||
|
||||
// raster.c
|
||||
#define skip_glViewport
|
||||
@@ -139,6 +141,9 @@
|
||||
// MultiDrawArrays
|
||||
#define skip_glMultiDrawArrays
|
||||
#define skip_glMultiDrawElements
|
||||
// this is to avoid a warning. I don't Push those anyway
|
||||
#define direct_glMultiDrawArrays
|
||||
#define direct_glMultiDrawElements
|
||||
|
||||
// don't compile these into display lists
|
||||
#define direct_glColorPointer
|
||||
@@ -146,7 +151,7 @@
|
||||
#define direct_glDisableClientState
|
||||
#define direct_glEdgeFlagPointer
|
||||
#define direct_glEnableClientState
|
||||
#define direct_glClientActiveTexture
|
||||
//#define direct_glClientActiveTexture // will use it in Batch mode
|
||||
#define direct_glFeedbackBuffer
|
||||
#define direct_glGenLists
|
||||
#define direct_glIndexPointer
|
||||
|
||||
@@ -69,9 +69,8 @@ void gl4es_glGenBuffers(GLsizei n, GLuint * buffers) {
|
||||
|
||||
void gl4es_glBindBuffer(GLenum target, GLuint buffer) {
|
||||
//printf("glBindBuffer(%s, %u)\n", PrintEnum(target), buffer);
|
||||
if (glstate->gl_batch) {
|
||||
if (glstate->gl_batch || glstate->list.pending)
|
||||
flush();
|
||||
}
|
||||
|
||||
khint_t k;
|
||||
int ret;
|
||||
@@ -162,9 +161,8 @@ void gl4es_glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, cons
|
||||
|
||||
void gl4es_glDeleteBuffers(GLsizei n, const GLuint * buffers) {
|
||||
//printf("glDeleteBuffers(%i, %p)\n", n, buffers);
|
||||
if (glstate->gl_batch) {
|
||||
if (glstate->gl_batch || glstate->list.pending)
|
||||
flush();
|
||||
}
|
||||
|
||||
VaoSharedClear(glstate->vao);
|
||||
khash_t(buff) *list = glstate->buffers;
|
||||
@@ -272,6 +270,10 @@ void *gl4es_glMapBuffer(GLenum target, GLenum access) {
|
||||
|
||||
GLboolean gl4es_glUnmapBuffer(GLenum target) {
|
||||
//printf("glUnmapBuffer(%s)\n", PrintEnum(target));
|
||||
if(glstate->list.compiling) {errorShim(GL_INVALID_OPERATION); return GL_FALSE;}
|
||||
if(glstate->list.active)
|
||||
flush();
|
||||
|
||||
if (!buffer_target(target)) {
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
return GL_FALSE;
|
||||
@@ -368,9 +370,8 @@ void gl4es_glGenVertexArrays(GLsizei n, GLuint *arrays) {
|
||||
}
|
||||
void gl4es_glBindVertexArray(GLuint array) {
|
||||
//printf("glBindVertexArray(%u)\n", array);
|
||||
if (glstate->gl_batch) {
|
||||
if (glstate->gl_batch || glstate->list.pending)
|
||||
flush();
|
||||
}
|
||||
|
||||
khint_t k;
|
||||
int ret;
|
||||
@@ -412,9 +413,9 @@ void gl4es_glBindVertexArray(GLuint array) {
|
||||
}
|
||||
void gl4es_glDeleteVertexArrays(GLsizei n, const GLuint *arrays) {
|
||||
//printf("glDeleteVertexArrays(%i, %p)\n", n, arrays);
|
||||
if (glstate->gl_batch) {
|
||||
if (glstate->gl_batch || glstate->list.pending)
|
||||
flush();
|
||||
}
|
||||
|
||||
khash_t(glvao) *list = glstate->vaos;
|
||||
if (list) {
|
||||
khint_t k;
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
#define GL_QUAD_STRIP 8
|
||||
#define GL_POLYGON 9
|
||||
|
||||
#define GL_MAJOR_VERSION 0x821B
|
||||
#define GL_MINOR_VERSION 0x821C
|
||||
/* texture mapping */
|
||||
#define GL_TEXTURE_ENV 0x2300
|
||||
#define GL_TEXTURE_ENV_MODE 0x2200
|
||||
@@ -10,6 +12,7 @@
|
||||
#define GL_TEXTURE_3D 0x806F
|
||||
#define GL_TEXTURE_WRAP_S 0x2802
|
||||
#define GL_TEXTURE_WRAP_T 0x2803
|
||||
#define GL_TEXTURE_WRAP_R 0x8072
|
||||
#define GL_TEXTURE_MAG_FILTER 0x2800
|
||||
#define GL_TEXTURE_MIN_FILTER 0x2801
|
||||
#define GL_TEXTURE_ENV_COLOR 0x2201
|
||||
|
||||
@@ -135,6 +135,30 @@ const char* PrintEnum(GLenum what) {
|
||||
p(GL_PROJECTION);
|
||||
p(GL_MODELVIEW);
|
||||
p(GL_TEXTURE);
|
||||
// blend
|
||||
p(GL_SRC_ALPHA);
|
||||
p(GL_DST_ALPHA);
|
||||
p(GL_ONE_MINUS_SRC_ALPHA);
|
||||
p(GL_ONE_MINUS_DST_ALPHA);
|
||||
// lights
|
||||
p(GL_LIGHT0);
|
||||
p(GL_LIGHT1);
|
||||
p(GL_LIGHT2);
|
||||
p(GL_LIGHT3);
|
||||
p(GL_LIGHT4);
|
||||
p(GL_LIGHT5);
|
||||
p(GL_LIGHT6);
|
||||
p(GL_LIGHT7);
|
||||
p(GL_AMBIENT);
|
||||
p(GL_DIFFUSE);
|
||||
p(GL_SPECULAR);
|
||||
p(GL_POSITION);
|
||||
p(GL_SPOT_DIRECTION);
|
||||
p(GL_SPOT_EXPONENT);
|
||||
p(GL_SPOT_CUTOFF);
|
||||
p(GL_CONSTANT_ATTENUATION);
|
||||
p(GL_LINEAR_ATTENUATION);
|
||||
p(GL_QUADRATIC_ATTENUATION);
|
||||
default:
|
||||
sprintf(fallback, "0x%04X", what);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "texgen.h"
|
||||
#include "../glx/hardext.h"
|
||||
#include "gl4eshint.h"
|
||||
#include "light.h"
|
||||
|
||||
GLenum gl4es_glGetError() {
|
||||
LOAD_GLES(glGetError);
|
||||
@@ -99,10 +100,11 @@ const GLubyte *gl4es_glGetString(GLenum name) {
|
||||
"GL_EXT_texture_object "
|
||||
"GL_EXT_polygon_offset "
|
||||
"GL_GL4ES_hint "
|
||||
"GL_ARB_vertex_array_bgra "
|
||||
"GL_ARB_texture_rectangle "
|
||||
// "GL_EXT_blend_logic_op "
|
||||
// "GL_ARB_texture_cube_map "
|
||||
);
|
||||
if(globals4es.vabgra)
|
||||
strcat(extensions, "GL_ARB_vertex_array_bgra ");
|
||||
if(globals4es.npot>=1)
|
||||
strcat(extensions, "GL_APPLE_texture_2D_limited_npot ");
|
||||
if(globals4es.npot>=2)
|
||||
@@ -159,6 +161,12 @@ void gl4es_glGetIntegerv(GLenum pname, GLint *params) {
|
||||
if (glstate->list.active && (glstate->gl_batch && !glstate->list.compiling)) flush();
|
||||
noerrorShim();
|
||||
switch (pname) {
|
||||
case GL_MAJOR_VERSION:
|
||||
*params = 1;
|
||||
break;
|
||||
case GL_MINOR_VERSION:
|
||||
*params = 5;
|
||||
break;
|
||||
case GL_MAX_ELEMENTS_INDICES:
|
||||
*params = 1024;
|
||||
break;
|
||||
@@ -295,6 +303,16 @@ void gl4es_glGetIntegerv(GLenum pname, GLint *params) {
|
||||
case GL_MATRIX_MODE:
|
||||
*params=glstate->matrix_mode;
|
||||
break;
|
||||
case GL_LIGHT_MODEL_TWO_SIDE:
|
||||
*params=glstate->light.two_side;
|
||||
break;
|
||||
case GL_LIGHT_MODEL_AMBIENT:
|
||||
for (dummy=0; dummy<4; dummy++)
|
||||
params[dummy]=glstate->light.ambient[dummy];
|
||||
break;
|
||||
case GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB:
|
||||
*params=hardext.maxsize;
|
||||
break;
|
||||
case GL_SHRINK_HINT_GL4ES:
|
||||
*params=globals4es.texshrink;
|
||||
break;
|
||||
@@ -337,6 +355,12 @@ void gl4es_glGetFloatv(GLenum pname, GLfloat *params) {
|
||||
if (glstate->list.active && (glstate->gl_batch && !glstate->list.compiling)) flush();
|
||||
noerrorShim();
|
||||
switch (pname) {
|
||||
case GL_MAJOR_VERSION:
|
||||
*params = 1;
|
||||
break;
|
||||
case GL_MINOR_VERSION:
|
||||
*params = 5;
|
||||
break;
|
||||
case GL_MAX_ELEMENTS_INDICES:
|
||||
*params = 1024;
|
||||
break;
|
||||
@@ -459,6 +483,15 @@ void gl4es_glGetFloatv(GLenum pname, GLfloat *params) {
|
||||
case GL_TEXTURE_MATRIX:
|
||||
memcpy(params, TOP(texture_matrix[glstate->texture.active]), 16*sizeof(GLfloat));
|
||||
break;
|
||||
case GL_LIGHT_MODEL_TWO_SIDE:
|
||||
*params=glstate->light.two_side;
|
||||
break;
|
||||
case GL_LIGHT_MODEL_AMBIENT:
|
||||
memcpy(params, glstate->light.ambient, 4*sizeof(GLfloat));
|
||||
break;
|
||||
case GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB:
|
||||
*params=hardext.maxsize;
|
||||
break;
|
||||
case GL_SHRINK_HINT_GL4ES:
|
||||
*params=globals4es.texshrink;
|
||||
break;
|
||||
@@ -498,3 +531,103 @@ void gl4es_glGetFloatv(GLenum pname, GLfloat *params) {
|
||||
}
|
||||
}
|
||||
void glGetFloatv(GLenum pname, GLfloat *params) AliasExport("gl4es_glGetFloatv");
|
||||
|
||||
void gl4es_glGetLightfv(GLenum light, GLenum pname, GLfloat * params) {
|
||||
const int nl = light-GL_LIGHT0;
|
||||
if(nl<0 || nl>=hardext.maxlights) {
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
return;
|
||||
}
|
||||
switch(pname) {
|
||||
case GL_AMBIENT:
|
||||
memcpy(params, glstate->light.lights[nl].ambient, 4*sizeof(GLfloat));
|
||||
break;
|
||||
case GL_DIFFUSE:
|
||||
memcpy(params, glstate->light.lights[nl].diffuse, 4*sizeof(GLfloat));
|
||||
break;
|
||||
case GL_SPECULAR:
|
||||
memcpy(params, glstate->light.lights[nl].specular, 4*sizeof(GLfloat));
|
||||
break;
|
||||
case GL_POSITION:
|
||||
memcpy(params, glstate->light.lights[nl].position, 4*sizeof(GLfloat));
|
||||
break;
|
||||
case GL_SPOT_DIRECTION:
|
||||
memcpy(params, glstate->light.lights[nl].spotDirection, 3*sizeof(GLfloat));
|
||||
break;
|
||||
case GL_SPOT_EXPONENT:
|
||||
params[0] = glstate->light.lights[nl].spotExponent;
|
||||
break;
|
||||
case GL_SPOT_CUTOFF:
|
||||
params[0] = glstate->light.lights[nl].spotCutoff;
|
||||
break;
|
||||
case GL_CONSTANT_ATTENUATION:
|
||||
params[0] = glstate->light.lights[nl].constantAttenuation;
|
||||
break;
|
||||
case GL_LINEAR_ATTENUATION:
|
||||
params[0] = glstate->light.lights[nl].linearAttenuation;
|
||||
break;
|
||||
case GL_QUADRATIC_ATTENUATION:
|
||||
params[0] = glstate->light.lights[nl].quadraticAttenuation;
|
||||
break;
|
||||
default:
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
return;
|
||||
}
|
||||
noerrorShim();
|
||||
}
|
||||
void glGetLightfv(GLenum pname, GLfloat *params) AliasExport("gl4es_glGetLightfv");
|
||||
|
||||
void gl4es_glGetMaterialfv(GLenum face, GLenum pname, GLfloat * params) {
|
||||
if(face!=GL_FRONT && face!=GL_BACK) {
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
return;
|
||||
}
|
||||
switch(pname) {
|
||||
case GL_AMBIENT:
|
||||
if(face==GL_FRONT)
|
||||
memcpy(params, glstate->material.front.ambient, 4*sizeof(GLfloat));
|
||||
if(face==GL_BACK)
|
||||
memcpy(params, glstate->material.back.ambient, 4*sizeof(GLfloat));
|
||||
break;
|
||||
case GL_DIFFUSE:
|
||||
if(face==GL_FRONT)
|
||||
memcpy(params, glstate->material.front.diffuse, 4*sizeof(GLfloat));
|
||||
if(face==GL_BACK)
|
||||
memcpy(params, glstate->material.back.diffuse, 4*sizeof(GLfloat));
|
||||
break;
|
||||
case GL_SPECULAR:
|
||||
if(face==GL_FRONT)
|
||||
memcpy(params, glstate->material.front.specular, 4*sizeof(GLfloat));
|
||||
if(face==GL_BACK)
|
||||
memcpy(params, glstate->material.back.specular, 4*sizeof(GLfloat));
|
||||
break;
|
||||
case GL_EMISSION:
|
||||
if(face==GL_FRONT)
|
||||
memcpy(params, glstate->material.front.emission, 4*sizeof(GLfloat));
|
||||
if(face==GL_BACK)
|
||||
memcpy(params, glstate->material.back.emission, 4*sizeof(GLfloat));
|
||||
break;
|
||||
case GL_SHININESS:
|
||||
if(face==GL_FRONT)
|
||||
*params = glstate->material.front.shininess;
|
||||
if(face==GL_BACK)
|
||||
*params = glstate->material.back.shininess;
|
||||
break;
|
||||
case GL_COLOR_INDEXES:
|
||||
if(face==GL_FRONT) {
|
||||
params[0] = glstate->material.front.indexes[0];
|
||||
params[1] = glstate->material.front.indexes[1];
|
||||
params[2] = glstate->material.front.indexes[2];
|
||||
}
|
||||
if(face==GL_BACK) {
|
||||
params[0] = glstate->material.back.indexes[0];
|
||||
params[1] = glstate->material.back.indexes[1];
|
||||
params[2] = glstate->material.back.indexes[2];
|
||||
}
|
||||
default:
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
return;
|
||||
}
|
||||
noerrorShim();
|
||||
}
|
||||
void glGetMaterialfv(GLenum face, GLenum pname, GLfloat * params) AliasExport("gl4es_glGetMaterialfv");
|
||||
@@ -20,7 +20,7 @@ void* NewGLState(void* shared_glstate) {
|
||||
memset(glstate, 0, sizeof(glstate_t));
|
||||
memcpy(glstate->color, white, sizeof(GLfloat)*4);
|
||||
glstate->last_error = GL_NO_ERROR;
|
||||
glstate->normal[3] = 1.0f; // default normal is 0/0/1
|
||||
glstate->normal[2] = 1.0f; // default normal is 0/0/1
|
||||
glstate->matrix_mode = GL_MODELVIEW;
|
||||
|
||||
// add default VBO
|
||||
@@ -66,6 +66,35 @@ void* NewGLState(void* shared_glstate) {
|
||||
// init the matrix tracking
|
||||
init_matrix(glstate);
|
||||
|
||||
// init the light tracking
|
||||
glstate->light.ambient[0]=glstate->light.ambient[1]=glstate->light.ambient[2]=0.2f;
|
||||
glstate->light.ambient[3]=1.0f;
|
||||
glstate->light.lights[0].diffuse[0]=
|
||||
glstate->light.lights[0].diffuse[1]=
|
||||
glstate->light.lights[0].diffuse[2]=
|
||||
glstate->light.lights[0].diffuse[3]=1.0f;
|
||||
memcpy(glstate->light.lights[0].specular, glstate->light.lights[0].diffuse, 4*sizeof(GLfloat));
|
||||
for (int i=0; i<hardext.maxlights; i++) {
|
||||
glstate->light.lights[i].ambient[3] = 1.0f;
|
||||
glstate->light.lights[i].position[2] = 1.0f;
|
||||
glstate->light.lights[i].spotDirection[2] = -1.0f;
|
||||
glstate->light.lights[i].spotCutoff = 180;
|
||||
glstate->light.lights[i].constantAttenuation = 1;
|
||||
}
|
||||
// Materials
|
||||
glstate->material.front.ambient[0] =
|
||||
glstate->material.front.ambient[1] =
|
||||
glstate->material.front.ambient[2] = 0.2f;
|
||||
glstate->material.front.ambient[3] = 1.0f;
|
||||
glstate->material.front.diffuse[0] =
|
||||
glstate->material.front.diffuse[1] =
|
||||
glstate->material.front.diffuse[2] = 0.8f;
|
||||
glstate->material.front.diffuse[3] = 1.0f;
|
||||
glstate->material.front.specular[3] = 1.0f;
|
||||
glstate->material.front.emission[3] = 1.0f;
|
||||
glstate->material.front.colormat = GL_AMBIENT_AND_DIFFUSE;
|
||||
memcpy(&glstate->material.back, &glstate->material.front, sizeof(material_t));
|
||||
|
||||
for(int i=0; i<4; i++)
|
||||
glstate->raster.raster_scale[i] = 1.0f;
|
||||
LOAD_GLES(glGetFloatv);
|
||||
@@ -235,6 +264,12 @@ static void proxy_glEnable(GLenum cap, bool enable, void (*next)(GLenum)) {
|
||||
else
|
||||
glstate->enable.texture[glstate->texture.active] &= ~(1<<ENABLED_TEX3D);
|
||||
break;
|
||||
case GL_TEXTURE_RECTANGLE_ARB:
|
||||
if(enable)
|
||||
glstate->enable.texture[glstate->texture.active] |= (1<<ENABLED_TEXTURE_RECTANGLE);
|
||||
else
|
||||
glstate->enable.texture[glstate->texture.active] &= ~(1<<ENABLED_TEXTURE_RECTANGLE);
|
||||
break;
|
||||
case GL_TEXTURE_CUBE_MAP:
|
||||
if(enable)
|
||||
glstate->enable.texture[glstate->texture.active] |= (1<<ENABLED_CUBE_MAP);
|
||||
@@ -313,8 +348,9 @@ void gl4es_glDisable(GLenum cap) {
|
||||
void glDisable(GLenum cap) AliasExport("gl4es_glDisable");
|
||||
|
||||
void gl4es_glEnableClientState(GLenum cap) {
|
||||
ERROR_IN_BEGIN
|
||||
// should flush for now... to be optimized later!
|
||||
if (glstate->list.active && (glstate->gl_batch && !glstate->list.compiling))
|
||||
if (glstate->list.active && !glstate->list.compiling)
|
||||
flush();
|
||||
LOAD_GLES(glEnableClientState);
|
||||
proxy_glEnable(cap, true, gles_glEnableClientState);
|
||||
@@ -322,8 +358,9 @@ void gl4es_glEnableClientState(GLenum cap) {
|
||||
void glEnableClientState(GLenum cap) AliasExport("gl4es_glEnableClientState");
|
||||
|
||||
void gl4es_glDisableClientState(GLenum cap) {
|
||||
ERROR_IN_BEGIN
|
||||
// should flush for now... to be optimized later!
|
||||
if (glstate->list.active && (glstate->gl_batch && !glstate->list.compiling))
|
||||
if (glstate->list.active && !glstate->list.compiling)
|
||||
flush();
|
||||
LOAD_GLES(glDisableClientState);
|
||||
proxy_glEnable(cap, false, gles_glDisableClientState);
|
||||
@@ -337,8 +374,10 @@ void glDisableClientState(GLenum cap) AliasExport("gl4es_glDisableClientState");
|
||||
case what: return glstate->vao->where
|
||||
|
||||
GLboolean gl4es_glIsEnabled(GLenum cap) {
|
||||
if(glstate->list.begin) {errorShim(GL_INVALID_OPERATION); return GL_FALSE;}
|
||||
if(glstate->list.compiling) {errorShim(GL_INVALID_OPERATION); return GL_FALSE;}
|
||||
// should flush for now... to be optimized later!
|
||||
if (glstate->list.active && (glstate->gl_batch && !glstate->list.compiling))
|
||||
if (glstate->list.active)
|
||||
flush();
|
||||
LOAD_GLES(glIsEnabled);
|
||||
noerrorShim();
|
||||
@@ -517,7 +556,7 @@ static inline bool should_intercept_render(GLenum mode) {
|
||||
return (
|
||||
(glstate->vao->vertex_array && ! valid_vertex_type(glstate->vao->pointers.vertex.type)) ||
|
||||
(mode == GL_LINES && glstate->enable.line_stipple) ||
|
||||
/*(mode == GL_QUADS) ||*/ (glstate->list.active && (glstate->list.compiling || glstate->gl_batch))
|
||||
/*(mode == GL_QUADS) ||*/ (glstate->list.active)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -525,6 +564,8 @@ void gl4es_glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid
|
||||
//printf("glDrawElements(%s, %d, %s, %p), vtx=%p map=%p\n", PrintEnum(mode), count, PrintEnum(type), indices, (glstate->vao->vertex)?glstate->vao->vertex->data:NULL, (glstate->vao->elements)?glstate->vao->elements->data:NULL);
|
||||
// TODO: split for count > 65535?
|
||||
// special check for QUADS and TRIANGLES that need multiple of 4 or 3 vertex...
|
||||
if(glstate->list.active && !glstate->list.compiling && glstate->gl_batch)
|
||||
flush();
|
||||
if (mode == GL_QUADS) while(count%4) count--;
|
||||
else if (mode == GL_TRIANGLES) while(count%3) count--;
|
||||
|
||||
@@ -545,7 +586,7 @@ void gl4es_glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid
|
||||
type, 1, 0, GL_UNSIGNED_SHORT, 1, 0, count);
|
||||
else
|
||||
sindices = (glstate->vao->elements)?(glstate->vao->elements->data + (uintptr_t)indices):(GLvoid*)indices;
|
||||
bool compiling = (glstate->list.active && (glstate->list.compiling || glstate->gl_batch));
|
||||
bool compiling = (glstate->list.active);
|
||||
|
||||
if (compiling) {
|
||||
renderlist_t *list = NULL;
|
||||
@@ -648,7 +689,7 @@ void gl4es_glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid
|
||||
// get 1st enabled target
|
||||
const GLint itarget = get_target(glstate->enable.texture[aa]);
|
||||
if (itarget>=0) {
|
||||
if (itarget==ENABLED_TEX1D || itarget==ENABLED_TEX3D) {
|
||||
if (!IS_TEX2D(glstate->enable.texture[aa]) && (IS_ANYTEX(glstate->enable.texture[aa]))) {
|
||||
TEXTURE(aa);
|
||||
gles_glEnable(GL_TEXTURE_2D);
|
||||
}
|
||||
@@ -686,6 +727,8 @@ void gl4es_glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid
|
||||
void glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices) AliasExport("gl4es_glDrawElements");
|
||||
|
||||
void gl4es_glDrawArrays(GLenum mode, GLint first, GLsizei count) {
|
||||
if(glstate->list.active && !glstate->list.compiling && glstate->gl_batch)
|
||||
flush();
|
||||
// special check for QUADS and TRIANGLES that need multiple of 4 or 3 vertex...
|
||||
if (mode == GL_QUADS) while(count%4) count--;
|
||||
else if (mode == GL_TRIANGLES) while(count%3) count--;
|
||||
@@ -719,7 +762,7 @@ void gl4es_glDrawArrays(GLenum mode, GLint first, GLsizei count) {
|
||||
LOAD_GLES(glDisableClientState);
|
||||
LOAD_GLES(glMultiTexCoord4f);
|
||||
|
||||
if (glstate->list.active && (glstate->list.compiling || glstate->gl_batch)) {
|
||||
if (glstate->list.active) {
|
||||
NewStage(glstate->list.active, STAGE_DRAW);
|
||||
glstate->list.active = arrays_to_renderlist(glstate->list.active, mode, first, count+first);
|
||||
glstate->list.active = extend_renderlist(glstate->list.active);
|
||||
@@ -795,7 +838,7 @@ void gl4es_glDrawArrays(GLenum mode, GLint first, GLsizei count) {
|
||||
// get 1st enabled target
|
||||
const GLint itarget = get_target(glstate->enable.texture[aa]);
|
||||
if(itarget>=0) {
|
||||
if (itarget==ENABLED_TEX1D || itarget==ENABLED_TEX3D) {
|
||||
if (itarget==ENABLED_TEX1D || itarget==ENABLED_TEX3D || itarget==ENABLED_TEXTURE_RECTANGLE) {
|
||||
TEXTURE(aa);
|
||||
gles_glEnable(GL_TEXTURE_2D);
|
||||
}
|
||||
@@ -817,7 +860,8 @@ void gl4es_glDrawArrays(GLenum mode, GLint first, GLsizei count) {
|
||||
gles_glDrawArrays(mode, first, count);
|
||||
|
||||
for (int aa=0; aa<hardext.maxtex; aa++) {
|
||||
if (!IS_TEX2D(glstate->enable.texture[aa]) && (IS_ANYTEX(glstate->enable.texture[aa]))) {
|
||||
const GLint itarget = get_target(glstate->enable.texture[aa]);
|
||||
if (itarget==ENABLED_TEX1D || itarget==ENABLED_TEX3D || itarget==ENABLED_TEXTURE_RECTANGLE) {
|
||||
TEXTURE(aa);
|
||||
gles_glDisable(GL_TEXTURE_2D);
|
||||
}
|
||||
@@ -983,9 +1027,12 @@ void glInterleavedArrays(GLenum format, GLsizei stride, const GLvoid *pointer) A
|
||||
|
||||
// immediate mode functions
|
||||
void gl4es_glBegin(GLenum mode) {
|
||||
glstate->list.begin = 1;
|
||||
glstate->list.pending = 0;
|
||||
if (!glstate->list.active)
|
||||
glstate->list.active = alloc_renderlist();
|
||||
NewStage(glstate->list.active, STAGE_DRAW);
|
||||
// small optim... continue a render command if possible
|
||||
NewDrawStage(glstate->list.active, mode);
|
||||
glstate->list.active->mode = mode;
|
||||
glstate->list.active->mode_init = mode;
|
||||
noerrorShim(); // TODO, check Enum validity
|
||||
@@ -994,19 +1041,24 @@ void glBegin(GLenum mode) AliasExport("gl4es_glBegin");
|
||||
|
||||
void gl4es_glEnd() {
|
||||
if (!glstate->list.active) return;
|
||||
glstate->list.begin = 0;
|
||||
// check if TEXTUREx is activate and no TexCoord (or texgen), in that case, create a dummy one base on glstate->..
|
||||
for (int a=0; a<MAX_TEX; a++)
|
||||
if (glstate->enable.texture[a] && ((glstate->list.active->tex[a]==0) && !(glstate->enable.texgen_s[a] || glstate->texture.pscoordreplace[a])))
|
||||
rlMultiTexCoord4f(glstate->list.active, GL_TEXTURE0+a, glstate->texcoord[a][0], glstate->texcoord[a][1], glstate->texcoord[a][2], glstate->texcoord[a][3]);
|
||||
// render if we're not in a display list
|
||||
if (!(glstate->list.compiling || glstate->gl_batch)) {
|
||||
if (!(glstate->list.compiling || glstate->gl_batch) && (!(globals4es.mergelist) || (glstate->polygon_mode==GL_LINE))) {
|
||||
renderlist_t *mylist = glstate->list.active;
|
||||
glstate->list.active = NULL;
|
||||
mylist = end_renderlist(mylist);
|
||||
draw_renderlist(mylist);
|
||||
free_renderlist(mylist);
|
||||
} else {
|
||||
glstate->list.active = extend_renderlist(glstate->list.active);
|
||||
if(!(glstate->list.compiling || glstate->gl_batch)) {
|
||||
glstate->list.pending = 1;
|
||||
NewStage(glstate->list.active, STAGE_POSTDRAW);
|
||||
}
|
||||
else glstate->list.active = extend_renderlist(glstate->list.active);
|
||||
}
|
||||
noerrorShim();
|
||||
}
|
||||
@@ -1015,12 +1067,16 @@ void glEnd() AliasExport("gl4es_glEnd");
|
||||
void gl4es_glNormal3f(GLfloat nx, GLfloat ny, GLfloat nz) {
|
||||
if (glstate->list.active) {
|
||||
if (glstate->list.active->stage != STAGE_DRAW) {
|
||||
if (glstate->list.active->stage != STAGE_DRAW) {
|
||||
if ((glstate->list.compiling || glstate->gl_batch) && glstate->list.active) {
|
||||
glstate->list.active->lastNormal[0] = nx; glstate->list.active->lastNormal[1] = ny; glstate->list.active->lastNormal[2] = nz;
|
||||
}
|
||||
PUSH_IF_COMPILING(glNormal3f);
|
||||
if ((glstate->list.compiling || glstate->gl_batch) && glstate->list.active) {
|
||||
glstate->list.active->lastNormal[0] = nx; glstate->list.active->lastNormal[1] = ny; glstate->list.active->lastNormal[2] = nz;
|
||||
} else if (glstate->list.pending && glstate->list.active->stage==STAGE_POSTDRAW) {
|
||||
glstate->list.active->post_normals[0] = nx; glstate->list.active->post_normals[1] = ny;
|
||||
glstate->list.active->post_normals[2] = nz;
|
||||
glstate->list.active->post_normal = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
PUSH_IF_COMPILING(glNormal3f);
|
||||
} else {
|
||||
rlNormal3f(glstate->list.active, nx, ny, nz);
|
||||
glstate->list.active->lastNormal[0] = nx; glstate->list.active->lastNormal[1] = ny; glstate->list.active->lastNormal[2] = nz;
|
||||
@@ -1049,13 +1105,23 @@ void glVertex4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w) AliasExport("gl4es_g
|
||||
void gl4es_glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) {
|
||||
if (glstate->list.active) {
|
||||
if (glstate->list.active->stage != STAGE_DRAW) {
|
||||
glstate->list.active->lastColors[0] = red; glstate->list.active->lastColors[1] = green;
|
||||
glstate->list.active->lastColors[2] = blue; glstate->list.active->lastColors[3] = alpha;
|
||||
glstate->list.active->lastColorsSet = 1;
|
||||
if (glstate->list.compiling || glstate->gl_batch || glstate->list.active->stage<STAGE_DRAW) {
|
||||
glstate->list.active->lastColors[0] = red; glstate->list.active->lastColors[1] = green;
|
||||
glstate->list.active->lastColors[2] = blue; glstate->list.active->lastColors[3] = alpha;
|
||||
glstate->list.active->lastColorsSet = 1;
|
||||
PUSH_IF_COMPILING(glColor4f);
|
||||
}
|
||||
else if (glstate->list.pending && glstate->list.active->stage==STAGE_POSTDRAW) {
|
||||
glstate->list.active->post_colors[0] = red; glstate->list.active->post_colors[1] = green;
|
||||
glstate->list.active->post_colors[2] = blue; glstate->list.active->post_colors[3] = alpha;
|
||||
glstate->list.active->post_color = 1;
|
||||
return;
|
||||
}
|
||||
PUSH_IF_COMPILING(glColor4f);
|
||||
} else {
|
||||
rlColor4f(glstate->list.active, red, green, blue, alpha);
|
||||
noerrorShim();
|
||||
}
|
||||
rlColor4f(glstate->list.active, red, green, blue, alpha);
|
||||
noerrorShim();
|
||||
}
|
||||
#ifndef USE_ES2
|
||||
else {
|
||||
@@ -1072,9 +1138,14 @@ void glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) AliasExp
|
||||
|
||||
void gl4es_glSecondaryColor3f(GLfloat r, GLfloat g, GLfloat b) {
|
||||
if (glstate->list.active) {
|
||||
rlSecondary3f(glstate->list.active, r, g, b);
|
||||
glstate->list.active->lastSecondaryColors[0] = r; glstate->list.active->lastSecondaryColors[1] = g;
|
||||
glstate->list.active->lastSecondaryColors[2] = b;
|
||||
if(glstate->list.pending)
|
||||
flush();
|
||||
else
|
||||
{
|
||||
rlSecondary3f(glstate->list.active, r, g, b);
|
||||
glstate->list.active->lastSecondaryColors[0] = r; glstate->list.active->lastSecondaryColors[1] = g;
|
||||
glstate->list.active->lastSecondaryColors[2] = b;
|
||||
}
|
||||
noerrorShim();
|
||||
} else {
|
||||
noerrorShim();
|
||||
@@ -1085,46 +1156,13 @@ void gl4es_glSecondaryColor3f(GLfloat r, GLfloat g, GLfloat b) {
|
||||
}
|
||||
void glSecondaryColor3f(GLfloat r, GLfloat g, GLfloat b) AliasExport("gl4es_glSecondaryColor3f");
|
||||
|
||||
#ifndef USE_ES2
|
||||
void gl4es_glMaterialfv(GLenum face, GLenum pname, const GLfloat *params) {
|
||||
LOAD_GLES(glMaterialfv);
|
||||
if ((glstate->list.compiling || glstate->gl_batch) && glstate->list.active) {
|
||||
//TODO: Materialfv can be done per vertex, how to handle that ?!
|
||||
//NewStage(glstate->list.active, STAGE_MATERIAL);
|
||||
rlMaterialfv(glstate->list.active, face, pname, params);
|
||||
noerrorShim();
|
||||
} else {
|
||||
if (face!=GL_FRONT_AND_BACK) {
|
||||
face=GL_FRONT_AND_BACK;
|
||||
}
|
||||
gles_glMaterialfv(face, pname, params);
|
||||
errorGL();
|
||||
}
|
||||
}
|
||||
void glMaterialfv(GLenum face, GLenum pname, const GLfloat *params) AliasExport("gl4es_glMaterialfv");
|
||||
void gl4es_glMaterialf(GLenum face, GLenum pname, const GLfloat param) {
|
||||
LOAD_GLES(glMaterialf);
|
||||
if ((glstate->list.compiling || glstate->gl_batch) && glstate->list.active) {
|
||||
GLfloat params[4];
|
||||
memset(params, 0, 4*sizeof(GLfloat));
|
||||
params[0] = param;
|
||||
NewStage(glstate->list.active, STAGE_MATERIAL);
|
||||
rlMaterialfv(glstate->list.active, face, pname, params);
|
||||
noerrorShim();
|
||||
} else {
|
||||
if (face!=GL_FRONT_AND_BACK) {
|
||||
face=GL_FRONT_AND_BACK;
|
||||
}
|
||||
gles_glMaterialf(face, pname, param);
|
||||
errorGL();
|
||||
}
|
||||
}
|
||||
void glMaterialf(GLenum face, GLenum pname, const GLfloat param) AliasExport("gl4es_glMaterialf");
|
||||
#endif
|
||||
|
||||
void gl4es_glTexCoord4f(GLfloat s, GLfloat t, GLfloat r, GLfloat q) {
|
||||
if (glstate->list.active) {
|
||||
rlTexCoord4f(glstate->list.active, s, t, r, q);
|
||||
if(glstate->list.pending)
|
||||
flush();
|
||||
else
|
||||
rlMultiTexCoord4f(glstate->list.active, GL_TEXTURE0, s, t, r, q);
|
||||
}
|
||||
noerrorShim();
|
||||
glstate->texcoord[0][0] = s; glstate->texcoord[0][1] = t;
|
||||
@@ -1135,7 +1173,10 @@ void glTexCoord4f(GLfloat s, GLfloat t, GLfloat r, GLfloat q) AliasExport("gl4es
|
||||
void gl4es_glMultiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q) {
|
||||
// TODO, error if target is unsuported texture....
|
||||
if (glstate->list.active) {
|
||||
rlMultiTexCoord4f(glstate->list.active, target, s, t, r, q);
|
||||
if(glstate->list.pending)
|
||||
flush();
|
||||
else
|
||||
rlMultiTexCoord4f(glstate->list.active, target, s, t, r, q);
|
||||
}
|
||||
noerrorShim();
|
||||
glstate->texcoord[target-GL_TEXTURE0][0] = s; glstate->texcoord[target-GL_TEXTURE0][1] = t;
|
||||
@@ -1298,7 +1339,7 @@ void glEndList() AliasExport("gl4es_glEndList");
|
||||
renderlist_t* append_calllist(renderlist_t *list, renderlist_t *a);
|
||||
void gl4es_glCallList(GLuint list) {
|
||||
noerrorShim();
|
||||
if ((glstate->list.compiling || glstate->gl_batch) && glstate->list.active) {
|
||||
if (glstate->list.active) {
|
||||
glstate->list.active = append_calllist(glstate->list.active, gl4es_glGetList(list));
|
||||
return;
|
||||
}
|
||||
@@ -1310,7 +1351,7 @@ void gl4es_glCallList(GLuint list) {
|
||||
void glCallList(GLuint list) AliasExport("gl4es_glCallList");
|
||||
|
||||
void glPushCall(void *call) {
|
||||
if ((glstate->list.compiling || glstate->gl_batch) && glstate->list.active) {
|
||||
if (glstate->list.active) {
|
||||
NewStage(glstate->list.active, STAGE_GLCALL);
|
||||
rlPushCall(glstate->list.active, call);
|
||||
}
|
||||
@@ -1390,16 +1431,19 @@ GLboolean gl4es_glIsList(GLuint list) {
|
||||
GLboolean glIsList(GLuint list) AliasExport("gl4es_glIsList");
|
||||
|
||||
void gl4es_glPolygonMode(GLenum face, GLenum mode) {
|
||||
ERROR_IN_BEGIN
|
||||
noerrorShim();
|
||||
if (face != GL_FRONT_AND_BACK)
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
if (face == GL_BACK)
|
||||
return; //TODO, handle face enum for polygon mode != GL_FILL
|
||||
if ((glstate->list.compiling || glstate->gl_batch) && (glstate->list.active)) {
|
||||
NewStage(glstate->list.active, STAGE_POLYGON);
|
||||
glstate->list.active->polygon_mode = mode;
|
||||
return;
|
||||
}
|
||||
if (glstate->list.active)
|
||||
if (glstate->list.compiling || glstate->gl_batch) {
|
||||
NewStage(glstate->list.active, STAGE_POLYGON);
|
||||
glstate->list.active->polygon_mode = mode;
|
||||
return;
|
||||
}
|
||||
else flush();
|
||||
switch(mode) {
|
||||
case GL_LINE:
|
||||
case GL_POINT:
|
||||
@@ -1455,17 +1499,17 @@ void glBlendEquationSeparate(GLenum modeRGB, GLenum modeA) AliasExport("gl4es_gl
|
||||
void glBlendEquationSeparateEXT(GLenum modeRGB, GLenum modeA) AliasExport("gl4es_glBlendEquationSeparate");
|
||||
|
||||
void gl4es_glBlendFunc(GLenum sfactor, GLenum dfactor) {
|
||||
if (glstate->list.active && (glstate->gl_batch && !glstate->list.compiling)) {
|
||||
if ((glstate->statebatch.blendfunc_s == sfactor) && (glstate->statebatch.blendfunc_d == dfactor))
|
||||
return; // nothing to do...
|
||||
if (!glstate->statebatch.blendfunc_s) {
|
||||
glstate->statebatch.blendfunc_s = sfactor;
|
||||
glstate->statebatch.blendfunc_d = dfactor;
|
||||
} else {
|
||||
flush();
|
||||
}
|
||||
}
|
||||
PUSH_IF_COMPILING(glBlendFunc);
|
||||
if (glstate->list.active)
|
||||
if (!glstate->list.compiling && glstate->gl_batch) {
|
||||
if ((glstate->statebatch.blendfunc_s == sfactor) && (glstate->statebatch.blendfunc_d == dfactor))
|
||||
return; // nothing to do...
|
||||
if (!glstate->statebatch.blendfunc_s) {
|
||||
glstate->statebatch.blendfunc_s = sfactor;
|
||||
glstate->statebatch.blendfunc_d = dfactor;
|
||||
}
|
||||
}
|
||||
|
||||
PUSH_IF_COMPILING(glBlendFunc)
|
||||
LOAD_GLES(glBlendFunc);
|
||||
LOAD_GLES_OES(glBlendFuncSeparate);
|
||||
errorGL();
|
||||
@@ -1549,6 +1593,7 @@ void flush() {
|
||||
if (mylist) {
|
||||
GLuint old = glstate->gl_batch;
|
||||
glstate->list.active = NULL;
|
||||
glstate->list.pending = 0;
|
||||
glstate->gl_batch = 0;
|
||||
mylist = end_renderlist(mylist);
|
||||
draw_renderlist(mylist);
|
||||
@@ -1571,12 +1616,8 @@ extern void BlitEmulatedPixmap();
|
||||
void gl4es_glFlush() {
|
||||
LOAD_GLES(glFlush);
|
||||
|
||||
if (glstate->list.active && !glstate->gl_batch) {
|
||||
errorShim(GL_INVALID_OPERATION);
|
||||
return;
|
||||
}
|
||||
|
||||
if (glstate->gl_batch) flush();
|
||||
if (glstate->gl_batch || glstate->list.pending) flush();
|
||||
PUSH_IF_COMPILING(glFlush);
|
||||
|
||||
gles_glFlush();
|
||||
errorGL();
|
||||
@@ -1591,11 +1632,8 @@ void glFlush() AliasExport("gl4es_glFlush");
|
||||
void gl4es_glFinish() {
|
||||
LOAD_GLES(glFinish);
|
||||
|
||||
if (glstate->list.active && !glstate->gl_batch) {
|
||||
errorShim(GL_INVALID_OPERATION);
|
||||
return;
|
||||
}
|
||||
if (glstate->gl_batch) flush();
|
||||
if (glstate->gl_batch || glstate->list.pending) flush();
|
||||
PUSH_IF_COMPILING(glFinish);
|
||||
|
||||
gles_glFinish();
|
||||
errorGL();
|
||||
@@ -1603,17 +1641,16 @@ void gl4es_glFinish() {
|
||||
void glFinish() AliasExport("gl4es_glFinish");
|
||||
|
||||
void gl4es_glFogfv(GLenum pname, const GLfloat* params) {
|
||||
LOAD_GLES(glFogfv);
|
||||
|
||||
if ((glstate->list.compiling || glstate->gl_batch) && glstate->list.active) {
|
||||
if (pname == GL_FOG_COLOR) {
|
||||
NewStage(glstate->list.active, STAGE_FOG);
|
||||
rlFogOp(glstate->list.active, 1, params);
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUSH_IF_COMPILING(glFogfv);
|
||||
|
||||
if (glstate->list.active)
|
||||
if (glstate->list.compiling || glstate->gl_batch) {
|
||||
NewStage(glstate->list.active, STAGE_FOG);
|
||||
rlFogOp(glstate->list.active, pname, params);
|
||||
return;
|
||||
}
|
||||
else flush();
|
||||
|
||||
LOAD_GLES(glFogfv);
|
||||
gles_glFogfv(pname, params);
|
||||
}
|
||||
void glFogfv(GLenum pname, const GLfloat* params) AliasExport("gl4es_glFogfv");
|
||||
@@ -1659,16 +1696,18 @@ void gl4es_glPointParameterf(GLenum pname, GLfloat param) {
|
||||
|
||||
void gl4es_glPointParameterfv(GLenum pname, const GLfloat * params)
|
||||
{
|
||||
if ((glstate->list.compiling || glstate->gl_batch) && glstate->list.active) {
|
||||
if (pname == GL_POINT_DISTANCE_ATTENUATION) {
|
||||
NewStage(glstate->list.active, STAGE_POINTPARAM);
|
||||
rlPointParamOp(glstate->list.active, 1, params);
|
||||
return;
|
||||
} else {
|
||||
gl4es_glPointParameterf(pname, params[0]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (glstate->list.active)
|
||||
if (glstate->list.compiling || glstate->gl_batch) {
|
||||
if (pname == GL_POINT_DISTANCE_ATTENUATION) {
|
||||
NewStage(glstate->list.active, STAGE_POINTPARAM);
|
||||
rlPointParamOp(glstate->list.active, 1, params);
|
||||
return;
|
||||
} else {
|
||||
gl4es_glPointParameterf(pname, params[0]);
|
||||
return;
|
||||
}
|
||||
} else flush();
|
||||
|
||||
LOAD_GLES(glPointParameterfv);
|
||||
|
||||
gles_glPointParameterfv(pname, params);
|
||||
@@ -1680,6 +1719,7 @@ void glPointParameterfv(GLenum pname, const GLfloat * params) AliasExport("gl4es
|
||||
void gl4es_glMultiDrawArrays(GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount)
|
||||
{
|
||||
LOAD_GLES_EXT(glMultiDrawArrays);
|
||||
if(glstate->list.pending) flush();
|
||||
if((!gles_glMultiDrawArrays) || should_intercept_render(mode) || (mode==GL_QUADS) || (glstate->list.active && (glstate->list.compiling || glstate->gl_batch))
|
||||
|| (glstate->render_mode == GL_SELECT) || ((glstate->polygon_mode == GL_LINE) || (glstate->polygon_mode == GL_POINT)) )
|
||||
{
|
||||
@@ -1702,6 +1742,7 @@ void glMultiDrawArrays(GLenum mode, const GLint *first, const GLsizei *count, GL
|
||||
void gl4es_glMultiDrawElements( GLenum mode, GLsizei *count, GLenum type, const void * const *indices, GLsizei primcount)
|
||||
{
|
||||
LOAD_GLES_EXT(glMultiDrawElements);
|
||||
if(glstate->list.pending) flush();
|
||||
if((!gles_glMultiDrawElements) || should_intercept_render(mode) || (mode==GL_QUADS) || (glstate->list.active && (glstate->list.compiling || glstate->gl_batch))
|
||||
|| (glstate->render_mode == GL_SELECT) || ((glstate->polygon_mode == GL_LINE) || (glstate->polygon_mode == GL_POINT)) || (type != GL_UNSIGNED_SHORT) )
|
||||
{
|
||||
|
||||
@@ -190,11 +190,14 @@ packed_call_t* glCopyPackedCall(const packed_call_t *packed);
|
||||
}
|
||||
|
||||
#define PUSH_IF_COMPILING_EXT(nam, ...) \
|
||||
if ((glstate->list.compiling || glstate->gl_batch) && glstate->list.active) { \
|
||||
NewStage(glstate->list.active, STAGE_GLCALL); \
|
||||
push_##nam(__VA_ARGS__); \
|
||||
noerrorShim(); \
|
||||
return (nam##_RETURN)0; \
|
||||
if (glstate->list.active) { \
|
||||
if (!glstate->list.pending) { \
|
||||
NewStage(glstate->list.active, STAGE_GLCALL); \
|
||||
push_##nam(__VA_ARGS__); \
|
||||
noerrorShim(); \
|
||||
return (nam##_RETURN)0; \
|
||||
} \
|
||||
else if(glstate->list.pending) flush(); \
|
||||
}
|
||||
|
||||
//printf("list:%i, " #nam "\n", state.list.name);
|
||||
@@ -203,6 +206,8 @@ const char* PrintEnum(GLenum what);
|
||||
|
||||
#define PUSH_IF_COMPILING(name) PUSH_IF_COMPILING_EXT(name, name##_ARG_NAMES)
|
||||
|
||||
#define ERROR_IN_BEGIN if(glstate->list.begin) {errorShim(GL_INVALID_OPERATION); return;}
|
||||
|
||||
static const GLsizei gl_sizeof(GLenum type) {
|
||||
// types
|
||||
switch (type) {
|
||||
|
||||
@@ -3,7 +3,10 @@
|
||||
#include "init.h"
|
||||
|
||||
void gl4es_glHint(GLenum pname, GLenum mode) {
|
||||
if(glstate->gl_batch) flush();
|
||||
|
||||
if (glstate->gl_batch || glstate->list.pending)
|
||||
flush();
|
||||
|
||||
LOAD_GLES(glHint);
|
||||
noerrorShim();
|
||||
switch(pname) {
|
||||
|
||||
@@ -221,6 +221,7 @@ void initialize_gl4es() {
|
||||
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");
|
||||
env(LIBGL_VABGRA, globals4es.vabgra, "Export GL_ARB_vertex_array_bgra extension");
|
||||
|
||||
char *env_version = getenv("LIBGL_VERSION");
|
||||
if (env_version) {
|
||||
|
||||
@@ -34,6 +34,7 @@ typedef struct _globals4es {
|
||||
int silentstub;
|
||||
int glx_surface_srgb;
|
||||
int nodownsampling;
|
||||
int vabgra;
|
||||
#ifdef PANDORA
|
||||
float gamma;
|
||||
#endif
|
||||
|
||||
@@ -1,62 +1,165 @@
|
||||
#include "light.h"
|
||||
#include "../glx/hardext.h"
|
||||
#include "matrix.h"
|
||||
#include "matvec.h"
|
||||
|
||||
#ifndef USE_ES2
|
||||
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;
|
||||
gl4es_glLightModelfv(pname, dummy);
|
||||
return;
|
||||
}
|
||||
LOAD_GLES(glLightModelf);
|
||||
ERROR_IN_BEGIN
|
||||
if(glstate->list.active)
|
||||
if ((glstate->list.compiling || glstate->gl_batch)) {
|
||||
GLfloat dummy[4];
|
||||
dummy[0]=param;
|
||||
gl4es_glLightModelfv(pname, dummy);
|
||||
return;
|
||||
} else flush();
|
||||
switch (pname) {
|
||||
case GL_LIGHT_MODEL_AMBIENT:
|
||||
case GL_LIGHT_MODEL_TWO_SIDE:
|
||||
errorGL();
|
||||
gles_glLightModelf(pname, param);
|
||||
glstate->light.two_side = param;
|
||||
break;
|
||||
case GL_LIGHT_MODEL_AMBIENT:
|
||||
default:
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
//printf("stubbed glLightModelf(%i, %.2f)\n", pname, param);
|
||||
break;
|
||||
return;
|
||||
}
|
||||
LOAD_GLES(glLightModelf);
|
||||
gles_glLightModelf(pname, param);
|
||||
}
|
||||
|
||||
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);
|
||||
/* if (glstate->list.active->lightmodel)
|
||||
glstate->list.active = extend_renderlist(glstate->list.active);*/
|
||||
glstate->list.active->lightmodelparam = pname;
|
||||
glstate->list.active->lightmodel = (GLfloat*)malloc(4*sizeof(GLfloat));
|
||||
memcpy(glstate->list.active->lightmodel, params, 4*sizeof(GLfloat));
|
||||
noerrorShim();
|
||||
return;
|
||||
}
|
||||
LOAD_GLES(glLightModelfv);
|
||||
ERROR_IN_BEGIN
|
||||
if(glstate->list.active)
|
||||
if ((glstate->list.compiling || glstate->gl_batch)) {
|
||||
NewStage(glstate->list.active, STAGE_LIGHTMODEL);
|
||||
/* if (glstate->list.active->lightmodel)
|
||||
glstate->list.active = extend_renderlist(glstate->list.active);*/
|
||||
glstate->list.active->lightmodelparam = pname;
|
||||
glstate->list.active->lightmodel = (GLfloat*)malloc(4*sizeof(GLfloat));
|
||||
memcpy(glstate->list.active->lightmodel, params, 4*sizeof(GLfloat));
|
||||
noerrorShim();
|
||||
return;
|
||||
} else flush();
|
||||
switch (pname) {
|
||||
case GL_LIGHT_MODEL_AMBIENT:
|
||||
case GL_LIGHT_MODEL_TWO_SIDE:
|
||||
if(memcmp(glstate->light.ambient, params, 4*sizeof(GLfloat))==0) {
|
||||
noerrorShim();
|
||||
return;
|
||||
}
|
||||
errorGL();
|
||||
gles_glLightModelfv(pname, params);
|
||||
memcpy(glstate->light.ambient, params, 4*sizeof(GLfloat));
|
||||
break;
|
||||
case GL_LIGHT_MODEL_TWO_SIDE:
|
||||
if(glstate->light.two_side == params[0]) {
|
||||
noerrorShim();
|
||||
return;
|
||||
}
|
||||
errorGL();
|
||||
glstate->light.two_side = params[0];
|
||||
break;
|
||||
default:
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
//printf("stubbed glLightModelfv(%i, %p [%.2f])\n", pname, params, params[0]);
|
||||
break;
|
||||
return;
|
||||
}
|
||||
LOAD_GLES(glLightModelfv);
|
||||
gles_glLightModelfv(pname, 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);
|
||||
rlLightfv(glstate->list.active, light, pname, params);
|
||||
noerrorShim();
|
||||
return;
|
||||
}
|
||||
//printf("%sglLightfv(%s, %s, %p=[%.2f, %.2f, %.2f, %.2f])\n", (glstate->list.compiling)?"list":"", PrintEnum(light), PrintEnum(pname), params, (params)?params[0]:0.0f, (params)?params[1]:0.0f, (params)?params[2]:0.0f, (params)?params[3]:0.0f);
|
||||
const int nl = light-GL_LIGHT0;
|
||||
if(nl<0 || nl>=hardext.maxlights) {
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
return;
|
||||
}
|
||||
ERROR_IN_BEGIN
|
||||
if(glstate->list.active)
|
||||
if (glstate->list.compiling || glstate->gl_batch) {
|
||||
NewStage(glstate->list.active, STAGE_LIGHT);
|
||||
rlLightfv(glstate->list.active, light, pname, params);
|
||||
noerrorShim();
|
||||
return;
|
||||
} else flush();
|
||||
|
||||
GLfloat tmp[4];
|
||||
noerrorShim();
|
||||
switch(pname) {
|
||||
case GL_AMBIENT:
|
||||
if(memcmp(glstate->light.lights[nl].ambient, params, 4*sizeof(GLfloat))==0)
|
||||
return;
|
||||
memcpy(glstate->light.lights[nl].ambient, params, 4*sizeof(GLfloat));
|
||||
break;
|
||||
case GL_DIFFUSE:
|
||||
if(memcmp(glstate->light.lights[nl].diffuse, params, 4*sizeof(GLfloat))==0)
|
||||
return;
|
||||
memcpy(glstate->light.lights[nl].diffuse, params, 4*sizeof(GLfloat));
|
||||
break;
|
||||
case GL_SPECULAR:
|
||||
if(memcmp(glstate->light.lights[nl].specular, params, 4*sizeof(GLfloat))==0)
|
||||
return;
|
||||
memcpy(glstate->light.lights[nl].specular, params, 4*sizeof(GLfloat));
|
||||
break;
|
||||
case GL_POSITION:
|
||||
vector_matrix(params, getMVMat(), tmp);
|
||||
if(memcmp(glstate->light.lights[nl].position, tmp, 4*sizeof(GLfloat))==0)
|
||||
return;
|
||||
memcpy(glstate->light.lights[nl].position, tmp, 4*sizeof(GLfloat));
|
||||
break;
|
||||
case GL_SPOT_DIRECTION:
|
||||
memcpy(tmp, params, 3*sizeof(GLfloat));
|
||||
tmp[3] = 0.0f;
|
||||
vector_matrix(tmp, getMVMat(), tmp);
|
||||
if(memcmp(glstate->light.lights[nl].spotDirection, tmp, 4*sizeof(GLfloat))==0)
|
||||
return;
|
||||
memcpy(glstate->light.lights[nl].spotDirection, tmp, 4*sizeof(GLfloat));
|
||||
break;
|
||||
case GL_SPOT_EXPONENT:
|
||||
if(params[0]<0 || params[0]>128) {
|
||||
errorShim(GL_INVALID_VALUE);
|
||||
return;
|
||||
}
|
||||
if(glstate->light.lights[nl].spotExponent == params[0])
|
||||
return;
|
||||
glstate->light.lights[nl].spotExponent = params[0];
|
||||
break;
|
||||
case GL_SPOT_CUTOFF:
|
||||
if(params[0]<0 || (params[0]>90 && params[0]!=180)) {
|
||||
errorShim(GL_INVALID_VALUE);
|
||||
return;
|
||||
}
|
||||
if(glstate->light.lights[nl].spotCutoff == params[0])
|
||||
return;
|
||||
glstate->light.lights[nl].spotCutoff = params[0];
|
||||
break;
|
||||
case GL_CONSTANT_ATTENUATION:
|
||||
if(params[0]<0) {
|
||||
errorShim(GL_INVALID_VALUE);
|
||||
return;
|
||||
}
|
||||
if(glstate->light.lights[nl].constantAttenuation == params[0])
|
||||
return;
|
||||
glstate->light.lights[nl].constantAttenuation = params[0];
|
||||
break;
|
||||
case GL_LINEAR_ATTENUATION:
|
||||
if(params[0]<0) {
|
||||
errorShim(GL_INVALID_VALUE);
|
||||
return;
|
||||
}
|
||||
if(glstate->light.lights[nl].linearAttenuation == params[0])
|
||||
return;
|
||||
glstate->light.lights[nl].linearAttenuation = params[0];
|
||||
break;
|
||||
case GL_QUADRATIC_ATTENUATION:
|
||||
if(params[0]<0) {
|
||||
errorShim(GL_INVALID_VALUE);
|
||||
return;
|
||||
}
|
||||
if(glstate->light.lights[nl].quadraticAttenuation == params[0])
|
||||
return;
|
||||
glstate->light.lights[nl].quadraticAttenuation = params[0];
|
||||
break;
|
||||
}
|
||||
LOAD_GLES(glLightfv);
|
||||
gles_glLightfv(light, pname, params);
|
||||
errorGL();
|
||||
@@ -69,8 +172,150 @@ void gl4es_glLightf(GLenum light, GLenum pname, const GLfloat params) {
|
||||
errorGL();
|
||||
}
|
||||
|
||||
void gl4es_glMaterialfv(GLenum face, GLenum pname, const GLfloat *params) {
|
||||
ERROR_IN_BEGIN // that not true, but don't know how to handle it
|
||||
if(glstate->list.active)
|
||||
if (glstate->list.compiling || glstate->gl_batch) {
|
||||
//TODO: Materialfv can be done per vertex, how to handle that ?!
|
||||
//NewStage(glstate->list.active, STAGE_MATERIAL);
|
||||
rlMaterialfv(glstate->list.active, face, pname, params);
|
||||
noerrorShim();
|
||||
return;
|
||||
} else flush();
|
||||
|
||||
if(face!=GL_FRONT_AND_BACK && face!=GL_FRONT && face!=GL_BACK) {
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
return;
|
||||
}
|
||||
switch(pname) {
|
||||
case GL_AMBIENT:
|
||||
if(face==GL_FRONT_AND_BACK || face==GL_FRONT)
|
||||
memcpy(glstate->material.front.ambient, params, 4*sizeof(GLfloat));
|
||||
if(face==GL_FRONT_AND_BACK || face==GL_BACK)
|
||||
memcpy(glstate->material.back.ambient, params, 4*sizeof(GLfloat));
|
||||
break;
|
||||
case GL_DIFFUSE:
|
||||
if(face==GL_FRONT_AND_BACK || face==GL_FRONT)
|
||||
memcpy(glstate->material.front.diffuse, params, 4*sizeof(GLfloat));
|
||||
if(face==GL_FRONT_AND_BACK || face==GL_BACK)
|
||||
memcpy(glstate->material.back.diffuse, params, 4*sizeof(GLfloat));
|
||||
break;
|
||||
case GL_SPECULAR:
|
||||
if(face==GL_FRONT_AND_BACK || face==GL_FRONT)
|
||||
memcpy(glstate->material.front.specular, params, 4*sizeof(GLfloat));
|
||||
if(face==GL_FRONT_AND_BACK || face==GL_BACK)
|
||||
memcpy(glstate->material.back.specular, params, 4*sizeof(GLfloat));
|
||||
break;
|
||||
case GL_EMISSION:
|
||||
if(face==GL_FRONT_AND_BACK || face==GL_FRONT)
|
||||
memcpy(glstate->material.front.emission, params, 4*sizeof(GLfloat));
|
||||
if(face==GL_FRONT_AND_BACK || face==GL_BACK)
|
||||
memcpy(glstate->material.back.emission, params, 4*sizeof(GLfloat));
|
||||
break;
|
||||
case GL_AMBIENT_AND_DIFFUSE:
|
||||
if(face==GL_FRONT_AND_BACK || face==GL_FRONT) {
|
||||
memcpy(glstate->material.front.ambient, params, 4*sizeof(GLfloat));
|
||||
memcpy(glstate->material.front.diffuse, params, 4*sizeof(GLfloat));
|
||||
}
|
||||
if(face==GL_FRONT_AND_BACK || face==GL_BACK) {
|
||||
memcpy(glstate->material.back.ambient, params, 4*sizeof(GLfloat));
|
||||
memcpy(glstate->material.back.diffuse, params, 4*sizeof(GLfloat));
|
||||
}
|
||||
break;
|
||||
case GL_SHININESS:
|
||||
if(face==GL_FRONT_AND_BACK || face==GL_FRONT)
|
||||
glstate->material.front.shininess = *params;
|
||||
if(face==GL_FRONT_AND_BACK || face==GL_BACK)
|
||||
glstate->material.back.shininess = *params;
|
||||
break;
|
||||
case GL_COLOR_INDEXES:
|
||||
if(face==GL_FRONT_AND_BACK || face==GL_FRONT) {
|
||||
glstate->material.front.indexes[0] = params[0];
|
||||
glstate->material.front.indexes[1] = params[1];
|
||||
glstate->material.front.indexes[2] = params[2];
|
||||
}
|
||||
if(face==GL_FRONT_AND_BACK || face==GL_BACK) {
|
||||
glstate->material.back.indexes[0] = params[0];
|
||||
glstate->material.back.indexes[1] = params[1];
|
||||
glstate->material.back.indexes[2] = params[2];
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if(face==GL_BACK) { // lets ignore GL_BACK in GLES 1.1
|
||||
noerrorShim();
|
||||
return;
|
||||
}
|
||||
LOAD_GLES(glMaterialfv);
|
||||
gles_glMaterialfv(GL_FRONT_AND_BACK, pname, params);
|
||||
errorGL();
|
||||
}
|
||||
|
||||
void gl4es_glMaterialf(GLenum face, GLenum pname, const GLfloat param) {
|
||||
ERROR_IN_BEGIN
|
||||
if(glstate->list.active)
|
||||
if (glstate->list.compiling || glstate->gl_batch) {
|
||||
GLfloat params[4];
|
||||
memset(params, 0, 4*sizeof(GLfloat));
|
||||
params[0] = param;
|
||||
NewStage(glstate->list.active, STAGE_MATERIAL);
|
||||
rlMaterialfv(glstate->list.active, face, pname, params);
|
||||
noerrorShim();
|
||||
return;
|
||||
} else flush();
|
||||
|
||||
if(face!=GL_FRONT_AND_BACK && face!=GL_FRONT && face!=GL_BACK) {
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
return;
|
||||
}
|
||||
if(pname!=GL_SHININESS) {
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
return;
|
||||
}
|
||||
if(face==GL_FRONT_AND_BACK || face==GL_FRONT)
|
||||
glstate->material.front.shininess = param;
|
||||
if(face==GL_FRONT_AND_BACK || face==GL_BACK)
|
||||
glstate->material.back.shininess = param;
|
||||
|
||||
LOAD_GLES(glMaterialf);
|
||||
if(face==GL_BACK) { // lets ignore GL_BACK in GLES 1.1
|
||||
noerrorShim();
|
||||
return;
|
||||
}
|
||||
gles_glMaterialf(GL_FRONT_AND_BACK, pname, param);
|
||||
errorGL();
|
||||
}
|
||||
|
||||
void gl4es_glColorMaterial(GLenum face, GLenum mode) {
|
||||
ERROR_IN_BEGIN
|
||||
if(glstate->list.active)
|
||||
if (glstate->list.compiling || glstate->gl_batch) {
|
||||
NewStage(glstate->list.active, STAGE_COLOR_MATERIAL);
|
||||
glstate->list.active->colormat_face = face;
|
||||
glstate->list.active->colormat_mode = mode;
|
||||
noerrorShim();
|
||||
return;
|
||||
} else flush();
|
||||
|
||||
if(face!=GL_FRONT_AND_BACK && face!=GL_FRONT && face!=GL_BACK) {
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
return;
|
||||
}
|
||||
if(mode!=GL_EMISSION && mode!=GL_AMBIENT && mode!=GL_DIFFUSE && mode!=GL_SPECULAR && mode!=GL_AMBIENT_AND_DIFFUSE) {
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
return;
|
||||
}
|
||||
if(face==GL_FRONT_AND_BACK || face==GL_FRONT)
|
||||
glstate->material.front.colormat = mode;
|
||||
if(face==GL_FRONT_AND_BACK || face==GL_BACK)
|
||||
glstate->material.back.colormat = mode;
|
||||
noerrorShim();
|
||||
}
|
||||
|
||||
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
|
||||
void glMaterialfv(GLenum face, GLenum pname, const GLfloat *params) AliasExport("gl4es_glMaterialfv");
|
||||
void glMaterialf(GLenum face, GLenum pname, const GLfloat param) AliasExport("gl4es_glMaterialf");
|
||||
void glColorMaterial(GLenum face, GLenum mode) AliasExport("gl4es_glColorMaterial");
|
||||
|
||||
@@ -1,6 +1,50 @@
|
||||
#include "gl.h"
|
||||
|
||||
#ifndef __LIGHT_H_
|
||||
#define __LIGHT_H_
|
||||
|
||||
typedef struct {
|
||||
GLfloat ambient[4];
|
||||
GLfloat diffuse[4];
|
||||
GLfloat specular[4];
|
||||
GLfloat constantAttenuation, linearAttenuation, quadraticAttenuation;
|
||||
GLfloat position[4];
|
||||
GLfloat spotDirection[4]; // It's only 3 in fact, because it's a direction
|
||||
GLfloat spotExponent;
|
||||
GLfloat spotCutoff;
|
||||
} light_t;
|
||||
|
||||
typedef struct {
|
||||
light_t lights[MAX_LIGHT];
|
||||
GLfloat ambient[4];
|
||||
GLboolean two_side;
|
||||
} light_state_t;
|
||||
|
||||
typedef struct {
|
||||
GLfloat ambient[4];
|
||||
GLfloat diffuse[4];
|
||||
GLfloat specular[4];
|
||||
GLfloat emission[4];
|
||||
GLfloat shininess;
|
||||
int indexes[3];
|
||||
GLenum colormat;
|
||||
} material_t;
|
||||
|
||||
typedef struct {
|
||||
material_t front;
|
||||
material_t back;
|
||||
} material_state_t;
|
||||
|
||||
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);
|
||||
|
||||
void gl4es_glGetLightfv(GLenum light, GLenum pname, GLfloat * params);
|
||||
void gl4es_glGetLightiv(GLenum light, GLenum pname, GLint * params);
|
||||
|
||||
void gl4es_glMaterialfv(GLenum face, GLenum pname, const GLfloat *params) ;
|
||||
void gl4es_glMaterialf(GLenum face, GLenum pname, const GLfloat param);
|
||||
void gl4es_glColorMaterial(GLenum face, GLenum mode);
|
||||
|
||||
#endif //__LIGHT_H_
|
||||
@@ -6,6 +6,15 @@ GLubyte *stippleData = NULL;
|
||||
GLuint stippleTexture = 0;
|
||||
|
||||
void gl4es_glLineStipple(GLuint factor, GLushort pattern) {
|
||||
if(glstate->list.active)
|
||||
if (glstate->list.compiling || glstate->gl_batch) {
|
||||
NewStage(glstate->list.active, STAGE_LINESTIPPLE);
|
||||
glstate->list.active->linestipple_op = 1;
|
||||
glstate->list.active->linestipple_factor = factor;
|
||||
glstate->list.active->linestipple_pattern = pattern;
|
||||
return;
|
||||
} else if(glstate->list.pending) flush();
|
||||
|
||||
stippleFactor = factor;
|
||||
stipplePattern = pattern;
|
||||
if (stippleData != NULL) {
|
||||
|
||||
@@ -46,7 +46,7 @@ bool ispurerender_renderlist(renderlist_t *list) {
|
||||
return false;
|
||||
if (list->popattribute)
|
||||
return false;
|
||||
if (list->material || list->light || list->lightmodel || list->texgen || list->texenv)
|
||||
if (list->material || list->colormat_face || list->light || list->lightmodel || list->texgen || list->texenv)
|
||||
return false;
|
||||
if (list->fog_op)
|
||||
return false;
|
||||
@@ -103,6 +103,8 @@ bool islistscompatible_renderlist(renderlist_t *a, renderlist_t *b) {
|
||||
if (a_mode != b_mode)
|
||||
return false;
|
||||
}
|
||||
if(!a->open || !b->open)
|
||||
return false;
|
||||
/* if ((a->indices==NULL) != (b->indices==NULL))
|
||||
return false;*/
|
||||
if (a->polygon_mode != b->polygon_mode)
|
||||
@@ -126,6 +128,8 @@ bool islistscompatible_renderlist(renderlist_t *a, renderlist_t *b) {
|
||||
// polygon mode
|
||||
if(a->polygon_mode!=b->polygon_mode)
|
||||
return false;
|
||||
if(a->post_color || b->post_color || a->post_normal || b->post_normal)
|
||||
return false;
|
||||
|
||||
// Check the size of a list, if it"s too big, don't merge...
|
||||
if ((a->len+b->len)>30000)
|
||||
@@ -454,6 +458,8 @@ renderlist_t *extend_renderlist(renderlist_t *list) {
|
||||
// just in case
|
||||
memcpy(new->lastNormal, list->lastNormal, 3*sizeof(GLfloat));
|
||||
memcpy(new->lastSecondaryColors, list->lastSecondaryColors, 3*sizeof(GLfloat));
|
||||
memcpy(new->lastColors, list->lastColors, 4*sizeof(GLfloat));
|
||||
new->lastColorsSet = list->lastColorsSet;
|
||||
// detach
|
||||
list->prev = NULL;
|
||||
// free list now
|
||||
@@ -682,7 +688,7 @@ void adjust_renderlist(renderlist_t *list) {
|
||||
list->open = false;
|
||||
for (int a=0; a<hardext.maxtex; a++) {
|
||||
const GLint itarget = get_target(glstate->enable.texture[a]);
|
||||
gltexture_t *bound = glstate->texture.bound[a][itarget];
|
||||
gltexture_t *bound = (itarget>=0)?glstate->texture.bound[a][itarget]:NULL;
|
||||
// in case of Texture bounding inside a list
|
||||
if (list->set_texture && (list->tmu == a))
|
||||
bound = gl4es_getTexture(list->target_texture, list->texture);
|
||||
@@ -725,6 +731,29 @@ renderlist_t* end_renderlist(renderlist_t *list) {
|
||||
return list;
|
||||
}
|
||||
|
||||
renderlist_t* recycle_renderlist(renderlist_t *list) {
|
||||
if(isempty_renderlist(list)) {
|
||||
renderlist_t* old=list;
|
||||
list = list->prev;
|
||||
old->prev = NULL;
|
||||
list->next = NULL;
|
||||
free_renderlist(old);
|
||||
}
|
||||
// check if pending color...
|
||||
if (list->post_color) {
|
||||
list->post_color = 0;
|
||||
rlColor4f(list, list->post_colors[0], list->post_colors[1], list->post_colors[2], list->post_colors[3]);
|
||||
}
|
||||
if (list->post_normal) {
|
||||
list->post_normal = 0;
|
||||
rlNormal3f(list, list->post_normals[0], list->post_normals[1], list->post_normals[2]);
|
||||
}
|
||||
// All done
|
||||
list->stage=STAGE_DRAW;
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
void draw_renderlist(renderlist_t *list) {
|
||||
if (!list) return;
|
||||
// go to 1st...
|
||||
@@ -765,13 +794,17 @@ void draw_renderlist(renderlist_t *list) {
|
||||
glPackedCall(cl->calls[i]);
|
||||
}
|
||||
}
|
||||
if (list->fog_op) {
|
||||
switch (list->fog_op) {
|
||||
case 1: // GL_FOG_COLOR
|
||||
gl4es_glFogfv(GL_FOG_COLOR, list->fog_val);
|
||||
break;
|
||||
if(list->render_op) {
|
||||
switch(list->render_op) {
|
||||
case 1: gl4es_glInitNames(); break;
|
||||
case 2: gl4es_glPopName(); break;
|
||||
case 3: gl4es_glPushName(list->render_arg); break;
|
||||
case 4: gl4es_glLoadName(list->render_arg); break;
|
||||
}
|
||||
}
|
||||
if (list->fog_op) {
|
||||
gl4es_glFogfv(GL_FOG_COLOR, list->fog_val);
|
||||
}
|
||||
if (list->pointparam_op) {
|
||||
switch (list->pointparam_op) {
|
||||
case 1: // GL_POINT_DISTANCE_ATTENUATION
|
||||
@@ -821,13 +854,15 @@ void draw_renderlist(renderlist_t *list) {
|
||||
kh_foreach_value(map, m,
|
||||
switch (m->pname) {
|
||||
case GL_SHININESS:
|
||||
gl4es_glMaterialf(GL_FRONT_AND_BACK, m->pname, m->color[0]);
|
||||
gl4es_glMaterialf(m->face, m->pname, m->color[0]);
|
||||
break;
|
||||
default:
|
||||
gl4es_glMaterialfv(GL_FRONT_AND_BACK, m->pname, m->color);
|
||||
gl4es_glMaterialfv(m->face, m->pname, m->color);
|
||||
}
|
||||
)
|
||||
}
|
||||
if (list->colormat_face)
|
||||
gl4es_glColorMaterial(list->colormat_face, list->colormat_mode);
|
||||
if (list->light) {
|
||||
khash_t(light) *lig = list->light;
|
||||
renderlight_t *m;
|
||||
@@ -841,6 +876,10 @@ void draw_renderlist(renderlist_t *list) {
|
||||
if (list->lightmodel) {
|
||||
gl4es_glLightModelfv(list->lightmodelparam, list->lightmodel);
|
||||
}
|
||||
|
||||
if (list->linestipple_op) {
|
||||
gl4es_glLineStipple(list->linestipple_factor, list->linestipple_pattern);
|
||||
}
|
||||
|
||||
if (list->texenv) {
|
||||
khash_t(texenv) *tgn = list->texenv;
|
||||
@@ -1203,6 +1242,8 @@ void draw_renderlist(renderlist_t *list) {
|
||||
gl4es_glPopAttrib();
|
||||
}
|
||||
#endif
|
||||
if(list->post_color) gl4es_glColor4fv(list->post_colors);
|
||||
if(list->post_normal) gl4es_glNormal3fv(list->post_normals);
|
||||
} while ((list = list->next));
|
||||
gl4es_glPopClientAttrib();
|
||||
}
|
||||
@@ -1382,21 +1423,6 @@ void rlTexGenfv(renderlist_t *list, GLenum coord, GLenum pname, const GLfloat *
|
||||
memcpy(m->color, params, 4*sizeof(GLfloat));
|
||||
}
|
||||
|
||||
void rlTexCoord4f(renderlist_t *list, GLfloat s, GLfloat t, GLfloat r, GLfloat q) {
|
||||
if (list->tex[0] == NULL) {
|
||||
list->tex[0] = alloc_sublist(4, list->cap);
|
||||
// catch up
|
||||
GLfloat *tex = list->tex[0];
|
||||
if (list->len) for (int i = 0; i < list->len; i++) {
|
||||
memcpy(tex, glstate->texcoord[0], sizeof(GLfloat) * 4);
|
||||
tex += 4;
|
||||
}
|
||||
}
|
||||
GLfloat *tex = glstate->texcoord[0];
|
||||
tex[0] = s; tex[1] = t;
|
||||
tex[2] = r; tex[3] = q;
|
||||
}
|
||||
|
||||
void rlMultiTexCoord4f(renderlist_t *list, GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q) {
|
||||
const int tmu = target - GL_TEXTURE0;
|
||||
if (list->tex[tmu] == NULL) {
|
||||
@@ -1432,11 +1458,13 @@ void rlRasterOp(renderlist_t *list, int op, GLfloat x, GLfloat y, GLfloat z) {
|
||||
}
|
||||
|
||||
void rlFogOp(renderlist_t *list, int op, const GLfloat* v) {
|
||||
int n = 1;
|
||||
if (op==GL_FOG_COLOR) n = 4;
|
||||
list->fog_op = op;
|
||||
list->fog_val[0] = v[0];
|
||||
list->fog_val[1] = v[1];
|
||||
list->fog_val[2] = v[2];
|
||||
list->fog_val[3] = v[3];
|
||||
if (n>1) list->fog_val[1] = v[1];
|
||||
if (n>2) list->fog_val[2] = v[2];
|
||||
if (n>3) list->fog_val[3] = v[3];
|
||||
}
|
||||
|
||||
void rlPointParamOp(renderlist_t *list, int op, const GLfloat* v) {
|
||||
|
||||
@@ -9,6 +9,7 @@ typedef enum {
|
||||
STAGE_POP,
|
||||
STAGE_CALLLIST,
|
||||
STAGE_GLCALL,
|
||||
STAGE_RENDER,
|
||||
STAGE_FOG,
|
||||
STAGE_POINTPARAM,
|
||||
STAGE_MATRIX,
|
||||
@@ -16,21 +17,25 @@ typedef enum {
|
||||
STAGE_BINDTEX,
|
||||
STAGE_RASTER,
|
||||
STAGE_MATERIAL,
|
||||
STAGE_COLOR_MATERIAL,
|
||||
STAGE_LIGHT,
|
||||
STAGE_LIGHTMODEL,
|
||||
STAGE_LINESTIPPLE,
|
||||
STAGE_TEXENV,
|
||||
STAGE_TEXGEN,
|
||||
STAGE_POLYGON,
|
||||
STAGE_DRAW,
|
||||
STAGE_POSTDRAW,
|
||||
STAGE_LAST
|
||||
} liststage_t;
|
||||
|
||||
static int StageExclusive[STAGE_LAST] = {
|
||||
static int StageExclusive[] = {
|
||||
0, // STAGE_NONE
|
||||
1, // STAGE_PUSH
|
||||
1, // STAGE_POP
|
||||
1, // STAGE_CALLLIST
|
||||
0, // STAGE_GLCALL
|
||||
1, // STAGE_RENDER
|
||||
1, // STAGE_FOG
|
||||
1, // STAGE_POINTPARAM
|
||||
1, // STAGE_MATRIX
|
||||
@@ -38,12 +43,16 @@ static int StageExclusive[STAGE_LAST] = {
|
||||
1, // STAGE_BINDTEX
|
||||
1, // STAGE_RASTER
|
||||
0, // STAGE_MATERIAL
|
||||
1, // STAGE_COLOR_MATERIAL
|
||||
0, // STAGE_LIGHT
|
||||
1, // STAGE_LIGTMODEL
|
||||
1, // STAGE_LINESTIPPLE
|
||||
0, // STAGE_TEXENV
|
||||
0, // STAGE_TEXGEN
|
||||
1, // STAGE_POLYGON
|
||||
1 // STAGE_DRAW
|
||||
1, // STAGE_DRAW
|
||||
1, // STAGE_POSTDRAW (used for "pending", i.e. post glEnd(), in case a similar glBegin occurs)
|
||||
0 // STAGE_LAST
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
@@ -131,6 +140,9 @@ typedef struct _renderlist_t {
|
||||
GLbitfield pushattribute;
|
||||
GLboolean popattribute;
|
||||
|
||||
int render_op;
|
||||
GLuint render_arg;
|
||||
|
||||
int raster_op;
|
||||
GLfloat raster_xyz[3];
|
||||
|
||||
@@ -142,8 +154,18 @@ typedef struct _renderlist_t {
|
||||
|
||||
int pointparam_op;
|
||||
GLfloat pointparam_val[4];
|
||||
|
||||
int linestipple_op;
|
||||
GLuint linestipple_factor, linestipple_pattern;
|
||||
|
||||
int post_color;
|
||||
GLfloat post_colors[4];
|
||||
int post_normal;
|
||||
GLfloat post_normals[3];
|
||||
|
||||
khash_t(material) *material;
|
||||
GLenum colormat_face;
|
||||
GLenum colormat_mode;
|
||||
khash_t(light) *light;
|
||||
khash_t(texgen) *texgen;
|
||||
khash_t(texenv) *texenv;
|
||||
@@ -163,6 +185,13 @@ typedef struct _renderlist_t {
|
||||
#define DEFAULT_CALL_LIST_CAPACITY 20
|
||||
#define DEFAULT_RENDER_LIST_CAPACITY 64
|
||||
|
||||
renderlist_t* recycle_renderlist(renderlist_t* list);
|
||||
#define NewDrawStage(l, m) if(globals4es.mergelist \
|
||||
&& ((l->prev && isempty_renderlist(l) && l->prev->open && l->prev->mode==mode && l->prev->mode_init==mode) \
|
||||
|| (l->stage==STAGE_POSTDRAW && l->open && l->mode==mode && l->mode_init==mode)) && \
|
||||
mode!=GL_POLYGON && mode!=GL_LINE_STRIP && mode!=GL_LINE_LOOP && \
|
||||
mode!=GL_TRIANGLE_FAN && mode!=GL_TRIANGLE_STRIP && mode!=GL_QUAD_STRIP) \
|
||||
l=recycle_renderlist(l); else NewStage(l, STAGE_DRAW)
|
||||
#define NewStage(l, s) if (l->stage+StageExclusive[l->stage] > s) {l = extend_renderlist(l);} l->stage = s
|
||||
|
||||
renderlist_t* GetFirst(renderlist_t* list);
|
||||
@@ -172,6 +201,7 @@ renderlist_t *extend_renderlist(renderlist_t *list);
|
||||
void free_renderlist(renderlist_t *list);
|
||||
void draw_renderlist(renderlist_t *list);
|
||||
renderlist_t* end_renderlist(renderlist_t *list);
|
||||
bool isempty_renderlist(renderlist_t *list);
|
||||
|
||||
void rlActiveTexture(renderlist_t *list, GLenum texture );
|
||||
void rlBindTexture(renderlist_t *list, GLenum target, GLuint texture);
|
||||
@@ -183,7 +213,6 @@ void rlTexEnvfv(renderlist_t *list, GLenum target, GLenum pname, const GLfloat *
|
||||
void rlTexEnviv(renderlist_t *list, GLenum target, GLenum pname, const GLint * params);
|
||||
void rlNormal3f(renderlist_t *list, GLfloat x, GLfloat y, GLfloat z) FASTMATH;
|
||||
void rlPushCall(renderlist_t *list, packed_call_t *data);
|
||||
void rlTexCoord4f(renderlist_t *list, GLfloat s, GLfloat t, GLfloat r, GLfloat q) FASTMATH;
|
||||
void rlMultiTexCoord4f(renderlist_t *list, GLenum texture, GLfloat s, GLfloat t, GLfloat r, GLfloat q) FASTMATH;
|
||||
void rlVertex4f(renderlist_t *list, GLfloat x, GLfloat y, GLfloat z, GLfloat w) FASTMATH;
|
||||
void rlSecondary3f(renderlist_t *list, GLfloat r, GLfloat g, GLfloat b) FASTMATH;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "loader.h"
|
||||
#include "logs.h"
|
||||
#include "init.h"
|
||||
#include <linux/limits.h>
|
||||
|
||||
void *gles = NULL, *egl = NULL, *bcm_host = NULL, *vcos = NULL;
|
||||
@@ -48,7 +49,7 @@ void *open_lib(const char **names, const char *override) {
|
||||
if (override) {
|
||||
if ((lib = dlopen(override, flags))) {
|
||||
strncpy(path_name, override, PATH_MAX);
|
||||
LOGD("LIBGL:loaded: %s\n", path_name);
|
||||
if(!globals4es.nobanner) LOGD("LIBGL:loaded: %s\n", path_name);
|
||||
return lib;
|
||||
} else {
|
||||
LOGE("LIBGL_GLES override failed: %s\n", dlerror());
|
||||
@@ -59,7 +60,7 @@ void *open_lib(const char **names, const char *override) {
|
||||
for (int e = 0; lib_ext[e]; e++) {
|
||||
snprintf(path_name, PATH_MAX, "%s%s.%s", path_prefix[p], names[i], lib_ext[e]);
|
||||
if ((lib = dlopen(path_name, flags))) {
|
||||
LOGD("LIBGL:loaded: %s\n", path_name);
|
||||
if(!globals4es.nobanner) LOGD("LIBGL:loaded: %s\n", path_name);
|
||||
return lib;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,11 +154,14 @@ DBG(printf("glLoadMatrix(%f, %f, %f, %f, %f, %f, %f...), list=%p\n", m[0], m[1],
|
||||
LOAD_GLES(glLoadMatrixf);
|
||||
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;
|
||||
memcpy(glstate->list.active->matrix_val, m, 16*sizeof(GLfloat));
|
||||
return;
|
||||
if (glstate->list.active) {
|
||||
if(glstate->list.pending) flush();
|
||||
else {
|
||||
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));
|
||||
const int id = update_current_identity(0);
|
||||
@@ -171,17 +174,20 @@ 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);
|
||||
LOAD_GLES(glLoadIdentity);
|
||||
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);
|
||||
if (glstate->list.active) {
|
||||
if(glstate->list.pending) flush();
|
||||
else {
|
||||
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;
|
||||
}
|
||||
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);
|
||||
const int id = update_current_identity(0);
|
||||
@@ -193,13 +199,15 @@ DBG(printf("glMultMatrix(%f, %f, %f, %f, %f, %f, %f...), list=%p\n", m[0], m[1],
|
||||
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;
|
||||
}
|
||||
|
||||
if (glstate->list.active) {
|
||||
if(glstate->list.pending) flush();
|
||||
else {
|
||||
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());
|
||||
update_current_identity(1);
|
||||
if(send_to_hardware()) gles_glLoadIdentity();
|
||||
|
||||
@@ -15,3 +15,7 @@ void gl4es_glFrustumf(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top,
|
||||
static inline GLfloat* getTexMat(int tmu) {
|
||||
return glstate->texture_matrix[tmu]->stack+glstate->texture_matrix[tmu]->top*16;
|
||||
}
|
||||
|
||||
static inline GLfloat* getMVMat() {
|
||||
return glstate->modelview_matrix->stack+glstate->modelview_matrix->top*16;
|
||||
}
|
||||
@@ -82,9 +82,9 @@ void vector3_matrix(const float *a, const float *b, float *c) {
|
||||
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.32 {d0}, [%1] \n"
|
||||
"flds s2, [%1, #8] \n"
|
||||
"vsub.f32 s3, s3, s3 \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)
|
||||
|
||||
@@ -1129,6 +1129,41 @@ bool pixel_quarterscale(const GLvoid *old, GLvoid **new,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool pixel_doublescale(const GLvoid *old, GLvoid **new,
|
||||
GLuint width, GLuint height,
|
||||
GLenum format, GLenum type) {
|
||||
GLuint pixel_size, new_width, new_height;
|
||||
new_width = width * 2;
|
||||
new_height = height * 2;
|
||||
//printf("LIBGL: doublescaling %ux%u -> %ux%u (%s / %s)\n", width, height, new_width, new_height, PrintEnum(format), PrintEnum(type));
|
||||
const colorlayout_t *src_color;
|
||||
src_color = get_color_map(format);
|
||||
GLvoid *dst;
|
||||
uintptr_t src, pos, pix0, pix1, pix2, pix3;
|
||||
|
||||
pixel_size = pixel_sizeof(format, type);
|
||||
dst = malloc(pixel_size * new_width * new_height);
|
||||
src = (uintptr_t)old;
|
||||
pos = (uintptr_t)dst;
|
||||
const int dx = (width>1)?1:0;
|
||||
const int dy = (height>1)?1:0;
|
||||
for (int y = 0; y+1 < new_height; y+=2) {
|
||||
for (int x = 0; x+1 < new_width; x+=2) {
|
||||
pix0 = src + ((x / 2) +
|
||||
(y / 2) * width) * pixel_size;
|
||||
memcpy((void*)pos, (void*)pix0, pixel_size);
|
||||
memcpy((void*)(pos+new_width*pixel_size), (void*)pix0, pixel_size);
|
||||
pos += pixel_size;
|
||||
memcpy((void*)pos, (void*)pix0, pixel_size);
|
||||
memcpy((void*)(pos+new_width*pixel_size), (void*)pix0, pixel_size);
|
||||
pos += pixel_size;
|
||||
}
|
||||
pos += new_width*pixel_size;
|
||||
}
|
||||
*new = dst;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool pixel_to_ppm(const GLvoid *pixels, GLuint width, GLuint height,
|
||||
GLenum format, GLenum type, GLuint name) {
|
||||
if (! pixels)
|
||||
|
||||
@@ -39,6 +39,10 @@ bool pixel_quarterscale(const GLvoid *src, GLvoid **dst,
|
||||
GLuint width, GLuint height,
|
||||
GLenum format, GLenum type);
|
||||
|
||||
bool pixel_doublescale(const GLvoid *src, GLvoid **dst,
|
||||
GLuint width, GLuint height,
|
||||
GLenum format, GLenum type);
|
||||
|
||||
bool pixel_to_ppm(const GLvoid *pixels,
|
||||
GLuint width, GLuint height,
|
||||
GLenum format, GLenum type, GLuint name);
|
||||
|
||||
@@ -4,6 +4,8 @@ static GLuint lastquery = 0;
|
||||
static glquery_t *active_samples_passed = 0;
|
||||
|
||||
void gl4es_glGenQueries(GLsizei n, GLuint * ids) {
|
||||
if (glstate->gl_batch || glstate->list.pending)
|
||||
flush();
|
||||
noerrorShim();
|
||||
if (n<1) {
|
||||
errorShim(GL_INVALID_VALUE);
|
||||
@@ -15,6 +17,8 @@ void gl4es_glGenQueries(GLsizei n, GLuint * ids) {
|
||||
}
|
||||
|
||||
GLboolean gl4es_glIsQuery(GLuint id) {
|
||||
if(glstate->list.compiling) {errorShim(GL_INVALID_OPERATION); return GL_FALSE;}
|
||||
if(glstate->list.active) flush();
|
||||
khash_t(queries) *list = glstate->queries;
|
||||
khint_t k;
|
||||
noerrorShim();
|
||||
@@ -28,6 +32,8 @@ GLboolean gl4es_glIsQuery(GLuint id) {
|
||||
}
|
||||
|
||||
void gl4es_glDeleteQueries(GLsizei n, const GLuint* ids) {
|
||||
if (glstate->gl_batch || glstate->list.pending)
|
||||
flush();
|
||||
khash_t(queries) *list = glstate->queries;
|
||||
if (list) {
|
||||
khint_t k;
|
||||
@@ -54,9 +60,9 @@ void gl4es_glBeginQuery(GLenum target, GLuint id) {
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
return;
|
||||
}
|
||||
if (glstate->gl_batch) {
|
||||
flush();
|
||||
}
|
||||
if (glstate->gl_batch || glstate->list.pending)
|
||||
flush();
|
||||
|
||||
khint_t k;
|
||||
int ret;
|
||||
glquery_t *query;
|
||||
@@ -89,9 +95,9 @@ void gl4es_glEndQuery(GLenum target) {
|
||||
errorShim(GL_INVALID_OPERATION);
|
||||
return;
|
||||
}
|
||||
if (glstate->gl_batch) {
|
||||
flush();
|
||||
}
|
||||
if (glstate->gl_batch || glstate->list.pending)
|
||||
flush();
|
||||
|
||||
active_samples_passed = NULL;
|
||||
noerrorShim();
|
||||
}
|
||||
@@ -101,6 +107,9 @@ void gl4es_glGetQueryiv(GLenum target, GLenum pname, GLint* params) {
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
return;
|
||||
}
|
||||
if (glstate->gl_batch || glstate->list.pending)
|
||||
flush();
|
||||
|
||||
noerrorShim();
|
||||
switch (pname) {
|
||||
case GL_CURRENT_QUERY:
|
||||
@@ -117,6 +126,9 @@ void gl4es_glGetQueryiv(GLenum target, GLenum pname, GLint* params) {
|
||||
void gl4es_glGetQueryObjectiv(GLuint id, GLenum pname, GLint* params) {
|
||||
khint_t k;
|
||||
int ret;
|
||||
if (glstate->gl_batch || glstate->list.pending)
|
||||
flush();
|
||||
|
||||
glquery_t *query = NULL;
|
||||
khash_t(queries) *list = glstate->queries;
|
||||
if (! list) {
|
||||
@@ -150,6 +162,9 @@ void gl4es_glGetQueryObjectiv(GLuint id, GLenum pname, GLint* params) {
|
||||
void gl4es_glGetQueryObjectuiv(GLuint id, GLenum pname, GLuint* params) {
|
||||
khint_t k;
|
||||
int ret;
|
||||
if (glstate->gl_batch || glstate->list.pending)
|
||||
flush();
|
||||
|
||||
glquery_t *query = NULL;
|
||||
khash_t(queries) *list = glstate->queries;
|
||||
if (! list) {
|
||||
|
||||
@@ -17,12 +17,14 @@ void matrix_transpose(const GLfloat *a, GLfloat *b);
|
||||
void matrix_vector(const GLfloat *a, const GLfloat *b, GLfloat *c);
|
||||
|
||||
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);
|
||||
noerrorShim();
|
||||
return;
|
||||
}
|
||||
if (glstate->list.active)
|
||||
if (glstate->list.compiling || glstate->gl_batch) {
|
||||
NewStage(glstate->list.active, STAGE_RASTER);
|
||||
rlRasterOp(glstate->list.active, 1, x, y, z);
|
||||
noerrorShim();
|
||||
return;
|
||||
} else flush();
|
||||
|
||||
// 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};
|
||||
@@ -41,12 +43,14 @@ void gl4es_glRasterPos3f(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);
|
||||
noerrorShim();
|
||||
return;
|
||||
}
|
||||
if (glstate->list.active)
|
||||
if (glstate->list.compiling || glstate->gl_batch) {
|
||||
NewStage(glstate->list.active, STAGE_RASTER);
|
||||
rlRasterOp(glstate->list.active, 2, x, y, z);
|
||||
noerrorShim();
|
||||
return;
|
||||
} else flush();
|
||||
|
||||
glstate->raster.rPos.x = x;
|
||||
glstate->raster.rPos.y = y;
|
||||
glstate->raster.rPos.z = z;
|
||||
@@ -76,24 +80,28 @@ void popViewport() {
|
||||
|
||||
|
||||
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);
|
||||
noerrorShim();
|
||||
return;
|
||||
}
|
||||
if (glstate->list.active)
|
||||
if (glstate->list.compiling || glstate->gl_batch) {
|
||||
NewStage(glstate->list.active, STAGE_RASTER);
|
||||
rlRasterOp(glstate->list.active, 3, xfactor, yfactor, 0.0f);
|
||||
noerrorShim();
|
||||
return;
|
||||
} else flush();
|
||||
|
||||
glstate->raster.raster_zoomx = xfactor;
|
||||
glstate->raster.raster_zoomy = yfactor;
|
||||
//printf("LIBGL: glPixelZoom(%f, %f)\n", xfactor, yfactor);
|
||||
}
|
||||
|
||||
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);
|
||||
noerrorShim();
|
||||
return;
|
||||
}
|
||||
if (glstate->list.active)
|
||||
if (glstate->list.compiling || glstate->gl_batch) {
|
||||
NewStage(glstate->list.active, STAGE_RASTER);
|
||||
rlRasterOp(glstate->list.active, pname|0x10000, param, 0.0f, 0.0f);
|
||||
noerrorShim();
|
||||
return;
|
||||
} else flush();
|
||||
|
||||
//printf("LIBGL: glPixelTransferf(%04x, %f)\n", pname, param);
|
||||
switch(pname) {
|
||||
case GL_RED_SCALE:
|
||||
@@ -229,7 +237,7 @@ void gl4es_glBitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig,
|
||||
// TODO: negative width/height mirrors bitmap?
|
||||
noerrorShim();
|
||||
if ((!width && !height) || (bitmap==0)) {
|
||||
if (glstate->list.compiling || glstate->gl_batch) {
|
||||
if (glstate->list.active) {
|
||||
if (glstate->list.active->raster)
|
||||
glstate->list.active = extend_renderlist(glstate->list.active); // already a raster in the list, create a new one
|
||||
rasterlist_t *r = glstate->list.active->raster = (rasterlist_t*)malloc(sizeof(rasterlist_t));
|
||||
@@ -288,7 +296,7 @@ void gl4es_glBitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig,
|
||||
|
||||
rasterlist_t rast;
|
||||
rasterlist_t *r;
|
||||
if (glstate->list.compiling || glstate->gl_batch) {
|
||||
if (glstate->list.active) {
|
||||
NewStage(glstate->list.active, STAGE_RASTER);
|
||||
r = glstate->list.active->raster = (rasterlist_t*)malloc(sizeof(rasterlist_t));
|
||||
r->shared = (int*)malloc(sizeof(int));
|
||||
@@ -307,7 +315,7 @@ void gl4es_glBitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig,
|
||||
r->zoomx = glstate->raster.raster_zoomx;
|
||||
r->zoomy = glstate->raster.raster_zoomy;
|
||||
LOAD_GLES(glDeleteTextures);
|
||||
if (!(glstate->list.compiling || glstate->gl_batch)) {
|
||||
if (!(glstate->list.active)) {
|
||||
render_raster_list(r);
|
||||
gles_glDeleteTextures(1, &r->texture);
|
||||
r->texture = 0;
|
||||
@@ -371,7 +379,7 @@ void gl4es_glDrawPixels(GLsizei width, GLsizei height, GLenum format,
|
||||
|
||||
static rasterlist_t rast = {.texture=0, .shared=NULL};
|
||||
rasterlist_t *r;
|
||||
if (glstate->list.compiling || globals4es.batch) {
|
||||
if (glstate->list.active) {
|
||||
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));
|
||||
@@ -391,7 +399,7 @@ void gl4es_glDrawPixels(GLsizei width, GLsizei height, GLenum format,
|
||||
r->bitmap = false;
|
||||
r->zoomx = glstate->raster.raster_zoomx;
|
||||
r->zoomy = glstate->raster.raster_zoomy;
|
||||
if (!(glstate->list.compiling || glstate->gl_batch)) {
|
||||
if (!(glstate->list.active)) {
|
||||
render_raster_list(r);
|
||||
/* gles_glDeleteTextures(1, &r->texture);
|
||||
r->texture = 0;*/
|
||||
|
||||
@@ -37,6 +37,9 @@ void push_hit() {
|
||||
|
||||
|
||||
GLint gl4es_glRenderMode(GLenum mode) {
|
||||
if(glstate->list.compiling) {errorShim(GL_INVALID_OPERATION); return 0;}
|
||||
if(glstate->list.active) flush();
|
||||
|
||||
int ret = 0;
|
||||
if ((mode==GL_SELECT) || (mode==GL_RENDER)) { // missing GL_FEEDBACK
|
||||
noerrorShim();
|
||||
@@ -77,6 +80,12 @@ GLint gl4es_glRenderMode(GLenum mode) {
|
||||
}
|
||||
|
||||
void gl4es_glInitNames() {
|
||||
if(glstate->list.active) {
|
||||
NewStage(glstate->list.active, STAGE_RENDER);
|
||||
glstate->list.active->render_op = 1;
|
||||
return;
|
||||
}
|
||||
//TODO list stuffs
|
||||
if (glstate->namestack.names == 0) {
|
||||
glstate->namestack.names = (GLuint*)malloc(1024*sizeof(GLuint));
|
||||
}
|
||||
@@ -85,6 +94,11 @@ void gl4es_glInitNames() {
|
||||
}
|
||||
|
||||
void gl4es_glPopName() {
|
||||
if(glstate->list.active) {
|
||||
NewStage(glstate->list.active, STAGE_RENDER);
|
||||
glstate->list.active->render_op = 2;
|
||||
return;
|
||||
}
|
||||
noerrorShim();
|
||||
if (glstate->render_mode != GL_SELECT)
|
||||
return;
|
||||
@@ -96,6 +110,12 @@ void gl4es_glPopName() {
|
||||
}
|
||||
|
||||
void gl4es_glPushName(GLuint name) {
|
||||
if(glstate->list.active) {
|
||||
NewStage(glstate->list.active, STAGE_RENDER);
|
||||
glstate->list.active->render_op = 3;
|
||||
glstate->list.active->render_arg = name;
|
||||
return;
|
||||
}
|
||||
noerrorShim();
|
||||
if (glstate->render_mode != GL_SELECT)
|
||||
return;
|
||||
@@ -108,6 +128,12 @@ void gl4es_glPushName(GLuint name) {
|
||||
}
|
||||
|
||||
void gl4es_glLoadName(GLuint name) {
|
||||
if(glstate->list.active) {
|
||||
NewStage(glstate->list.active, STAGE_RENDER);
|
||||
glstate->list.active->render_op = 4;
|
||||
glstate->list.active->render_arg = name;
|
||||
return;
|
||||
}
|
||||
noerrorShim();
|
||||
if (glstate->render_mode != GL_SELECT)
|
||||
return;
|
||||
@@ -120,6 +146,9 @@ void gl4es_glLoadName(GLuint name) {
|
||||
}
|
||||
|
||||
void gl4es_glSelectBuffer(GLsizei size, GLuint *buffer) {
|
||||
if (glstate->gl_batch || glstate->list.pending)
|
||||
flush();
|
||||
|
||||
noerrorShim();
|
||||
glstate->selectbuf.buffer = buffer;
|
||||
glstate->selectbuf.size = size;
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
#include "stack.h"
|
||||
#include "../glx/hardext.h"
|
||||
#include "matrix.h"
|
||||
|
||||
void gl4es_glPushAttrib(GLbitfield mask) {
|
||||
//printf("glPushAttrib(0x%04X)\n", mask);
|
||||
noerrorShim();
|
||||
if ((glstate->list.compiling || glstate->gl_batch) && glstate->list.active) {
|
||||
NewStage(glstate->list.active, STAGE_PUSH);
|
||||
glstate->list.active->pushattribute = mask;
|
||||
return;
|
||||
}
|
||||
if (glstate->list.active)
|
||||
if (glstate->list.compiling || glstate->gl_batch) {
|
||||
NewStage(glstate->list.active, STAGE_PUSH);
|
||||
glstate->list.active->pushattribute = mask;
|
||||
return;
|
||||
} else flush();
|
||||
|
||||
if (glstate->stack == NULL) {
|
||||
glstate->stack = (glstack_t *)malloc(STACK_SIZE * sizeof(glstack_t));
|
||||
glstate->stack->len = 0;
|
||||
@@ -161,8 +164,9 @@ void gl4es_glPushAttrib(GLbitfield mask) {
|
||||
#undef L
|
||||
}
|
||||
j=0;
|
||||
cur->materials = (GLfloat *)malloc(1 * sizeof(GLfloat)*(5*4));
|
||||
#define M(A) gl4es_glGetMaterialfv(GL_FRONT, A, cur->materials+j); j+=4
|
||||
cur->materials = (GLfloat *)malloc(2 * sizeof(GLfloat)*(5*4));
|
||||
memset(cur->materials, 0, 2 * sizeof(GLfloat)*(5*4));
|
||||
#define M(A) gl4es_glGetMaterialfv(GL_BACK, A, cur->materials+j); j+=4; 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
|
||||
gl4es_glGetIntegerv(GL_SHADE_MODEL, &cur->shade_model);
|
||||
@@ -279,7 +283,7 @@ void gl4es_glPushAttrib(GLbitfield mask) {
|
||||
void gl4es_glPushClientAttrib(GLbitfield mask) {
|
||||
noerrorShim();
|
||||
GLuint old_glbatch = glstate->gl_batch;
|
||||
if (glstate->gl_batch) {
|
||||
if (glstate->gl_batch || glstate->list.pending) {
|
||||
flush();
|
||||
glstate->gl_batch = 0;
|
||||
}
|
||||
@@ -337,11 +341,13 @@ void gl4es_glPushClientAttrib(GLbitfield mask) {
|
||||
void gl4es_glPopAttrib() {
|
||||
//printf("glPopAttrib()\n");
|
||||
noerrorShim();
|
||||
if ((glstate->list.compiling || glstate->gl_batch) && glstate->list.active) {
|
||||
NewStage(glstate->list.active, STAGE_POP);
|
||||
glstate->list.active->popattribute = true;
|
||||
return;
|
||||
}
|
||||
if (glstate->list.active)
|
||||
if (glstate->list.compiling || glstate->gl_batch) {
|
||||
NewStage(glstate->list.active, STAGE_POP);
|
||||
glstate->list.active->popattribute = true;
|
||||
return;
|
||||
} else flush();
|
||||
|
||||
if (glstate->stack == NULL || glstate->stack->len == 0) {
|
||||
errorShim(GL_STACK_UNDERFLOW);
|
||||
return;
|
||||
@@ -468,6 +474,14 @@ void gl4es_glPopAttrib() {
|
||||
|
||||
int i;
|
||||
int j=0;
|
||||
int old_matrixmode = glstate->matrix_mode;
|
||||
// Light position / direction is transformed. So load identity in modelview to restore correct stuff
|
||||
int identity = is_identity(getMVMat());
|
||||
if(!identity) {
|
||||
if(old_matrixmode != GL_MODELVIEW) gl4es_glMatrixMode(GL_MODELVIEW);
|
||||
gl4es_glPushMatrix();
|
||||
gl4es_glLoadIdentity();
|
||||
}
|
||||
for (i = 0; i < hardext.maxlights; i++) {
|
||||
enable_disable(GL_LIGHT0 + i, *(cur->lights_enabled + i));
|
||||
#define L(A) gl4es_glLightfv(GL_LIGHT0 + i, A, cur->lights+j); j+=4
|
||||
@@ -483,8 +497,15 @@ void gl4es_glPopAttrib() {
|
||||
L(GL_QUADRATIC_ATTENUATION);
|
||||
#undef L
|
||||
}
|
||||
if(!identity) {
|
||||
gl4es_glPopMatrix();
|
||||
if(old_matrixmode != GL_MODELVIEW) gl4es_glMatrixMode(old_matrixmode);
|
||||
}
|
||||
j=0;
|
||||
#define M(A) gl4es_glMaterialfv(GL_FRONT_AND_BACK, A, cur->materials+j); j+=4
|
||||
#define M(A) if(memcmp(cur->materials+j, cur->materials+j+4, 4*sizeof(GLfloat))==0) \
|
||||
{gl4es_glMaterialfv(GL_FRONT_AND_BACK, A, cur->materials+j); j+=8;} \
|
||||
else \
|
||||
{gl4es_glMaterialfv(GL_BACK, A, cur->materials+j); j+=4; gl4es_glMaterialfv(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
|
||||
|
||||
@@ -603,7 +624,7 @@ void gl4es_glPopAttrib() {
|
||||
void gl4es_glPopClientAttrib() {
|
||||
noerrorShim();
|
||||
GLuint old_glbatch = glstate->gl_batch;
|
||||
if (glstate->gl_batch) {
|
||||
if (glstate->gl_batch || glstate->list.pending) {
|
||||
flush();
|
||||
glstate->gl_batch = 0;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "texture.h"
|
||||
#include "buffers.h"
|
||||
#include "queries.h"
|
||||
#include "light.h"
|
||||
|
||||
typedef struct _glstack_t glstack_t;
|
||||
typedef struct _glclientstack_t glclientstack_t;
|
||||
@@ -61,6 +62,8 @@ typedef struct {
|
||||
typedef struct {
|
||||
renderlist_t *active;
|
||||
GLboolean compiling;
|
||||
GLboolean pending;
|
||||
GLboolean begin;
|
||||
GLboolean locked;
|
||||
GLuint base;
|
||||
GLuint name;
|
||||
@@ -189,6 +192,8 @@ typedef struct {
|
||||
int emulatedPixmap;
|
||||
int emulatedWin;
|
||||
int shared_cnt;
|
||||
light_state_t light;
|
||||
material_state_t material;
|
||||
} glstate_t;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -23,12 +23,14 @@ void gl4es_glTexGenfv(GLenum coord, GLenum pname, const GLfloat *param) {
|
||||
*/
|
||||
|
||||
//printf("glTexGenf(%s, %s, %s/%f), texture=%i\n", PrintEnum(coord), PrintEnum(pname), PrintEnum(param[0]), param[0], glstate->texture.active);
|
||||
if ((glstate->list.compiling || glstate->gl_batch) && glstate->list.active) {
|
||||
NewStage(glstate->list.active, STAGE_TEXGEN);
|
||||
rlTexGenfv(glstate->list.active, coord, pname, param);
|
||||
noerrorShim();
|
||||
return;
|
||||
}
|
||||
ERROR_IN_BEGIN
|
||||
if (glstate->list.active)
|
||||
if (glstate->list.compiling || glstate->gl_batch) {
|
||||
NewStage(glstate->list.active, STAGE_TEXGEN);
|
||||
rlTexGenfv(glstate->list.active, coord, pname, param);
|
||||
noerrorShim();
|
||||
return;
|
||||
} else flush();
|
||||
|
||||
// pname is in: GL_TEXTURE_GEN_MODE, GL_OBJECT_PLANE, GL_EYE_PLANE
|
||||
noerrorShim();
|
||||
@@ -84,7 +86,8 @@ void gl4es_glTexGenfv(GLenum coord, GLenum pname, const GLfloat *param) {
|
||||
}
|
||||
}
|
||||
void gl4es_glGetTexGenfv(GLenum coord,GLenum pname,GLfloat *params) {
|
||||
if (glstate->gl_batch) flush();
|
||||
if (glstate->gl_batch || glstate->list.pending)
|
||||
flush();
|
||||
noerrorShim();
|
||||
switch(pname) {
|
||||
case GL_TEXTURE_GEN_MODE:
|
||||
@@ -224,7 +227,26 @@ void eye_loop(const GLfloat *verts, const GLfloat *param, GLfloat *out, GLint co
|
||||
matrix_vector(ModelviewMatrix, verts+k*4, tmp);
|
||||
out[k*4]=dot4(plane, tmp);
|
||||
}
|
||||
}
|
||||
|
||||
void eye_loop_dual(const GLfloat *verts, const GLfloat *param1, const GLfloat* param2, GLfloat *out, GLint count, GLushort *indices) {
|
||||
// based on https://www.opengl.org/wiki/Mathematics_of_glTexGen
|
||||
// First get the ModelviewMatrix
|
||||
GLfloat ModelviewMatrix[16], InvModelview[16];
|
||||
glGetFloatv(GL_MODELVIEW_MATRIX, InvModelview);
|
||||
// column major -> row major
|
||||
matrix_transpose(InvModelview, ModelviewMatrix);
|
||||
// And get the inverse
|
||||
matrix_inverse(ModelviewMatrix, InvModelview);
|
||||
GLfloat plane1[4], plane2[4], tmp[4];
|
||||
vector_matrix(param1, InvModelview, plane1);
|
||||
vector_matrix(param2, InvModelview, plane2);
|
||||
for (int i=0; i<count; i++) {
|
||||
GLushort k = indices?indices[i]:i;
|
||||
matrix_vector(ModelviewMatrix, verts+k*4, tmp);
|
||||
out[k*4+0]=dot4(plane1, tmp);
|
||||
out[k*4+1]=dot4(plane2, tmp);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void tex_coord_loop(GLfloat *verts, GLfloat *norm, GLfloat *out, GLint count, GLenum type, GLfloat *param_o, GLfloat *param_e, GLushort *indices) {
|
||||
@@ -338,10 +360,16 @@ void gen_tex_coords(GLfloat *verts, GLfloat *norm, GLfloat **coords, GLint count
|
||||
return;
|
||||
if ((*coords)==NULL)
|
||||
*coords = (GLfloat *)malloc(count * 4 * sizeof(GLfloat));
|
||||
if (glstate->enable.texgen_s[texture])
|
||||
tex_coord_loop(verts, norm, (*coords), (indices)?ilen:count, glstate->texgen[texture].S, glstate->texgen[texture].S_O, glstate->texgen[texture].S_E, indices);
|
||||
if (glstate->enable.texgen_t[texture])
|
||||
tex_coord_loop(verts, norm, (*coords)+1, (indices)?ilen:count, glstate->texgen[texture].T, glstate->texgen[texture].T_O, glstate->texgen[texture].T_E, indices);
|
||||
if ( (glstate->enable.texgen_s[texture] && glstate->texgen[texture].S==GL_EYE_LINEAR)
|
||||
&& (glstate->enable.texgen_t[texture] && glstate->texgen[texture].T==GL_EYE_LINEAR) )
|
||||
{
|
||||
eye_loop_dual(verts, glstate->texgen[texture].S_E, glstate->texgen[texture].T_E, (*coords), (indices)?ilen:count, indices);
|
||||
} else {
|
||||
if (glstate->enable.texgen_s[texture])
|
||||
tex_coord_loop(verts, norm, (*coords), (indices)?ilen:count, glstate->texgen[texture].S, glstate->texgen[texture].S_O, glstate->texgen[texture].S_E, indices);
|
||||
if (glstate->enable.texgen_t[texture])
|
||||
tex_coord_loop(verts, norm, (*coords)+1, (indices)?ilen:count, glstate->texgen[texture].T, glstate->texgen[texture].T_O, glstate->texgen[texture].T_E, indices);
|
||||
}
|
||||
if (glstate->enable.texgen_r[texture])
|
||||
tex_coord_loop(verts, norm, (*coords)+2, (indices)?ilen:count, glstate->texgen[texture].R, glstate->texgen[texture].R_O, glstate->texgen[texture].R_E, indices);
|
||||
else
|
||||
|
||||
@@ -167,6 +167,10 @@ void internal2format_type(GLenum internalformat, GLenum *format, GLenum *type)
|
||||
*format = GL_RGBA;
|
||||
*type = GL_UNSIGNED_BYTE;
|
||||
break;
|
||||
case GL_BGRA:
|
||||
*format = GL_BGRA;
|
||||
*type = GL_UNSIGNED_BYTE;
|
||||
break;
|
||||
case GL_DEPTH_COMPONENT:
|
||||
*format = GL_DEPTH_COMPONENT;
|
||||
*type = GL_UNSIGNED_SHORT;
|
||||
@@ -229,6 +233,12 @@ static void *swizzle_texture(GLsizei width, GLsizei height,
|
||||
dest_format = GL_RGBA;
|
||||
*format = GL_RGBA;
|
||||
break;
|
||||
case GL_BGRA:
|
||||
if(hardext.bgra8888 && ((*type)==GL_UNSIGNED_BYTE)) {
|
||||
dest_format = GL_BGRA;
|
||||
*format = GL_BGRA;
|
||||
} else convert = true;
|
||||
break;
|
||||
default:
|
||||
convert = true;
|
||||
break;
|
||||
@@ -336,7 +346,7 @@ static void *swizzle_texture(GLsizei width, GLsizei height,
|
||||
return (void *)data;
|
||||
}
|
||||
|
||||
GLenum swizzle_internalformat(GLenum *internalformat) {
|
||||
GLenum swizzle_internalformat(GLenum *internalformat, GLenum format) {
|
||||
GLenum ret = *internalformat;
|
||||
GLenum sret;
|
||||
switch(*internalformat) {
|
||||
@@ -372,13 +382,16 @@ GLenum swizzle_internalformat(GLenum *internalformat) {
|
||||
break;
|
||||
case GL_RGBA:
|
||||
case GL_RGBA8:
|
||||
case GL_BGRA:
|
||||
case GL_RGBA16:
|
||||
case GL_RGBA16F:
|
||||
case GL_RGBA32F:
|
||||
case GL_RGB10_A2:
|
||||
case 4:
|
||||
ret = GL_RGBA; sret = GL_RGBA;
|
||||
if(format==GL_BGRA && hardext.bgra8888) {
|
||||
ret = GL_BGRA; sret = GL_BGRA;
|
||||
} else {
|
||||
ret = GL_RGBA; sret = GL_RGBA;
|
||||
}
|
||||
break;
|
||||
case GL_ALPHA8:
|
||||
case GL_ALPHA:
|
||||
@@ -431,6 +444,15 @@ GLenum swizzle_internalformat(GLenum *internalformat) {
|
||||
ret = GL_COMPRESSED_RGBA;
|
||||
sret = GL_RGBA;
|
||||
break;
|
||||
case GL_BGRA:
|
||||
if(hardext.bgra8888) {
|
||||
ret = GL_BGRA;
|
||||
sret = GL_BGRA;
|
||||
} else {
|
||||
ret = GL_RGBA;
|
||||
sret = GL_RGBA;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
ret = GL_RGBA;
|
||||
sret = GL_RGBA;
|
||||
@@ -531,23 +553,27 @@ 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][what_target(target)])?glstate->texture.bound[glstate->texture.active][what_target(target)]->mipmap_need:0, (glstate->texture.bound[glstate->texture.active][what_target(target)])?glstate->texture.bound[glstate->texture.active][what_target(target)]->mipmap_auto:0, (glstate->texture.bound[glstate->texture.active][what_target(target)])?glstate->texture.bound[glstate->texture.active][what_target(target)]->texture:0, (glstate->texture.bound[glstate->texture.active][what_target(target)])?glstate->texture.bound[glstate->texture.active][what_target(target)]->streamed:0, glstate->list.compiling);
|
||||
//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, base_level=%i, max_level=%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][what_target(target)])?glstate->texture.bound[glstate->texture.active][what_target(target)]->mipmap_need:0, (glstate->texture.bound[glstate->texture.active][what_target(target)])?glstate->texture.bound[glstate->texture.active][what_target(target)]->mipmap_auto:0, (glstate->texture.bound[glstate->texture.active][what_target(target)])?glstate->texture.bound[glstate->texture.active][what_target(target)]->base_level:0, (glstate->texture.bound[glstate->texture.active][what_target(target)])?glstate->texture.bound[glstate->texture.active][what_target(target)]->max_level:0, (glstate->texture.bound[glstate->texture.active][what_target(target)])?glstate->texture.bound[glstate->texture.active][what_target(target)]->texture:0, (glstate->texture.bound[glstate->texture.active][what_target(target)])?glstate->texture.bound[glstate->texture.active][what_target(target)]->streamed:0, glstate->list.compiling);
|
||||
// proxy case
|
||||
if (target == GL_PROXY_TEXTURE_2D || target == GL_PROXY_TEXTURE_1D || target == GL_PROXY_TEXTURE_3D) {
|
||||
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);
|
||||
|
||||
const GLuint itarget = what_target(target);
|
||||
const GLuint rtarget = map_tex_target(target);
|
||||
|
||||
if (rtarget == GL_PROXY_TEXTURE_2D) {
|
||||
int max1=hardext.maxsize;
|
||||
if (globals4es.texshrink>=8 && max1>8192) max1=8192;
|
||||
proxy_width = ((width<<level)>max1)?0:width;
|
||||
proxy_height = ((height<<level)>max1)?0:height;
|
||||
proxy_intformat = swizzle_internalformat(&internalformat, format);
|
||||
return;
|
||||
}
|
||||
//PUSH_IF_COMPILING(glTexImage2D);
|
||||
GLuint old_glbatch = glstate->gl_batch;
|
||||
if (glstate->gl_batch) {
|
||||
if (glstate->gl_batch || glstate->list.pending) {
|
||||
flush();
|
||||
glstate->gl_batch = 0;
|
||||
}
|
||||
|
||||
GLuint itarget = what_target(target);
|
||||
|
||||
GLvoid *datab = (GLvoid*)data;
|
||||
|
||||
if (glstate->vao->unpack)
|
||||
@@ -568,7 +594,7 @@ void gl4es_glTexImage2D(GLenum target, GLint level, GLint internalformat,
|
||||
else
|
||||
bound->mipmap_need = 1;
|
||||
}
|
||||
GLenum new_format = swizzle_internalformat(&internalformat);
|
||||
GLenum new_format = swizzle_internalformat(&internalformat, format);
|
||||
if (bound && (level==0)) {
|
||||
bound->orig_internal = internalformat;
|
||||
bound->internalformat = new_format;
|
||||
@@ -698,6 +724,10 @@ void gl4es_glTexImage2D(GLenum target, GLint level, GLint internalformat,
|
||||
|
||||
{
|
||||
GLsizei nheight = (hardext.npot==2)?height:npot(height), nwidth = (hardext.npot==2)?width:npot(width);
|
||||
if(target==GL_TEXTURE_RECTANGLE_ARB && hardext.npot==1) {
|
||||
nheight = height;
|
||||
nwidth = width;
|
||||
}
|
||||
#ifdef PANDORA
|
||||
#define NO_1x1
|
||||
#endif
|
||||
@@ -724,48 +754,105 @@ void gl4es_glTexImage2D(GLenum target, GLint level, GLint internalformat,
|
||||
}
|
||||
if ((bound) && (globals4es.automipmap==4) && (nwidth!=nheight))
|
||||
bound->mipmap_auto = 0;
|
||||
|
||||
|
||||
if((bound) && (target==GL_TEXTURE_RECTANGLE_ARB && hardext.npot==1)) {
|
||||
gl4es_glTexParameteri(rtarget, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
gl4es_glTexParameteri(rtarget, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
}
|
||||
|
||||
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 );
|
||||
if (bound && (target!=GL_TEXTURE_RECTANGLE_ARB) && ((bound->mipmap_need && (globals4es.automipmap!=3)) || (bound->mipmap_auto)))
|
||||
gles_glTexParameteri( rtarget, GL_GENERATE_MIPMAP, GL_TRUE );
|
||||
else {
|
||||
if(itarget!=ENABLED_CUBE_MAP) gles_glTexParameteri( target, GL_GENERATE_MIPMAP, GL_FALSE );
|
||||
if ((bound) && (bound->mipmap_need)) {
|
||||
//if(target!=GL_TEXTURE_RECTANGLE_ARB) gles_glTexParameteri( rtarget, GL_GENERATE_MIPMAP, GL_FALSE );
|
||||
if ((bound) && (itarget!=ENABLED_CUBE_MAP && target!=GL_TEXTURE_RECTANGLE_ARB) && (bound->mipmap_need)) {
|
||||
// remove the need for mipmap...
|
||||
bound->mipmap_need = 0;
|
||||
gl4es_glTexParameteri(target, GL_TEXTURE_MIN_FILTER, bound->min_filter);
|
||||
gl4es_glTexParameteri(target, GL_TEXTURE_MAG_FILTER, bound->mag_filter);
|
||||
gl4es_glTexParameteri(rtarget, GL_TEXTURE_MIN_FILTER, bound->min_filter);
|
||||
gl4es_glTexParameteri(rtarget, GL_TEXTURE_MAG_FILTER, bound->mag_filter);
|
||||
}
|
||||
}
|
||||
|
||||
if (height != nheight || width != nwidth) {
|
||||
gles_glTexImage2D(target, level, format, nwidth, nheight, border,
|
||||
gles_glTexImage2D(rtarget, level, format, nwidth, nheight, border,
|
||||
format, type, NULL);
|
||||
if (pixels) gles_glTexSubImage2D(target, level, 0, 0, width, height,
|
||||
if (pixels) gles_glTexSubImage2D(rtarget, level, 0, 0, width, height,
|
||||
format, type, pixels);
|
||||
errorGL();
|
||||
#ifdef NO_1x1
|
||||
if(level==0 && (width==1 || height==1 && pixels)) {
|
||||
// complete the texture, juste in ase it use GL_REPEAT
|
||||
// complete the texture, juste in case it use GL_REPEAT
|
||||
// also, don't keep the fact we have resized, the non-adjusted coordinates will work (as the texture is enlarged)
|
||||
if(width==1) {gles_glTexSubImage2D(target, level, 1, 0, width, height, format, type, pixels); nwidth=1;}
|
||||
if(height==1) {gles_glTexSubImage2D(target, level, 0, 1, width, height, format, type, pixels); nheight=1;}
|
||||
if(width==1) {gles_glTexSubImage2D(rtarget, level, 1, 0, width, height, format, type, pixels); nwidth=1;}
|
||||
if(height==1) {gles_glTexSubImage2D(rtarget, level, 0, 1, width, height, format, type, pixels); nheight=1;}
|
||||
if(width==1 && height==1) { // create a manual mipmap just in case_state
|
||||
gles_glTexSubImage2D(target, level, 1, 1, width, height, format, type, pixels);
|
||||
gles_glTexImage2D(target, 1, format, 1, 1, 0, format, type, pixels);
|
||||
gles_glTexSubImage2D(rtarget, level, 1, 1, width, height, format, type, pixels);
|
||||
gles_glTexImage2D(rtarget, 1, format, 1, 1, 0, format, type, pixels);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
gles_glTexImage2D(target, level, format, width, height, border,
|
||||
gles_glTexImage2D(rtarget, level, format, width, height, border,
|
||||
format, type, pixels);
|
||||
errorGL();
|
||||
}
|
||||
// check if base_level is set... and calculate lower level mipmap
|
||||
if(bound->base_level == level) {
|
||||
int leveln = level, nw = width, nh = height, nww=nwidth, nhh=nheight;
|
||||
int pot = (nh==nhh && nw==nww);
|
||||
void *ndata = pixels;
|
||||
while(leveln) {
|
||||
if(pixels) {
|
||||
GLvoid *out = ndata;
|
||||
pixel_doublescale(ndata, &out, nw, nh, format, type);
|
||||
if (out != ndata && ndata!=pixels)
|
||||
free(ndata);
|
||||
ndata = out;
|
||||
}
|
||||
nw <<= 1;
|
||||
nh <<= 1;
|
||||
nww <<= 1;
|
||||
nhh <<= 1;
|
||||
--leveln;
|
||||
gles_glTexImage2D(rtarget, leveln, format, nww, nhh, border,
|
||||
format, type, (pot)?ndata:NULL);
|
||||
if(!pot && pixels) gles_glTexSubImage2D(rtarget, leveln, 0, 0, nw, nh,
|
||||
format, type, ndata);
|
||||
}
|
||||
if (ndata!=pixels)
|
||||
free(ndata);
|
||||
}
|
||||
// check if max_level is set... and calculate highr level mipmap
|
||||
if(bound->max_level == level) {
|
||||
int leveln = level, nw = nwidth, nh = nheight, nww=width, nhh=height;
|
||||
int pot = (nh==nhh && nw==nww);
|
||||
void *ndata = pixels;
|
||||
while(nw!=1 && nh!=1) {
|
||||
if(pixels) {
|
||||
GLvoid *out = ndata;
|
||||
pixel_halfscale(ndata, &out, nww, nhh, format, type);
|
||||
if (out != ndata && ndata!=pixels)
|
||||
free(ndata);
|
||||
ndata = out;
|
||||
}
|
||||
nw = nlevel(nw, 1);
|
||||
nh = nlevel(nh, 1);
|
||||
nww = nlevel(nww, 1);
|
||||
nhh = nlevel(nhh, 1);
|
||||
++leveln;
|
||||
gles_glTexImage2D(rtarget, leveln, format, nw, nh, border,
|
||||
format, type, (pot)?ndata:NULL);
|
||||
if(!pot && pixels) gles_glTexSubImage2D(rtarget, leveln, 0, 0, nww, nhh,
|
||||
format, type, ndata);
|
||||
}
|
||||
if (ndata!=pixels)
|
||||
free(ndata);
|
||||
}
|
||||
/*if (bound && bound->mipmap_need && !bound->mipmap_auto && (globals4es.automipmap!=3))
|
||||
gles_glTexParameteri( target, GL_GENERATE_MIPMAP, GL_FALSE );*/
|
||||
gles_glTexParameteri( rtarget, GL_GENERATE_MIPMAP, GL_FALSE );*/
|
||||
} else {
|
||||
if (pixels)
|
||||
gl4es_glTexSubImage2D(target, level, 0, 0, width, height, format, type, pixels); // (should never happens) updload the 1st data...
|
||||
gl4es_glTexSubImage2D(rtarget, level, 0, 0, width, height, format, type, pixels); // (should never happens) updload the 1st data...
|
||||
}
|
||||
}
|
||||
if ((target==GL_TEXTURE_2D) && globals4es.texcopydata && bound && ((globals4es.texstream && !bound->streamed) || !globals4es.texstream)) {
|
||||
@@ -792,7 +879,7 @@ void gl4es_glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoff
|
||||
|
||||
//PUSH_IF_COMPILING(glTexSubImage2D);
|
||||
GLuint old_glbatch = glstate->gl_batch;
|
||||
if (glstate->gl_batch) {
|
||||
if (glstate->gl_batch || glstate->list.pending) {
|
||||
flush();
|
||||
glstate->gl_batch = 0;
|
||||
}
|
||||
@@ -803,6 +890,7 @@ void gl4es_glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoff
|
||||
GLvoid *pixels = (GLvoid*)datab;
|
||||
|
||||
const GLuint itarget = what_target(target);
|
||||
const GLuint rtarget = map_tex_target(target);
|
||||
|
||||
LOAD_GLES(glTexSubImage2D);
|
||||
LOAD_GLES(glTexParameteri);
|
||||
@@ -812,7 +900,6 @@ void gl4es_glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoff
|
||||
glstate->gl_batch = old_glbatch;
|
||||
return;
|
||||
}
|
||||
target = map_tex_target(target);
|
||||
|
||||
gltexture_t *bound = glstate->texture.bound[glstate->texture.active][itarget];
|
||||
if (globals4es.automipmap) {
|
||||
@@ -843,10 +930,11 @@ void gl4es_glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoff
|
||||
// compressed format are not handled here, so mask them....
|
||||
GLenum orig_internal = bound->orig_internal;
|
||||
GLenum internalformat = bound->internalformat;
|
||||
if (orig_internal==GL_COMPRESSED_RGB) orig_internal=GL_RGB;
|
||||
if (orig_internal==GL_COMPRESSED_RGBA) orig_internal=GL_RGBA;
|
||||
if (internalformat==GL_COMPRESSED_RGB) internalformat=GL_RGB;
|
||||
if (internalformat==GL_COMPRESSED_RGBA) internalformat=GL_RGBA;
|
||||
// compressed format are not handled here, so mask them....
|
||||
if (is_fake_compressed_rgb(orig_internal)) orig_internal=GL_RGB;
|
||||
if (is_fake_compressed_rgba(orig_internal)) orig_internal=GL_RGBA;
|
||||
if (is_fake_compressed_rgb(internalformat)) internalformat=GL_RGB;
|
||||
if (is_fake_compressed_rgba(internalformat)) internalformat=GL_RGBA;
|
||||
|
||||
|
||||
GLvoid *old = pixels;
|
||||
@@ -926,7 +1014,7 @@ void gl4es_glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoff
|
||||
}
|
||||
|
||||
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 );
|
||||
gles_glTexParameteri( rtarget, GL_GENERATE_MIPMAP, GL_TRUE );
|
||||
|
||||
if (bound && globals4es.texstream && bound->streamed) {
|
||||
/* // copy the texture to the buffer
|
||||
@@ -935,13 +1023,60 @@ void gl4es_glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoff
|
||||
memcpy(tmp+((yy+yoffset)*bound->width+xoffset)*2, pixels+(yy*width)*2, width*2);
|
||||
}*/
|
||||
} else {
|
||||
gles_glTexSubImage2D(target, level, xoffset, yoffset,
|
||||
gles_glTexSubImage2D(rtarget, level, xoffset, yoffset,
|
||||
width, height, format, type, pixels);
|
||||
errorGL();
|
||||
// check if base_level is set... and calculate lower level mipmap
|
||||
if(bound->base_level == level) {
|
||||
int leveln = level, nw = width, nh = height, xx=xoffset, yy=yoffset;
|
||||
void *ndata = pixels;
|
||||
while(leveln) {
|
||||
if(pixels) {
|
||||
GLvoid *out = ndata;
|
||||
pixel_doublescale(ndata, &out, nw, nh, format, type);
|
||||
if (out != ndata && ndata!=pixels)
|
||||
free(ndata);
|
||||
ndata = out;
|
||||
}
|
||||
nw <<= 1;
|
||||
nh <<= 1;
|
||||
xx <<= 1;
|
||||
yy <<= 1;
|
||||
--leveln;
|
||||
gles_glTexSubImage2D(rtarget, leveln, xx, yy, nw, nh,
|
||||
format, type, ndata);
|
||||
}
|
||||
if (ndata!=pixels)
|
||||
free(ndata);
|
||||
}
|
||||
// check if max_level is set... and calculate highr level mipmap
|
||||
if(bound->max_level == level) {
|
||||
int leveln = level, nw = width, nh = height, xx=xoffset, yy=yoffset;
|
||||
void *ndata = pixels;
|
||||
while(nw!=1 && nh!=1) {
|
||||
if(pixels) {
|
||||
GLvoid *out = ndata;
|
||||
pixel_halfscale(ndata, &out, nw, nh, format, type);
|
||||
if (out != ndata && ndata!=pixels)
|
||||
free(ndata);
|
||||
ndata = out;
|
||||
}
|
||||
nw = nlevel(nw, 1);
|
||||
nh = nlevel(nh, 1);
|
||||
xx = nlevel(xx, 1);
|
||||
yy = nlevel(yy, 1);
|
||||
++leveln;
|
||||
gles_glTexSubImage2D(rtarget, leveln, xx, yy, nw, nh,
|
||||
format, type, ndata);
|
||||
}
|
||||
if (ndata!=pixels)
|
||||
free(ndata);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*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 );*/
|
||||
gles_glTexParameteri( rtarget, GL_GENERATE_MIPMAP, GL_FALSE );*/
|
||||
|
||||
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);
|
||||
@@ -1078,7 +1213,7 @@ GLboolean gl4es_glIsTexture(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;
|
||||
//if (texture == 0) return tex; // texture 0 is a texture like any other... it is not "unbind" texture in fact!!
|
||||
int ret;
|
||||
khint_t k;
|
||||
khash_t(tex) *list = glstate->texture.list;
|
||||
@@ -1102,14 +1237,15 @@ gltexture_t* gl4es_getTexture(GLenum target, GLuint texture) {
|
||||
tex->uploaded = false;
|
||||
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->base_level = -1;
|
||||
tex->max_level = -1;
|
||||
tex->streamed = false;
|
||||
tex->alpha = true;
|
||||
tex->compressed = false;
|
||||
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;
|
||||
tex->internalformat = GL_RGBA;
|
||||
tex->shrink = 0;
|
||||
tex->data = NULL;
|
||||
} else {
|
||||
@@ -1120,8 +1256,9 @@ gltexture_t* gl4es_getTexture(GLenum target, GLuint texture) {
|
||||
#define batch_activetex (glstate->statebatch.active_tex_changed?(glstate->statebatch.active_tex-GL_TEXTURE0):glstate->texture.active)
|
||||
void gl4es_glBindTexture(GLenum target, GLuint texture) {
|
||||
noerrorShim();
|
||||
//printf("glBindTexture(%s, %u), active=%i, client=%i\n", PrintEnum(target), texture, glstate->texture.active, glstate->texture.client);
|
||||
if(glstate->list.pending) flush();
|
||||
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]);
|
||||
if ((glstate->statebatch.bound_targ[batch_activetex] == target) && (glstate->statebatch.bound_tex[batch_activetex] == texture))
|
||||
return; // nothing to do...
|
||||
if (glstate->statebatch.bound_targ[batch_activetex]) {
|
||||
@@ -1129,7 +1266,6 @@ void gl4es_glBindTexture(GLenum target, GLuint texture) {
|
||||
}
|
||||
glstate->statebatch.bound_targ[batch_activetex] = target;
|
||||
glstate->statebatch.bound_tex[batch_activetex] = texture;
|
||||
//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]);
|
||||
}
|
||||
if ((target!=GL_PROXY_TEXTURE_2D) && ((glstate->list.compiling || glstate->gl_batch) && glstate->list.active)) {
|
||||
// check if already a texture binded, if yes, create a new list
|
||||
@@ -1140,18 +1276,13 @@ void gl4es_glBindTexture(GLenum target, GLuint texture) {
|
||||
int streamingID = -1;
|
||||
gltexture_t *tex = NULL;
|
||||
const GLuint itarget = what_target(target);
|
||||
//printf("glBindTexture(0x%04X, %u), active=%i, client=%i\n", target, texture, glstate->texture.active, glstate->texture.client);
|
||||
if (texture) {
|
||||
tex = gl4es_getTexture(target, texture);
|
||||
if (glstate->texture.bound[glstate->texture.active][itarget] == tex)
|
||||
tex_changed = 0;
|
||||
texture = tex->glname;
|
||||
if (globals4es.texstream && tex->streamed)
|
||||
streamingID = tex->streamingID;
|
||||
} else {
|
||||
if (glstate->texture.bound[glstate->texture.active][itarget] == NULL)
|
||||
tex_changed = 0;
|
||||
}
|
||||
|
||||
tex = gl4es_getTexture(target, texture);
|
||||
if (glstate->texture.bound[glstate->texture.active][itarget] == tex)
|
||||
tex_changed = 0;
|
||||
texture = tex->glname;
|
||||
if (globals4es.texstream && tex->streamed)
|
||||
streamingID = tex->streamingID;
|
||||
|
||||
LOAD_GLES(glDisable);
|
||||
LOAD_GLES(glEnable);
|
||||
@@ -1173,7 +1304,7 @@ tex_changed=1; // seems buggy, temporary disabling that...
|
||||
}
|
||||
#endif
|
||||
|
||||
target = map_tex_target(target);
|
||||
const GLuint rtarget = map_tex_target(target);
|
||||
|
||||
glstate->texture.bound[glstate->texture.active][itarget] = tex;
|
||||
|
||||
@@ -1188,7 +1319,7 @@ tex_changed=1; // seems buggy, temporary disabling that...
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
gles_glBindTexture(target, texture);
|
||||
gles_glBindTexture(rtarget, texture);
|
||||
errorGL();
|
||||
}
|
||||
}
|
||||
@@ -1201,7 +1332,7 @@ void gl4es_glTexParameteri(GLenum target, GLenum pname, GLint param) {
|
||||
PUSH_IF_COMPILING(glTexParameteri);
|
||||
LOAD_GLES(glTexParameteri);
|
||||
const GLint itarget = what_target(target);
|
||||
target = map_tex_target(target);
|
||||
const GLuint rtarget = map_tex_target(target);
|
||||
gltexture_t *texture = glstate->texture.bound[glstate->texture.active][itarget];
|
||||
switch (pname) {
|
||||
case GL_TEXTURE_MIN_FILTER:
|
||||
@@ -1238,11 +1369,17 @@ void gl4es_glTexParameteri(GLenum target, GLenum pname, GLint param) {
|
||||
if (pname==GL_TEXTURE_WRAP_S) if (texture) texture->wrap_s = param;
|
||||
if (pname==GL_TEXTURE_WRAP_T) if (texture) texture->wrap_t = param;
|
||||
break;
|
||||
case GL_TEXTURE_WRAP_R:
|
||||
// ignore it on GLES...
|
||||
break;
|
||||
case GL_TEXTURE_MAX_LEVEL:
|
||||
if (texture)
|
||||
texture->mipmap_auto = (param)?1:0;
|
||||
texture->max_level = param;
|
||||
return; // not on GLES
|
||||
case GL_TEXTURE_BASE_LEVEL:
|
||||
if (texture)
|
||||
texture->base_level = param;
|
||||
return; // not on GLES
|
||||
case GL_TEXTURE_MIN_LOD:
|
||||
case GL_TEXTURE_MAX_LOD:
|
||||
case GL_TEXTURE_LOD_BIAS:
|
||||
@@ -1254,9 +1391,10 @@ void gl4es_glTexParameteri(GLenum target, GLenum pname, GLint param) {
|
||||
default_tex_mipmap = texture->mipmap_auto;
|
||||
} else
|
||||
default_tex_mipmap = (param)?1:0; // default?
|
||||
return; // We control the behavour later
|
||||
//return; // We control the behavour later
|
||||
break;
|
||||
}
|
||||
gles_glTexParameteri(target, pname, param);
|
||||
gles_glTexParameteri(rtarget, pname, param);
|
||||
errorGL();
|
||||
}
|
||||
|
||||
@@ -1265,7 +1403,7 @@ void gl4es_glTexParameterf(GLenum target, GLenum pname, GLfloat param) {
|
||||
}
|
||||
|
||||
void gl4es_glDeleteTextures(GLsizei n, const GLuint *textures) {
|
||||
if (glstate->gl_batch) flush();
|
||||
if (glstate->gl_batch || glstate->list.pending) flush();
|
||||
noerrorShim();
|
||||
LOAD_GLES(glDeleteTextures);
|
||||
khash_t(tex) *list = glstate->texture.list;
|
||||
@@ -1308,7 +1446,7 @@ void gl4es_glDeleteTextures(GLsizei n, const GLuint *textures) {
|
||||
void gl4es_glGenTextures(GLsizei n, GLuint * textures) {
|
||||
if (n<=0)
|
||||
return;
|
||||
if (glstate->gl_batch) flush();
|
||||
if (glstate->gl_batch || glstate->list.pending) flush();
|
||||
LOAD_GLES(glGenTextures);
|
||||
gles_glGenTextures(n, textures);
|
||||
errorGL();
|
||||
@@ -1334,13 +1472,15 @@ void gl4es_glGenTextures(GLsizei n, GLuint * textures) {
|
||||
tex->width = 0;
|
||||
tex->height = 0;
|
||||
tex->uploaded = false;
|
||||
tex->mipmap_auto = 0;
|
||||
tex->mipmap_need = 0;
|
||||
tex->mipmap_auto = default_tex_mipmap || (globals4es.automipmap==1);
|
||||
tex->mipmap_need = (globals4es.automipmap==1)?1:0;
|
||||
tex->streamingID = -1;
|
||||
tex->base_level = -1;
|
||||
tex->max_level = -1;
|
||||
tex->streamed = false;
|
||||
tex->alpha = true;
|
||||
tex->compressed = false;
|
||||
tex->min_filter = tex->mag_filter = GL_NEAREST;
|
||||
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->shrink = 0;
|
||||
@@ -1362,15 +1502,15 @@ GLboolean gl4es_glAreTexturesResident(GLsizei n, const GLuint *textures, GLboole
|
||||
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();
|
||||
if (glstate->gl_batch || glstate->list.pending) flush();
|
||||
*params = 0;
|
||||
noerrorShim();
|
||||
const GLuint itarget = what_target(target);
|
||||
target = map_tex_target(target);
|
||||
const GLuint rtarget = map_tex_target(target);
|
||||
gltexture_t* bound = glstate->texture.bound[glstate->texture.active][itarget];
|
||||
switch (pname) {
|
||||
case GL_TEXTURE_WIDTH:
|
||||
if (target==GL_PROXY_TEXTURE_2D)
|
||||
if (rtarget==GL_PROXY_TEXTURE_2D)
|
||||
(*params) = nlevel(proxy_width,level);
|
||||
else {
|
||||
(*params) = nlevel((bound)?bound->width:2048,level);
|
||||
@@ -1379,7 +1519,7 @@ void gl4es_glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GL
|
||||
}
|
||||
break;
|
||||
case GL_TEXTURE_HEIGHT:
|
||||
if (target==GL_PROXY_TEXTURE_2D)
|
||||
if (rtarget==GL_PROXY_TEXTURE_2D)
|
||||
(*params) = nlevel(proxy_height,level);
|
||||
else {
|
||||
(*params) = nlevel((bound)?bound->height:2048,level);
|
||||
@@ -1388,7 +1528,7 @@ void gl4es_glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GL
|
||||
}
|
||||
break;
|
||||
case GL_TEXTURE_INTERNAL_FORMAT:
|
||||
if (target==GL_PROXY_TEXTURE_2D)
|
||||
if (rtarget==GL_PROXY_TEXTURE_2D)
|
||||
(*params) = proxy_intformat;
|
||||
else {
|
||||
if (bound && bound->compressed)
|
||||
@@ -1476,7 +1616,7 @@ void popViewport();
|
||||
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) {
|
||||
if (glstate->gl_batch || glstate->list.pending) {
|
||||
flush();
|
||||
glstate->gl_batch = 0;
|
||||
}
|
||||
@@ -1493,7 +1633,7 @@ void gl4es_glGetTexImage(GLenum target, GLint level, GLenum format, GLenum type,
|
||||
//printf("STUBBED glGetTexImage with level=%i\n", level);
|
||||
void* tmp = malloc(width*height*pixel_sizeof(format, type)); // tmp space...
|
||||
void* tmp2;
|
||||
gl4es_glGetTexImage(target, 0, format, type, tmp);
|
||||
gl4es_glGetTexImage(map_tex_target(target), 0, format, type, tmp);
|
||||
for (int i=0; i<level; i++) {
|
||||
pixel_halfscale(tmp, &tmp2, width, height, format, type);
|
||||
free(tmp);
|
||||
@@ -1675,6 +1815,7 @@ void gl4es_glGetTexImage(GLenum target, GLint level, GLenum format, GLenum type,
|
||||
}
|
||||
|
||||
void gl4es_glActiveTexture( GLenum texture ) {
|
||||
if (glstate->list.pending) flush();
|
||||
if (glstate->list.active && (glstate->gl_batch && !glstate->list.compiling)) {
|
||||
if (glstate->statebatch.active_tex_changed) {
|
||||
if(glstate->statebatch.active_tex == texture)
|
||||
@@ -1708,7 +1849,7 @@ void gl4es_glClientActiveTexture( GLenum texture ) {
|
||||
// try to speed-up things...
|
||||
if (glstate->texture.client == (texture - GL_TEXTURE0))
|
||||
return;
|
||||
if (glstate->gl_batch) flush();
|
||||
if (glstate->gl_batch || glstate->list.pending) flush();
|
||||
glstate->texture.client = texture - GL_TEXTURE0;
|
||||
LOAD_GLES(glClientActiveTexture);
|
||||
gles_glClientActiveTexture(texture);
|
||||
@@ -1717,7 +1858,7 @@ void gl4es_glClientActiveTexture( GLenum texture ) {
|
||||
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) {
|
||||
if (glstate->gl_batch || glstate->list.pending) {
|
||||
flush();
|
||||
glstate->gl_batch = 0;
|
||||
}
|
||||
@@ -1765,7 +1906,7 @@ void gl4es_glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint
|
||||
//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);
|
||||
GLuint old_glbatch = glstate->gl_batch;
|
||||
if (glstate->gl_batch) {
|
||||
if (glstate->gl_batch || glstate->list.pending) {
|
||||
flush();
|
||||
glstate->gl_batch = 0;
|
||||
}
|
||||
@@ -1826,7 +1967,7 @@ void gl4es_glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat,
|
||||
//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);
|
||||
GLuint old_glbatch = glstate->gl_batch;
|
||||
if (glstate->gl_batch) {
|
||||
if (glstate->gl_batch || glstate->list.pending) {
|
||||
flush();
|
||||
glstate->gl_batch = 0;
|
||||
}
|
||||
@@ -1932,14 +2073,14 @@ void gl4es_glCompressedTexImage2D(GLenum target, GLint level, GLenum internalfor
|
||||
GLsizei imageSize, const GLvoid *data)
|
||||
{
|
||||
const GLuint itarget = what_target(target);
|
||||
target = map_tex_target(target);
|
||||
const GLuint rtarget = map_tex_target(target);
|
||||
if (target == GL_PROXY_TEXTURE_2D) {
|
||||
proxy_width = (width>2048)?0:width;
|
||||
proxy_height = (height>2048)?0:height;
|
||||
return;
|
||||
}
|
||||
GLuint old_glbatch = glstate->gl_batch;
|
||||
if (glstate->gl_batch) {
|
||||
if (glstate->gl_batch || glstate->list.pending) {
|
||||
flush();
|
||||
glstate->gl_batch = 0;
|
||||
}
|
||||
@@ -2029,7 +2170,7 @@ void gl4es_glCompressedTexImage2D(GLenum target, GLint level, GLenum internalfor
|
||||
gl4es_glGetIntegerv(GL_UNPACK_ALIGNMENT, &oldalign);
|
||||
if (oldalign!=1)
|
||||
gl4es_glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
gl4es_glTexImage2D(target, level, format==GL_RGBA?GL_COMPRESSED_RGBA:GL_COMPRESSED_RGB, nlevel(width,fact), nlevel(height,fact), border, format, type, half);
|
||||
gl4es_glTexImage2D(rtarget, level, format==GL_RGBA?GL_COMPRESSED_RGBA:GL_COMPRESSED_RGB, nlevel(width,fact), nlevel(height,fact), border, format, type, half);
|
||||
// re-update bounded texture info
|
||||
bound->compressed = true;
|
||||
bound->internalformat = internalformat;
|
||||
@@ -2045,7 +2186,7 @@ void gl4es_glCompressedTexImage2D(GLenum target, GLint level, GLenum internalfor
|
||||
bound->type = GL_UNSIGNED_BYTE;
|
||||
bound->internalformat = internalformat;
|
||||
bound->compressed = true;
|
||||
gles_glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, datab);
|
||||
gles_glCompressedTexImage2D(rtarget, level, internalformat, width, height, border, imageSize, datab);
|
||||
}
|
||||
glstate->vao->unpack = unpack;
|
||||
glstate->gl_batch = old_glbatch;
|
||||
@@ -2057,7 +2198,7 @@ void gl4es_glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset,
|
||||
{
|
||||
const GLuint itarget = what_target(target);
|
||||
const GLuint old_glbatch = glstate->gl_batch;
|
||||
if (glstate->gl_batch) {
|
||||
if (glstate->gl_batch || glstate->list.pending) {
|
||||
flush();
|
||||
glstate->gl_batch = 0;
|
||||
}
|
||||
@@ -2124,7 +2265,7 @@ void gl4es_glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset,
|
||||
}
|
||||
|
||||
void gl4es_glGetCompressedTexImage(GLenum target, GLint lod, GLvoid *img) {
|
||||
if (glstate->gl_batch) flush();
|
||||
if (glstate->gl_batch || glstate->list.pending) flush();
|
||||
|
||||
const GLuint itarget = what_target(target);
|
||||
gltexture_t* bound = glstate->texture.bound[glstate->texture.active][itarget];
|
||||
@@ -2227,6 +2368,7 @@ void gl4es_glTexEnvfv(GLenum target, GLenum pname, const GLfloat *param) {
|
||||
gles_glTexEnvfv(target, pname, param);
|
||||
}
|
||||
void gl4es_glTexEnviv(GLenum target, GLenum pname, const GLint *param) {
|
||||
if (glstate->list.pending) flush();
|
||||
if ((glstate->list.compiling || glstate->gl_batch) && glstate->list.active) {
|
||||
NewStage(glstate->list.active, STAGE_TEXENV);
|
||||
rlTexEnviv(glstate->list.active, target, pname, param);
|
||||
@@ -2238,6 +2380,7 @@ void gl4es_glTexEnviv(GLenum target, GLenum pname, const GLint *param) {
|
||||
}
|
||||
void gl4es_glGetTexEnvfv(GLenum target, GLenum pname, GLfloat * params) {
|
||||
LOAD_GLES(glGetTexEnvfv);
|
||||
if (glstate->list.pending) flush();
|
||||
if (glstate->list.active && (glstate->gl_batch && !glstate->list.compiling)) flush();
|
||||
if(target==GL_POINT_SPRITE && pname==GL_COORD_REPLACE)
|
||||
*params = glstate->texture.pscoordreplace[glstate->texture.active];
|
||||
@@ -2247,6 +2390,7 @@ void gl4es_glGetTexEnvfv(GLenum target, GLenum pname, GLfloat * params) {
|
||||
}
|
||||
void gl4es_glGetTexEnviv(GLenum target, GLenum pname, GLint * params) {
|
||||
LOAD_GLES(glGetTexEnviv);
|
||||
if (glstate->list.pending) flush();
|
||||
if (glstate->list.active && (glstate->gl_batch && !glstate->list.compiling)) flush();
|
||||
if(target==GL_POINT_SPRITE && pname==GL_COORD_REPLACE)
|
||||
*params = glstate->texture.pscoordreplace[glstate->texture.active];
|
||||
@@ -2316,4 +2460,4 @@ void glCompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset, GLi
|
||||
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");
|
||||
void glCopyTexSubImage3DARB(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) AliasExport("gl4es_glCopyTexSubImage3D");
|
||||
@@ -126,6 +126,8 @@ typedef struct {
|
||||
GLboolean compressed;
|
||||
GLboolean streamed;
|
||||
int streamingID;
|
||||
int base_level;
|
||||
int max_level;
|
||||
GLvoid *data; // in case we want to keep a copy of it (it that case, always RGBA/GL_UNSIGNED_BYTE
|
||||
} gltexture_t;
|
||||
|
||||
@@ -140,6 +142,7 @@ static inline GLenum map_tex_target(GLenum target) {
|
||||
break;
|
||||
case GL_PROXY_TEXTURE_1D:
|
||||
case GL_PROXY_TEXTURE_3D:
|
||||
case GL_PROXY_TEXTURE_RECTANGLE_ARB:
|
||||
target = GL_PROXY_TEXTURE_2D;
|
||||
break;
|
||||
}
|
||||
@@ -184,7 +187,7 @@ static inline GLenum to_target(GLuint itarget) {
|
||||
}
|
||||
}
|
||||
#define IS_TEX2D(T) (T&(1<<ENABLED_TEX2D))
|
||||
#define IS_ANYTEX(T) (T&((1<<ENABLED_TEX2D)|(1<<ENABLED_TEX1D)|(1<<ENABLED_TEX3D)))
|
||||
#define IS_ANYTEX(T) (T&((1<<ENABLED_TEX2D)|(1<<ENABLED_TEX1D)|(1<<ENABLED_TEX3D)|(1<<ENABLED_TEXTURE_RECTANGLE)))
|
||||
|
||||
static inline GLint get_target(GLuint enabled) {
|
||||
if(!enabled)
|
||||
|
||||
@@ -54,15 +54,15 @@ void gl4es_glFogiv(GLenum pname, GLint *iparams) {
|
||||
case GL_FOG_DENSITY:
|
||||
case GL_FOG_START:
|
||||
case GL_FOG_END:
|
||||
case GL_FOG_MODE:
|
||||
case GL_FOG_INDEX: {
|
||||
gl4es_glFogf(pname, *iparams);
|
||||
break;
|
||||
}
|
||||
case GL_FOG_MODE:
|
||||
case GL_FOG_COLOR: {
|
||||
GLfloat params[4];
|
||||
for (int i = 0; i < 4; i++) {
|
||||
params[i] = iparams[i];
|
||||
params[i] = (iparams[i]>>16)*1.0f/32767.f;
|
||||
}
|
||||
gl4es_glFogfv(pname, params);
|
||||
break;
|
||||
@@ -85,17 +85,33 @@ void gl4es_glGetMaterialiv(GLenum face, GLenum pname, GLint * params) {
|
||||
GLfloat fparams[4];
|
||||
gl4es_glGetMaterialfv(face, pname, fparams);
|
||||
if (pname==GL_SHININESS) *params=fparams[0];
|
||||
else for (int i=0; i<4; i++) params[i]=fparams[i];
|
||||
else {
|
||||
if (pname==GL_COLOR_INDEXES)
|
||||
for (int i=0; i<3; i++) params[i]=fparams[i];
|
||||
else
|
||||
for (int i=0; i<4; i++) params[i]=((int)fparams[i]*32767)<<16;
|
||||
}
|
||||
}
|
||||
void gl4es_glGetLightiv(GLenum light, GLenum pname, GLint * params) {
|
||||
GLfloat fparams[4];
|
||||
gl4es_glGetLightfv(light, pname, fparams);
|
||||
int n=4;
|
||||
if (pname==GL_SPOT_EXPONENT) n=1;
|
||||
if (pname==GL_SPOT_CUTOFF) n=1;
|
||||
if (pname==GL_SPOT_EXPONENT) n=1;
|
||||
if (pname==GL_SPOT_DIRECTION) n=3;
|
||||
else for (int i=0; i<n; i++) params[i]=fparams[i];
|
||||
switch(pname) {
|
||||
case GL_SPOT_EXPONENT:
|
||||
case GL_SPOT_CUTOFF:
|
||||
case GL_CONSTANT_ATTENUATION:
|
||||
case GL_LINEAR_ATTENUATION:
|
||||
case GL_QUADRATIC_ATTENUATION:
|
||||
n=1;
|
||||
break;
|
||||
case GL_SPOT_DIRECTION:
|
||||
n=3;
|
||||
break;
|
||||
}
|
||||
if(pname==GL_AMBIENT || pname==GL_DIFFUSE || pname==GL_SPECULAR)
|
||||
for (int i=0; i<n; i++) params[i]=((int)fparams[i]*32767)<<16;
|
||||
else
|
||||
for (int i=0; i<n; i++) params[i]=fparams[i];
|
||||
}
|
||||
void gl4es_glGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat *params) {
|
||||
GLint iparams;
|
||||
@@ -124,26 +140,28 @@ void gl4es_glPixelTransferi(GLenum pname, GLint param) {
|
||||
}
|
||||
|
||||
void gl4es_glLightiv(GLenum light, GLenum pname, GLint *iparams) {
|
||||
GLfloat params[4];
|
||||
switch (pname) {
|
||||
case GL_AMBIENT:
|
||||
case GL_DIFFUSE:
|
||||
case GL_SPECULAR:
|
||||
case GL_POSITION: {
|
||||
GLfloat params[4];
|
||||
for (int i = 0; i < 4; i++) {
|
||||
params[i] = (iparams[i]>>16)*(1.0f/32767.f);
|
||||
}
|
||||
gl4es_glLightfv(light, pname, params);
|
||||
break;
|
||||
case GL_POSITION:
|
||||
for (int i = 0; i < 4; i++) {
|
||||
params[i] = iparams[i];
|
||||
}
|
||||
gl4es_glLightfv(light, pname, params);
|
||||
break;
|
||||
}
|
||||
case GL_SPOT_DIRECTION: {
|
||||
GLfloat params[4];
|
||||
case GL_SPOT_DIRECTION:
|
||||
for (int i = 0; i < 4; i++) {
|
||||
params[i] = iparams[i];
|
||||
}
|
||||
gl4es_glLightfv(light, pname, params);
|
||||
break;
|
||||
}
|
||||
case GL_SPOT_EXPONENT:
|
||||
case GL_SPOT_CUTOFF:
|
||||
case GL_CONSTANT_ATTENUATION:
|
||||
@@ -163,7 +181,7 @@ void gl4es_glLightModeliv(GLenum pname, GLint *iparams) {
|
||||
case GL_LIGHT_MODEL_AMBIENT: {
|
||||
GLfloat params[4];
|
||||
for (int i = 0; i < 4; i++) {
|
||||
params[i] = iparams[i];
|
||||
params[i] = (iparams[i]>>16)*1.f/32767.f;
|
||||
}
|
||||
gl4es_glLightModelfv(pname, params);
|
||||
break;
|
||||
@@ -186,24 +204,17 @@ printf("glMaterialiv(%04X, %04X, [%i,...]\n", face, pname, iparams[0]);
|
||||
case GL_DIFFUSE:
|
||||
case GL_SPECULAR:
|
||||
case GL_EMISSION:
|
||||
case GL_AMBIENT_AND_DIFFUSE:
|
||||
{
|
||||
GLfloat params[4];
|
||||
for (int i = 0; i < 4; i++) {
|
||||
params[i] = iparams[i]; // should divide by MAX_INT
|
||||
params[i] = (iparams[i]>>16)*1.f/32767.f;
|
||||
}
|
||||
gl4es_glMaterialfv(face, pname, params);
|
||||
break;
|
||||
}
|
||||
case GL_SHININESS:
|
||||
{
|
||||
GLfloat params[2];
|
||||
for (int i = 0; i < 2; i++) {
|
||||
params[i] = iparams[i];
|
||||
}
|
||||
gl4es_glMaterialfv(face, pname, params);
|
||||
break;
|
||||
}
|
||||
case GL_AMBIENT_AND_DIFFUSE: {
|
||||
gl4es_glMaterialf(face, pname, *iparams);
|
||||
break;
|
||||
}
|
||||
|
||||
433
project/jni/gl4es/src/gl/wrap/gles.c
Executable file → Normal file
433
project/jni/gl4es/src/gl/wrap/gles.c
Executable file → Normal file
@@ -1,4 +1,3 @@
|
||||
#ifndef USE_ES2
|
||||
#include "gles.h"
|
||||
#ifndef skip_glActiveTexture
|
||||
void gl4es_glActiveTexture(GLenum texture) {
|
||||
@@ -40,6 +39,26 @@ void gl4es_glBindBuffer(GLenum target, GLuint buffer) {
|
||||
}
|
||||
void glBindBuffer(GLenum target, GLuint buffer) __attribute__((alias("gl4es_glBindBuffer"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glBindFramebuffer
|
||||
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("gl4es_glBindFramebuffer"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glBindRenderbuffer
|
||||
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("gl4es_glBindRenderbuffer"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glBindTexture
|
||||
void gl4es_glBindTexture(GLenum target, GLuint texture) {
|
||||
LOAD_GLES(glBindTexture);
|
||||
@@ -50,6 +69,36 @@ void gl4es_glBindTexture(GLenum target, GLuint texture) {
|
||||
}
|
||||
void glBindTexture(GLenum target, GLuint texture) __attribute__((alias("gl4es_glBindTexture"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glBlendColor
|
||||
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("gl4es_glBlendColor"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glBlendEquation
|
||||
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("gl4es_glBlendEquation"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glBlendEquationSeparate
|
||||
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("gl4es_glBlendEquationSeparate"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glBlendFunc
|
||||
void gl4es_glBlendFunc(GLenum sfactor, GLenum dfactor) {
|
||||
LOAD_GLES(glBlendFunc);
|
||||
@@ -60,6 +109,16 @@ void gl4es_glBlendFunc(GLenum sfactor, GLenum dfactor) {
|
||||
}
|
||||
void glBlendFunc(GLenum sfactor, GLenum dfactor) __attribute__((alias("gl4es_glBlendFunc"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glBlendFuncSeparate
|
||||
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("gl4es_glBlendFuncSeparate"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glBufferData
|
||||
void gl4es_glBufferData(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage) {
|
||||
LOAD_GLES(glBufferData);
|
||||
@@ -80,6 +139,16 @@ void gl4es_glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, cons
|
||||
}
|
||||
void glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data) __attribute__((alias("gl4es_glBufferSubData"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glCheckFramebufferStatus
|
||||
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("gl4es_glCheckFramebufferStatus"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glClear
|
||||
void gl4es_glClear(GLbitfield mask) {
|
||||
LOAD_GLES(glClear);
|
||||
@@ -280,6 +349,26 @@ void gl4es_glDeleteBuffers(GLsizei n, const GLuint * buffers) {
|
||||
}
|
||||
void glDeleteBuffers(GLsizei n, const GLuint * buffers) __attribute__((alias("gl4es_glDeleteBuffers"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glDeleteFramebuffers
|
||||
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("gl4es_glDeleteFramebuffers"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glDeleteRenderbuffers
|
||||
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("gl4es_glDeleteRenderbuffers"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glDeleteTextures
|
||||
void gl4es_glDeleteTextures(GLsizei n, const GLuint * textures) {
|
||||
LOAD_GLES(glDeleteTextures);
|
||||
@@ -370,6 +459,26 @@ void gl4es_glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid
|
||||
}
|
||||
void glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices) __attribute__((alias("gl4es_glDrawElements"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glDrawTexf
|
||||
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("gl4es_glDrawTexf"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glDrawTexi
|
||||
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("gl4es_glDrawTexi"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glEnable
|
||||
void gl4es_glEnable(GLenum cap) {
|
||||
LOAD_GLES(glEnable);
|
||||
@@ -450,6 +559,26 @@ void gl4es_glFogxv(GLenum pname, const GLfixed * params) {
|
||||
}
|
||||
void glFogxv(GLenum pname, const GLfixed * params) __attribute__((alias("gl4es_glFogxv"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glFramebufferRenderbuffer
|
||||
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("gl4es_glFramebufferRenderbuffer"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glFramebufferTexture2D
|
||||
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("gl4es_glFramebufferTexture2D"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glFrontFace
|
||||
void gl4es_glFrontFace(GLenum mode) {
|
||||
LOAD_GLES(glFrontFace);
|
||||
@@ -490,6 +619,26 @@ void gl4es_glGenBuffers(GLsizei n, GLuint * buffers) {
|
||||
}
|
||||
void glGenBuffers(GLsizei n, GLuint * buffers) __attribute__((alias("gl4es_glGenBuffers"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glGenFramebuffers
|
||||
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("gl4es_glGenFramebuffers"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glGenRenderbuffers
|
||||
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("gl4es_glGenRenderbuffers"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glGenTextures
|
||||
void gl4es_glGenTextures(GLsizei n, GLuint * textures) {
|
||||
LOAD_GLES(glGenTextures);
|
||||
@@ -500,6 +649,16 @@ void gl4es_glGenTextures(GLsizei n, GLuint * textures) {
|
||||
}
|
||||
void glGenTextures(GLsizei n, GLuint * textures) __attribute__((alias("gl4es_glGenTextures"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glGenerateMipmap
|
||||
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("gl4es_glGenerateMipmap"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glGetBooleanv
|
||||
void gl4es_glGetBooleanv(GLenum pname, GLboolean * params) {
|
||||
LOAD_GLES(glGetBooleanv);
|
||||
@@ -570,6 +729,16 @@ void gl4es_glGetFloatv(GLenum pname, GLfloat * params) {
|
||||
}
|
||||
void glGetFloatv(GLenum pname, GLfloat * params) __attribute__((alias("gl4es_glGetFloatv"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glGetFramebufferAttachmentParameteriv
|
||||
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("gl4es_glGetFramebufferAttachmentParameteriv"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glGetIntegerv
|
||||
void gl4es_glGetIntegerv(GLenum pname, GLint * params) {
|
||||
LOAD_GLES(glGetIntegerv);
|
||||
@@ -630,6 +799,16 @@ void gl4es_glGetPointerv(GLenum pname, GLvoid ** params) {
|
||||
}
|
||||
void glGetPointerv(GLenum pname, GLvoid ** params) __attribute__((alias("gl4es_glGetPointerv"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glGetRenderbufferParameteriv
|
||||
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("gl4es_glGetRenderbufferParameteriv"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glGetString
|
||||
const GLubyte * gl4es_glGetString(GLenum name) {
|
||||
LOAD_GLES(glGetString);
|
||||
@@ -730,6 +909,26 @@ GLboolean gl4es_glIsEnabled(GLenum cap) {
|
||||
}
|
||||
GLboolean glIsEnabled(GLenum cap) __attribute__((alias("gl4es_glIsEnabled"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glIsFramebuffer
|
||||
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("gl4es_glIsFramebuffer"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glIsRenderbuffer
|
||||
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("gl4es_glIsRenderbuffer"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glIsTexture
|
||||
GLboolean gl4es_glIsTexture(GLuint texture) {
|
||||
LOAD_GLES(glIsTexture);
|
||||
@@ -950,6 +1149,26 @@ void gl4es_glMultMatrixx(const GLfixed * m) {
|
||||
}
|
||||
void glMultMatrixx(const GLfixed * m) __attribute__((alias("gl4es_glMultMatrixx"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glMultiDrawArrays
|
||||
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("gl4es_glMultiDrawArrays"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glMultiDrawElements
|
||||
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("gl4es_glMultiDrawElements"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glMultiTexCoord4f
|
||||
void gl4es_glMultiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q) {
|
||||
LOAD_GLES(glMultiTexCoord4f);
|
||||
@@ -1150,6 +1369,16 @@ void gl4es_glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum
|
||||
}
|
||||
void glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid * pixels) __attribute__((alias("gl4es_glReadPixels"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glRenderbufferStorage
|
||||
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("gl4es_glRenderbufferStorage"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glRotatef
|
||||
void gl4es_glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z) {
|
||||
LOAD_GLES(glRotatef);
|
||||
@@ -1330,6 +1559,26 @@ void gl4es_glTexEnvxv(GLenum target, GLenum pname, const GLfixed * params) {
|
||||
}
|
||||
void glTexEnvxv(GLenum target, GLenum pname, const GLfixed * params) __attribute__((alias("gl4es_glTexEnvxv"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glTexGenfv
|
||||
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("gl4es_glTexGenfv"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glTexGeni
|
||||
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("gl4es_glTexGeni"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glTexImage2D
|
||||
void gl4es_glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels) {
|
||||
LOAD_GLES(glTexImage2D);
|
||||
@@ -1476,12 +1725,24 @@ void glPackedCall(const packed_call_t *packed) {
|
||||
unpacked->func(args.a1, args.a2);
|
||||
break;
|
||||
}
|
||||
case FORMAT_void_GLclampf_GLclampf_GLclampf_GLclampf: {
|
||||
PACKED_void_GLclampf_GLclampf_GLclampf_GLclampf *unpacked = (PACKED_void_GLclampf_GLclampf_GLclampf_GLclampf *)packed;
|
||||
ARGS_void_GLclampf_GLclampf_GLclampf_GLclampf args = unpacked->args;
|
||||
unpacked->func(args.a1, args.a2, args.a3, args.a4);
|
||||
break;
|
||||
}
|
||||
case FORMAT_void_GLenum_GLenum: {
|
||||
PACKED_void_GLenum_GLenum *unpacked = (PACKED_void_GLenum_GLenum *)packed;
|
||||
ARGS_void_GLenum_GLenum args = unpacked->args;
|
||||
unpacked->func(args.a1, args.a2);
|
||||
break;
|
||||
}
|
||||
case FORMAT_void_GLenum_GLenum_GLenum_GLenum: {
|
||||
PACKED_void_GLenum_GLenum_GLenum_GLenum *unpacked = (PACKED_void_GLenum_GLenum_GLenum_GLenum *)packed;
|
||||
ARGS_void_GLenum_GLenum_GLenum_GLenum args = unpacked->args;
|
||||
unpacked->func(args.a1, args.a2, args.a3, args.a4);
|
||||
break;
|
||||
}
|
||||
case FORMAT_void_GLenum_GLsizeiptr_const_GLvoid___GENPT___GLenum: {
|
||||
PACKED_void_GLenum_GLsizeiptr_const_GLvoid___GENPT___GLenum *unpacked = (PACKED_void_GLenum_GLsizeiptr_const_GLvoid___GENPT___GLenum *)packed;
|
||||
ARGS_void_GLenum_GLsizeiptr_const_GLvoid___GENPT___GLenum args = unpacked->args;
|
||||
@@ -1494,18 +1755,18 @@ void glPackedCall(const packed_call_t *packed) {
|
||||
unpacked->func(args.a1, args.a2, args.a3, args.a4);
|
||||
break;
|
||||
}
|
||||
case FORMAT_GLenum_GLenum: {
|
||||
PACKED_GLenum_GLenum *unpacked = (PACKED_GLenum_GLenum *)packed;
|
||||
ARGS_GLenum_GLenum args = unpacked->args;
|
||||
unpacked->func(args.a1);
|
||||
break;
|
||||
}
|
||||
case FORMAT_void_GLbitfield: {
|
||||
PACKED_void_GLbitfield *unpacked = (PACKED_void_GLbitfield *)packed;
|
||||
ARGS_void_GLbitfield args = unpacked->args;
|
||||
unpacked->func(args.a1);
|
||||
break;
|
||||
}
|
||||
case FORMAT_void_GLclampf_GLclampf_GLclampf_GLclampf: {
|
||||
PACKED_void_GLclampf_GLclampf_GLclampf_GLclampf *unpacked = (PACKED_void_GLclampf_GLclampf_GLclampf_GLclampf *)packed;
|
||||
ARGS_void_GLclampf_GLclampf_GLclampf_GLclampf args = unpacked->args;
|
||||
unpacked->func(args.a1, args.a2, args.a3, args.a4);
|
||||
break;
|
||||
}
|
||||
case FORMAT_void_GLclampx_GLclampx_GLclampx_GLclampx: {
|
||||
PACKED_void_GLclampx_GLclampx_GLclampx_GLclampx *unpacked = (PACKED_void_GLclampx_GLclampx_GLclampx_GLclampx *)packed;
|
||||
ARGS_void_GLclampx_GLclampx_GLclampx_GLclampx args = unpacked->args;
|
||||
@@ -1602,6 +1863,12 @@ void glPackedCall(const packed_call_t *packed) {
|
||||
unpacked->func(args.a1, args.a2);
|
||||
break;
|
||||
}
|
||||
case FORMAT_void_GLsizei_GLuint___GENPT__: {
|
||||
PACKED_void_GLsizei_GLuint___GENPT__ *unpacked = (PACKED_void_GLsizei_GLuint___GENPT__ *)packed;
|
||||
ARGS_void_GLsizei_GLuint___GENPT__ args = unpacked->args;
|
||||
unpacked->func(args.a1, args.a2);
|
||||
break;
|
||||
}
|
||||
case FORMAT_void_GLboolean: {
|
||||
PACKED_void_GLboolean *unpacked = (PACKED_void_GLboolean *)packed;
|
||||
ARGS_void_GLboolean args = unpacked->args;
|
||||
@@ -1632,6 +1899,18 @@ void glPackedCall(const packed_call_t *packed) {
|
||||
unpacked->func(args.a1, args.a2, args.a3, args.a4);
|
||||
break;
|
||||
}
|
||||
case FORMAT_void_GLfloat_GLfloat_GLfloat_GLfloat_GLfloat: {
|
||||
PACKED_void_GLfloat_GLfloat_GLfloat_GLfloat_GLfloat *unpacked = (PACKED_void_GLfloat_GLfloat_GLfloat_GLfloat_GLfloat *)packed;
|
||||
ARGS_void_GLfloat_GLfloat_GLfloat_GLfloat_GLfloat args = unpacked->args;
|
||||
unpacked->func(args.a1, args.a2, args.a3, args.a4, args.a5);
|
||||
break;
|
||||
}
|
||||
case FORMAT_void_GLint_GLint_GLint_GLint_GLint: {
|
||||
PACKED_void_GLint_GLint_GLint_GLint_GLint *unpacked = (PACKED_void_GLint_GLint_GLint_GLint_GLint *)packed;
|
||||
ARGS_void_GLint_GLint_GLint_GLint_GLint args = unpacked->args;
|
||||
unpacked->func(args.a1, args.a2, args.a3, args.a4, args.a5);
|
||||
break;
|
||||
}
|
||||
case FORMAT_void: {
|
||||
PACKED_void *unpacked = (PACKED_void *)packed;
|
||||
unpacked->func();
|
||||
@@ -1649,6 +1928,18 @@ void glPackedCall(const packed_call_t *packed) {
|
||||
unpacked->func(args.a1, args.a2);
|
||||
break;
|
||||
}
|
||||
case FORMAT_void_GLenum_GLenum_GLenum_GLuint: {
|
||||
PACKED_void_GLenum_GLenum_GLenum_GLuint *unpacked = (PACKED_void_GLenum_GLenum_GLenum_GLuint *)packed;
|
||||
ARGS_void_GLenum_GLenum_GLenum_GLuint args = unpacked->args;
|
||||
unpacked->func(args.a1, args.a2, args.a3, args.a4);
|
||||
break;
|
||||
}
|
||||
case FORMAT_void_GLenum_GLenum_GLenum_GLuint_GLint: {
|
||||
PACKED_void_GLenum_GLenum_GLenum_GLuint_GLint *unpacked = (PACKED_void_GLenum_GLenum_GLenum_GLuint_GLint *)packed;
|
||||
ARGS_void_GLenum_GLenum_GLenum_GLuint_GLint args = unpacked->args;
|
||||
unpacked->func(args.a1, args.a2, args.a3, args.a4, args.a5);
|
||||
break;
|
||||
}
|
||||
case FORMAT_void_GLfloat_GLfloat_GLfloat_GLfloat_GLfloat_GLfloat: {
|
||||
PACKED_void_GLfloat_GLfloat_GLfloat_GLfloat_GLfloat_GLfloat *unpacked = (PACKED_void_GLfloat_GLfloat_GLfloat_GLfloat_GLfloat_GLfloat *)packed;
|
||||
ARGS_void_GLfloat_GLfloat_GLfloat_GLfloat_GLfloat_GLfloat args = unpacked->args;
|
||||
@@ -1661,12 +1952,6 @@ void glPackedCall(const packed_call_t *packed) {
|
||||
unpacked->func(args.a1, args.a2, args.a3, args.a4, args.a5, args.a6);
|
||||
break;
|
||||
}
|
||||
case FORMAT_void_GLsizei_GLuint___GENPT__: {
|
||||
PACKED_void_GLsizei_GLuint___GENPT__ *unpacked = (PACKED_void_GLsizei_GLuint___GENPT__ *)packed;
|
||||
ARGS_void_GLsizei_GLuint___GENPT__ args = unpacked->args;
|
||||
unpacked->func(args.a1, args.a2);
|
||||
break;
|
||||
}
|
||||
case FORMAT_void_GLenum_GLboolean___GENPT__: {
|
||||
PACKED_void_GLenum_GLboolean___GENPT__ *unpacked = (PACKED_void_GLenum_GLboolean___GENPT__ *)packed;
|
||||
ARGS_void_GLenum_GLboolean___GENPT__ args = unpacked->args;
|
||||
@@ -1696,6 +1981,12 @@ void glPackedCall(const packed_call_t *packed) {
|
||||
unpacked->func();
|
||||
break;
|
||||
}
|
||||
case FORMAT_void_GLenum_GLenum_GLenum_GLint___GENPT__: {
|
||||
PACKED_void_GLenum_GLenum_GLenum_GLint___GENPT__ *unpacked = (PACKED_void_GLenum_GLenum_GLenum_GLint___GENPT__ *)packed;
|
||||
ARGS_void_GLenum_GLenum_GLenum_GLint___GENPT__ args = unpacked->args;
|
||||
unpacked->func(args.a1, args.a2, args.a3, args.a4);
|
||||
break;
|
||||
}
|
||||
case FORMAT_void_GLenum_GLint___GENPT__: {
|
||||
PACKED_void_GLenum_GLint___GENPT__ *unpacked = (PACKED_void_GLenum_GLint___GENPT__ *)packed;
|
||||
ARGS_void_GLenum_GLint___GENPT__ args = unpacked->args;
|
||||
@@ -1786,6 +2077,18 @@ void glPackedCall(const packed_call_t *packed) {
|
||||
unpacked->func(args.a1);
|
||||
break;
|
||||
}
|
||||
case FORMAT_void_GLenum_const_GLint___GENPT___const_GLsizei___GENPT___GLsizei: {
|
||||
PACKED_void_GLenum_const_GLint___GENPT___const_GLsizei___GENPT___GLsizei *unpacked = (PACKED_void_GLenum_const_GLint___GENPT___const_GLsizei___GENPT___GLsizei *)packed;
|
||||
ARGS_void_GLenum_const_GLint___GENPT___const_GLsizei___GENPT___GLsizei args = unpacked->args;
|
||||
unpacked->func(args.a1, args.a2, args.a3, args.a4);
|
||||
break;
|
||||
}
|
||||
case FORMAT_void_GLenum_GLsizei___GENPT___GLenum_const_void___GENPT___const___GENPT___GLsizei: {
|
||||
PACKED_void_GLenum_GLsizei___GENPT___GLenum_const_void___GENPT___const___GENPT___GLsizei *unpacked = (PACKED_void_GLenum_GLsizei___GENPT___GLenum_const_void___GENPT___const___GENPT___GLsizei *)packed;
|
||||
ARGS_void_GLenum_GLsizei___GENPT___GLenum_const_void___GENPT___const___GENPT___GLsizei args = unpacked->args;
|
||||
unpacked->func(args.a1, args.a2, args.a3, args.a4, args.a5);
|
||||
break;
|
||||
}
|
||||
case FORMAT_void_GLenum_GLfloat_GLfloat_GLfloat_GLfloat: {
|
||||
PACKED_void_GLenum_GLfloat_GLfloat_GLfloat_GLfloat *unpacked = (PACKED_void_GLenum_GLfloat_GLfloat_GLfloat_GLfloat *)packed;
|
||||
ARGS_void_GLenum_GLfloat_GLfloat_GLfloat_GLfloat args = unpacked->args;
|
||||
@@ -1840,6 +2143,12 @@ void glPackedCall(const packed_call_t *packed) {
|
||||
unpacked->func(args.a1, args.a2, args.a3, args.a4, args.a5, args.a6, args.a7);
|
||||
break;
|
||||
}
|
||||
case FORMAT_void_GLenum_GLenum_GLsizei_GLsizei: {
|
||||
PACKED_void_GLenum_GLenum_GLsizei_GLsizei *unpacked = (PACKED_void_GLenum_GLenum_GLsizei_GLsizei *)packed;
|
||||
ARGS_void_GLenum_GLenum_GLsizei_GLsizei args = unpacked->args;
|
||||
unpacked->func(args.a1, args.a2, args.a3, args.a4);
|
||||
break;
|
||||
}
|
||||
case FORMAT_void_GLclampf_GLboolean: {
|
||||
PACKED_void_GLclampf_GLboolean *unpacked = (PACKED_void_GLclampf_GLboolean *)packed;
|
||||
ARGS_void_GLclampf_GLboolean args = unpacked->args;
|
||||
@@ -1933,6 +2242,13 @@ packed_call_t* glCopyPackedCall(const packed_call_t *packed) {
|
||||
return (packed_call_t*)newpacked;
|
||||
break;
|
||||
}
|
||||
case FORMAT_void_GLclampf_GLclampf_GLclampf_GLclampf: {
|
||||
int sizeofpacked = sizeof(PACKED_void_GLclampf_GLclampf_GLclampf_GLclampf);
|
||||
PACKED_void_GLclampf_GLclampf_GLclampf_GLclampf *newpacked = (PACKED_void_GLclampf_GLclampf_GLclampf_GLclampf*)malloc(sizeofpacked);
|
||||
memcpy(newpacked, packed, sizeofpacked);
|
||||
return (packed_call_t*)newpacked;
|
||||
break;
|
||||
}
|
||||
case FORMAT_void_GLenum_GLenum: {
|
||||
int sizeofpacked = sizeof(PACKED_void_GLenum_GLenum);
|
||||
PACKED_void_GLenum_GLenum *newpacked = (PACKED_void_GLenum_GLenum*)malloc(sizeofpacked);
|
||||
@@ -1940,6 +2256,13 @@ packed_call_t* glCopyPackedCall(const packed_call_t *packed) {
|
||||
return (packed_call_t*)newpacked;
|
||||
break;
|
||||
}
|
||||
case FORMAT_void_GLenum_GLenum_GLenum_GLenum: {
|
||||
int sizeofpacked = sizeof(PACKED_void_GLenum_GLenum_GLenum_GLenum);
|
||||
PACKED_void_GLenum_GLenum_GLenum_GLenum *newpacked = (PACKED_void_GLenum_GLenum_GLenum_GLenum*)malloc(sizeofpacked);
|
||||
memcpy(newpacked, packed, sizeofpacked);
|
||||
return (packed_call_t*)newpacked;
|
||||
break;
|
||||
}
|
||||
case FORMAT_void_GLenum_GLsizeiptr_const_GLvoid___GENPT___GLenum: {
|
||||
int sizeofpacked = sizeof(PACKED_void_GLenum_GLsizeiptr_const_GLvoid___GENPT___GLenum);
|
||||
PACKED_void_GLenum_GLsizeiptr_const_GLvoid___GENPT___GLenum *newpacked = (PACKED_void_GLenum_GLsizeiptr_const_GLvoid___GENPT___GLenum*)malloc(sizeofpacked);
|
||||
@@ -1954,16 +2277,16 @@ packed_call_t* glCopyPackedCall(const packed_call_t *packed) {
|
||||
return (packed_call_t*)newpacked;
|
||||
break;
|
||||
}
|
||||
case FORMAT_void_GLbitfield: {
|
||||
int sizeofpacked = sizeof(PACKED_void_GLbitfield);
|
||||
PACKED_void_GLbitfield *newpacked = (PACKED_void_GLbitfield*)malloc(sizeofpacked);
|
||||
case FORMAT_GLenum_GLenum: {
|
||||
int sizeofpacked = sizeof(PACKED_GLenum_GLenum);
|
||||
PACKED_GLenum_GLenum *newpacked = (PACKED_GLenum_GLenum*)malloc(sizeofpacked);
|
||||
memcpy(newpacked, packed, sizeofpacked);
|
||||
return (packed_call_t*)newpacked;
|
||||
break;
|
||||
}
|
||||
case FORMAT_void_GLclampf_GLclampf_GLclampf_GLclampf: {
|
||||
int sizeofpacked = sizeof(PACKED_void_GLclampf_GLclampf_GLclampf_GLclampf);
|
||||
PACKED_void_GLclampf_GLclampf_GLclampf_GLclampf *newpacked = (PACKED_void_GLclampf_GLclampf_GLclampf_GLclampf*)malloc(sizeofpacked);
|
||||
case FORMAT_void_GLbitfield: {
|
||||
int sizeofpacked = sizeof(PACKED_void_GLbitfield);
|
||||
PACKED_void_GLbitfield *newpacked = (PACKED_void_GLbitfield*)malloc(sizeofpacked);
|
||||
memcpy(newpacked, packed, sizeofpacked);
|
||||
return (packed_call_t*)newpacked;
|
||||
break;
|
||||
@@ -2080,6 +2403,13 @@ packed_call_t* glCopyPackedCall(const packed_call_t *packed) {
|
||||
return (packed_call_t*)newpacked;
|
||||
break;
|
||||
}
|
||||
case FORMAT_void_GLsizei_GLuint___GENPT__: {
|
||||
int sizeofpacked = sizeof(PACKED_void_GLsizei_GLuint___GENPT__);
|
||||
PACKED_void_GLsizei_GLuint___GENPT__ *newpacked = (PACKED_void_GLsizei_GLuint___GENPT__*)malloc(sizeofpacked);
|
||||
memcpy(newpacked, packed, sizeofpacked);
|
||||
return (packed_call_t*)newpacked;
|
||||
break;
|
||||
}
|
||||
case FORMAT_void_GLboolean: {
|
||||
int sizeofpacked = sizeof(PACKED_void_GLboolean);
|
||||
PACKED_void_GLboolean *newpacked = (PACKED_void_GLboolean*)malloc(sizeofpacked);
|
||||
@@ -2115,6 +2445,20 @@ packed_call_t* glCopyPackedCall(const packed_call_t *packed) {
|
||||
return (packed_call_t*)newpacked;
|
||||
break;
|
||||
}
|
||||
case FORMAT_void_GLfloat_GLfloat_GLfloat_GLfloat_GLfloat: {
|
||||
int sizeofpacked = sizeof(PACKED_void_GLfloat_GLfloat_GLfloat_GLfloat_GLfloat);
|
||||
PACKED_void_GLfloat_GLfloat_GLfloat_GLfloat_GLfloat *newpacked = (PACKED_void_GLfloat_GLfloat_GLfloat_GLfloat_GLfloat*)malloc(sizeofpacked);
|
||||
memcpy(newpacked, packed, sizeofpacked);
|
||||
return (packed_call_t*)newpacked;
|
||||
break;
|
||||
}
|
||||
case FORMAT_void_GLint_GLint_GLint_GLint_GLint: {
|
||||
int sizeofpacked = sizeof(PACKED_void_GLint_GLint_GLint_GLint_GLint);
|
||||
PACKED_void_GLint_GLint_GLint_GLint_GLint *newpacked = (PACKED_void_GLint_GLint_GLint_GLint_GLint*)malloc(sizeofpacked);
|
||||
memcpy(newpacked, packed, sizeofpacked);
|
||||
return (packed_call_t*)newpacked;
|
||||
break;
|
||||
}
|
||||
case FORMAT_void: {
|
||||
int sizeofpacked = sizeof(PACKED_void);
|
||||
PACKED_void *newpacked = (PACKED_void*)malloc(sizeofpacked);
|
||||
@@ -2136,6 +2480,20 @@ packed_call_t* glCopyPackedCall(const packed_call_t *packed) {
|
||||
return (packed_call_t*)newpacked;
|
||||
break;
|
||||
}
|
||||
case FORMAT_void_GLenum_GLenum_GLenum_GLuint: {
|
||||
int sizeofpacked = sizeof(PACKED_void_GLenum_GLenum_GLenum_GLuint);
|
||||
PACKED_void_GLenum_GLenum_GLenum_GLuint *newpacked = (PACKED_void_GLenum_GLenum_GLenum_GLuint*)malloc(sizeofpacked);
|
||||
memcpy(newpacked, packed, sizeofpacked);
|
||||
return (packed_call_t*)newpacked;
|
||||
break;
|
||||
}
|
||||
case FORMAT_void_GLenum_GLenum_GLenum_GLuint_GLint: {
|
||||
int sizeofpacked = sizeof(PACKED_void_GLenum_GLenum_GLenum_GLuint_GLint);
|
||||
PACKED_void_GLenum_GLenum_GLenum_GLuint_GLint *newpacked = (PACKED_void_GLenum_GLenum_GLenum_GLuint_GLint*)malloc(sizeofpacked);
|
||||
memcpy(newpacked, packed, sizeofpacked);
|
||||
return (packed_call_t*)newpacked;
|
||||
break;
|
||||
}
|
||||
case FORMAT_void_GLfloat_GLfloat_GLfloat_GLfloat_GLfloat_GLfloat: {
|
||||
int sizeofpacked = sizeof(PACKED_void_GLfloat_GLfloat_GLfloat_GLfloat_GLfloat_GLfloat);
|
||||
PACKED_void_GLfloat_GLfloat_GLfloat_GLfloat_GLfloat_GLfloat *newpacked = (PACKED_void_GLfloat_GLfloat_GLfloat_GLfloat_GLfloat_GLfloat*)malloc(sizeofpacked);
|
||||
@@ -2150,13 +2508,6 @@ packed_call_t* glCopyPackedCall(const packed_call_t *packed) {
|
||||
return (packed_call_t*)newpacked;
|
||||
break;
|
||||
}
|
||||
case FORMAT_void_GLsizei_GLuint___GENPT__: {
|
||||
int sizeofpacked = sizeof(PACKED_void_GLsizei_GLuint___GENPT__);
|
||||
PACKED_void_GLsizei_GLuint___GENPT__ *newpacked = (PACKED_void_GLsizei_GLuint___GENPT__*)malloc(sizeofpacked);
|
||||
memcpy(newpacked, packed, sizeofpacked);
|
||||
return (packed_call_t*)newpacked;
|
||||
break;
|
||||
}
|
||||
case FORMAT_void_GLenum_GLboolean___GENPT__: {
|
||||
int sizeofpacked = sizeof(PACKED_void_GLenum_GLboolean___GENPT__);
|
||||
PACKED_void_GLenum_GLboolean___GENPT__ *newpacked = (PACKED_void_GLenum_GLboolean___GENPT__*)malloc(sizeofpacked);
|
||||
@@ -2192,6 +2543,13 @@ packed_call_t* glCopyPackedCall(const packed_call_t *packed) {
|
||||
return (packed_call_t*)newpacked;
|
||||
break;
|
||||
}
|
||||
case FORMAT_void_GLenum_GLenum_GLenum_GLint___GENPT__: {
|
||||
int sizeofpacked = sizeof(PACKED_void_GLenum_GLenum_GLenum_GLint___GENPT__);
|
||||
PACKED_void_GLenum_GLenum_GLenum_GLint___GENPT__ *newpacked = (PACKED_void_GLenum_GLenum_GLenum_GLint___GENPT__*)malloc(sizeofpacked);
|
||||
memcpy(newpacked, packed, sizeofpacked);
|
||||
return (packed_call_t*)newpacked;
|
||||
break;
|
||||
}
|
||||
case FORMAT_void_GLenum_GLint___GENPT__: {
|
||||
int sizeofpacked = sizeof(PACKED_void_GLenum_GLint___GENPT__);
|
||||
PACKED_void_GLenum_GLint___GENPT__ *newpacked = (PACKED_void_GLenum_GLint___GENPT__*)malloc(sizeofpacked);
|
||||
@@ -2297,6 +2655,20 @@ packed_call_t* glCopyPackedCall(const packed_call_t *packed) {
|
||||
return (packed_call_t*)newpacked;
|
||||
break;
|
||||
}
|
||||
case FORMAT_void_GLenum_const_GLint___GENPT___const_GLsizei___GENPT___GLsizei: {
|
||||
int sizeofpacked = sizeof(PACKED_void_GLenum_const_GLint___GENPT___const_GLsizei___GENPT___GLsizei);
|
||||
PACKED_void_GLenum_const_GLint___GENPT___const_GLsizei___GENPT___GLsizei *newpacked = (PACKED_void_GLenum_const_GLint___GENPT___const_GLsizei___GENPT___GLsizei*)malloc(sizeofpacked);
|
||||
memcpy(newpacked, packed, sizeofpacked);
|
||||
return (packed_call_t*)newpacked;
|
||||
break;
|
||||
}
|
||||
case FORMAT_void_GLenum_GLsizei___GENPT___GLenum_const_void___GENPT___const___GENPT___GLsizei: {
|
||||
int sizeofpacked = sizeof(PACKED_void_GLenum_GLsizei___GENPT___GLenum_const_void___GENPT___const___GENPT___GLsizei);
|
||||
PACKED_void_GLenum_GLsizei___GENPT___GLenum_const_void___GENPT___const___GENPT___GLsizei *newpacked = (PACKED_void_GLenum_GLsizei___GENPT___GLenum_const_void___GENPT___const___GENPT___GLsizei*)malloc(sizeofpacked);
|
||||
memcpy(newpacked, packed, sizeofpacked);
|
||||
return (packed_call_t*)newpacked;
|
||||
break;
|
||||
}
|
||||
case FORMAT_void_GLenum_GLfloat_GLfloat_GLfloat_GLfloat: {
|
||||
int sizeofpacked = sizeof(PACKED_void_GLenum_GLfloat_GLfloat_GLfloat_GLfloat);
|
||||
PACKED_void_GLenum_GLfloat_GLfloat_GLfloat_GLfloat *newpacked = (PACKED_void_GLenum_GLfloat_GLfloat_GLfloat_GLfloat*)malloc(sizeofpacked);
|
||||
@@ -2360,6 +2732,13 @@ packed_call_t* glCopyPackedCall(const packed_call_t *packed) {
|
||||
return (packed_call_t*)newpacked;
|
||||
break;
|
||||
}
|
||||
case FORMAT_void_GLenum_GLenum_GLsizei_GLsizei: {
|
||||
int sizeofpacked = sizeof(PACKED_void_GLenum_GLenum_GLsizei_GLsizei);
|
||||
PACKED_void_GLenum_GLenum_GLsizei_GLsizei *newpacked = (PACKED_void_GLenum_GLenum_GLsizei_GLsizei*)malloc(sizeofpacked);
|
||||
memcpy(newpacked, packed, sizeofpacked);
|
||||
return (packed_call_t*)newpacked;
|
||||
break;
|
||||
}
|
||||
case FORMAT_void_GLclampf_GLboolean: {
|
||||
int sizeofpacked = sizeof(PACKED_void_GLclampf_GLboolean);
|
||||
PACKED_void_GLclampf_GLboolean *newpacked = (PACKED_void_GLclampf_GLboolean*)malloc(sizeofpacked);
|
||||
@@ -2432,5 +2811,3 @@ packed_call_t* glCopyPackedCall(const packed_call_t *packed) {
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
#endif
|
||||
|
||||
411
project/jni/gl4es/src/gl/wrap/gles.h
Executable file → Normal file
411
project/jni/gl4es/src/gl/wrap/gles.h
Executable file → Normal file
@@ -1,4 +1,3 @@
|
||||
#ifndef USE_ES2
|
||||
#include "../gl.h"
|
||||
|
||||
#ifndef GLESWRAP_H
|
||||
@@ -20,11 +19,13 @@ enum FORMAT {
|
||||
FORMAT_void_GLenum_GLclampf,
|
||||
FORMAT_void_GLenum_GLclampx,
|
||||
FORMAT_void_GLenum_GLuint,
|
||||
FORMAT_void_GLclampf_GLclampf_GLclampf_GLclampf,
|
||||
FORMAT_void_GLenum_GLenum,
|
||||
FORMAT_void_GLenum_GLenum_GLenum_GLenum,
|
||||
FORMAT_void_GLenum_GLsizeiptr_const_GLvoid___GENPT___GLenum,
|
||||
FORMAT_void_GLenum_GLintptr_GLsizeiptr_const_GLvoid___GENPT__,
|
||||
FORMAT_GLenum_GLenum,
|
||||
FORMAT_void_GLbitfield,
|
||||
FORMAT_void_GLclampf_GLclampf_GLclampf_GLclampf,
|
||||
FORMAT_void_GLclampx_GLclampx_GLclampx_GLclampx,
|
||||
FORMAT_void_GLclampf,
|
||||
FORMAT_void_GLclampx,
|
||||
@@ -41,22 +42,27 @@ enum FORMAT {
|
||||
FORMAT_void_GLenum_GLint_GLenum_GLint_GLint_GLsizei_GLsizei_GLint,
|
||||
FORMAT_void_GLenum_GLint_GLint_GLint_GLint_GLint_GLsizei_GLsizei,
|
||||
FORMAT_void_GLsizei_const_GLuint___GENPT__,
|
||||
FORMAT_void_GLsizei_GLuint___GENPT__,
|
||||
FORMAT_void_GLboolean,
|
||||
FORMAT_void_GLclampf_GLclampf,
|
||||
FORMAT_void_GLclampx_GLclampx,
|
||||
FORMAT_void_GLenum_GLint_GLsizei,
|
||||
FORMAT_void_GLenum_GLsizei_GLenum_const_GLvoid___GENPT__,
|
||||
FORMAT_void_GLfloat_GLfloat_GLfloat_GLfloat_GLfloat,
|
||||
FORMAT_void_GLint_GLint_GLint_GLint_GLint,
|
||||
FORMAT_void,
|
||||
FORMAT_void_GLenum_GLfloat,
|
||||
FORMAT_void_GLenum_GLfixed,
|
||||
FORMAT_void_GLenum_GLenum_GLenum_GLuint,
|
||||
FORMAT_void_GLenum_GLenum_GLenum_GLuint_GLint,
|
||||
FORMAT_void_GLfloat_GLfloat_GLfloat_GLfloat_GLfloat_GLfloat,
|
||||
FORMAT_void_GLfixed_GLfixed_GLfixed_GLfixed_GLfixed_GLfixed,
|
||||
FORMAT_void_GLsizei_GLuint___GENPT__,
|
||||
FORMAT_void_GLenum_GLboolean___GENPT__,
|
||||
FORMAT_void_GLenum_GLenum_GLint___GENPT__,
|
||||
FORMAT_void_GLenum_GLfloat___GENPT__,
|
||||
FORMAT_void_GLenum_GLfixed___GENPT__,
|
||||
FORMAT_GLenum,
|
||||
FORMAT_void_GLenum_GLenum_GLenum_GLint___GENPT__,
|
||||
FORMAT_void_GLenum_GLint___GENPT__,
|
||||
FORMAT_void_GLenum_GLenum_GLfloat___GENPT__,
|
||||
FORMAT_void_GLenum_GLenum_GLfixed___GENPT__,
|
||||
@@ -72,6 +78,8 @@ enum FORMAT {
|
||||
FORMAT_void_GLfixed,
|
||||
FORMAT_void_const_GLfloat___GENPT__,
|
||||
FORMAT_void_const_GLfixed___GENPT__,
|
||||
FORMAT_void_GLenum_const_GLint___GENPT___const_GLsizei___GENPT___GLsizei,
|
||||
FORMAT_void_GLenum_GLsizei___GENPT___GLenum_const_void___GENPT___const___GENPT___GLsizei,
|
||||
FORMAT_void_GLenum_GLfloat_GLfloat_GLfloat_GLfloat,
|
||||
FORMAT_void_GLenum_GLfixed_GLfixed_GLfixed_GLfixed,
|
||||
FORMAT_void_GLfloat_GLfloat_GLfloat,
|
||||
@@ -81,6 +89,7 @@ enum FORMAT {
|
||||
FORMAT_void_GLfloat_GLfloat,
|
||||
FORMAT_void_GLfixed_GLfixed,
|
||||
FORMAT_void_GLint_GLint_GLsizei_GLsizei_GLenum_GLenum_GLvoid___GENPT__,
|
||||
FORMAT_void_GLenum_GLenum_GLsizei_GLsizei,
|
||||
FORMAT_void_GLclampf_GLboolean,
|
||||
FORMAT_void_GLclampx_GLboolean,
|
||||
FORMAT_void_GLint_GLint_GLsizei_GLsizei,
|
||||
@@ -91,16 +100,6 @@ enum FORMAT {
|
||||
FORMAT_void_GLenum_GLenum_const_GLint___GENPT__,
|
||||
FORMAT_void_GLenum_GLint_GLint_GLsizei_GLsizei_GLint_GLenum_GLenum_const_GLvoid___GENPT__,
|
||||
FORMAT_void_GLenum_GLint_GLint_GLint_GLsizei_GLsizei_GLenum_GLenum_const_GLvoid___GENPT__,
|
||||
FORMAT_void_GLenum_GLenum_GLenum_GLenum,
|
||||
FORMAT_GLenum_GLenum,
|
||||
FORMAT_void_GLfloat_GLfloat_GLfloat_GLfloat_GLfloat,
|
||||
FORMAT_void_GLint_GLint_GLint_GLint_GLint,
|
||||
FORMAT_void_GLenum_GLenum_GLenum_GLuint,
|
||||
FORMAT_void_GLenum_GLenum_GLenum_GLuint_GLint,
|
||||
FORMAT_void_GLenum_GLenum_GLenum_GLint___GENPT__,
|
||||
FORMAT_void_GLenum_const_GLint___GENPT___const_GLsizei___GENPT___GLsizei,
|
||||
FORMAT_void_GLenum_GLsizei___GENPT___GLenum_const_void___GENPT___const___GENPT___GLsizei,
|
||||
FORMAT_void_GLenum_GLenum_GLsizei_GLsizei,
|
||||
};
|
||||
|
||||
typedef void (*FUNC_void_GLenum)(GLenum texture);
|
||||
@@ -158,7 +157,23 @@ typedef struct {
|
||||
int func;
|
||||
ARGS_void_GLenum_GLuint args;
|
||||
} INDEXED_void_GLenum_GLuint;
|
||||
typedef void (*FUNC_void_GLenum_GLenum)(GLenum sfactor, GLenum dfactor);
|
||||
typedef void (*FUNC_void_GLclampf_GLclampf_GLclampf_GLclampf)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
|
||||
typedef struct {
|
||||
GLclampf a1;
|
||||
GLclampf a2;
|
||||
GLclampf a3;
|
||||
GLclampf a4;
|
||||
} ARGS_void_GLclampf_GLclampf_GLclampf_GLclampf;
|
||||
typedef struct {
|
||||
int format;
|
||||
FUNC_void_GLclampf_GLclampf_GLclampf_GLclampf func;
|
||||
ARGS_void_GLclampf_GLclampf_GLclampf_GLclampf args;
|
||||
} PACKED_void_GLclampf_GLclampf_GLclampf_GLclampf;
|
||||
typedef struct {
|
||||
int func;
|
||||
ARGS_void_GLclampf_GLclampf_GLclampf_GLclampf args;
|
||||
} INDEXED_void_GLclampf_GLclampf_GLclampf_GLclampf;
|
||||
typedef void (*FUNC_void_GLenum_GLenum)(GLenum modeRGB, GLenum modeA);
|
||||
typedef struct {
|
||||
GLenum a1;
|
||||
GLenum a2;
|
||||
@@ -172,6 +187,22 @@ typedef struct {
|
||||
int func;
|
||||
ARGS_void_GLenum_GLenum args;
|
||||
} INDEXED_void_GLenum_GLenum;
|
||||
typedef void (*FUNC_void_GLenum_GLenum_GLenum_GLenum)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
|
||||
typedef struct {
|
||||
GLenum a1;
|
||||
GLenum a2;
|
||||
GLenum a3;
|
||||
GLenum a4;
|
||||
} ARGS_void_GLenum_GLenum_GLenum_GLenum;
|
||||
typedef struct {
|
||||
int format;
|
||||
FUNC_void_GLenum_GLenum_GLenum_GLenum func;
|
||||
ARGS_void_GLenum_GLenum_GLenum_GLenum args;
|
||||
} PACKED_void_GLenum_GLenum_GLenum_GLenum;
|
||||
typedef struct {
|
||||
int func;
|
||||
ARGS_void_GLenum_GLenum_GLenum_GLenum args;
|
||||
} INDEXED_void_GLenum_GLenum_GLenum_GLenum;
|
||||
typedef void (*FUNC_void_GLenum_GLsizeiptr_const_GLvoid___GENPT___GLenum)(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage);
|
||||
typedef struct {
|
||||
GLenum a1;
|
||||
@@ -204,6 +235,19 @@ typedef struct {
|
||||
int func;
|
||||
ARGS_void_GLenum_GLintptr_GLsizeiptr_const_GLvoid___GENPT__ args;
|
||||
} INDEXED_void_GLenum_GLintptr_GLsizeiptr_const_GLvoid___GENPT__;
|
||||
typedef GLenum (*FUNC_GLenum_GLenum)(GLenum target);
|
||||
typedef struct {
|
||||
GLenum a1;
|
||||
} ARGS_GLenum_GLenum;
|
||||
typedef struct {
|
||||
int format;
|
||||
FUNC_GLenum_GLenum func;
|
||||
ARGS_GLenum_GLenum args;
|
||||
} PACKED_GLenum_GLenum;
|
||||
typedef struct {
|
||||
int func;
|
||||
ARGS_GLenum_GLenum args;
|
||||
} INDEXED_GLenum_GLenum;
|
||||
typedef void (*FUNC_void_GLbitfield)(GLbitfield mask);
|
||||
typedef struct {
|
||||
GLbitfield a1;
|
||||
@@ -217,22 +261,6 @@ typedef struct {
|
||||
int func;
|
||||
ARGS_void_GLbitfield args;
|
||||
} INDEXED_void_GLbitfield;
|
||||
typedef void (*FUNC_void_GLclampf_GLclampf_GLclampf_GLclampf)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
|
||||
typedef struct {
|
||||
GLclampf a1;
|
||||
GLclampf a2;
|
||||
GLclampf a3;
|
||||
GLclampf a4;
|
||||
} ARGS_void_GLclampf_GLclampf_GLclampf_GLclampf;
|
||||
typedef struct {
|
||||
int format;
|
||||
FUNC_void_GLclampf_GLclampf_GLclampf_GLclampf func;
|
||||
ARGS_void_GLclampf_GLclampf_GLclampf_GLclampf args;
|
||||
} PACKED_void_GLclampf_GLclampf_GLclampf_GLclampf;
|
||||
typedef struct {
|
||||
int func;
|
||||
ARGS_void_GLclampf_GLclampf_GLclampf_GLclampf args;
|
||||
} INDEXED_void_GLclampf_GLclampf_GLclampf_GLclampf;
|
||||
typedef void (*FUNC_void_GLclampx_GLclampx_GLclampx_GLclampx)(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha);
|
||||
typedef struct {
|
||||
GLclampx a1;
|
||||
@@ -491,6 +519,20 @@ typedef struct {
|
||||
int func;
|
||||
ARGS_void_GLsizei_const_GLuint___GENPT__ args;
|
||||
} INDEXED_void_GLsizei_const_GLuint___GENPT__;
|
||||
typedef void (*FUNC_void_GLsizei_GLuint___GENPT__)(GLsizei n, GLuint * framebuffers);
|
||||
typedef struct {
|
||||
GLsizei a1;
|
||||
GLuint * a2;
|
||||
} ARGS_void_GLsizei_GLuint___GENPT__;
|
||||
typedef struct {
|
||||
int format;
|
||||
FUNC_void_GLsizei_GLuint___GENPT__ func;
|
||||
ARGS_void_GLsizei_GLuint___GENPT__ args;
|
||||
} PACKED_void_GLsizei_GLuint___GENPT__;
|
||||
typedef struct {
|
||||
int func;
|
||||
ARGS_void_GLsizei_GLuint___GENPT__ args;
|
||||
} INDEXED_void_GLsizei_GLuint___GENPT__;
|
||||
typedef void (*FUNC_void_GLboolean)(GLboolean flag);
|
||||
typedef struct {
|
||||
GLboolean a1;
|
||||
@@ -563,6 +605,40 @@ typedef struct {
|
||||
int func;
|
||||
ARGS_void_GLenum_GLsizei_GLenum_const_GLvoid___GENPT__ args;
|
||||
} INDEXED_void_GLenum_GLsizei_GLenum_const_GLvoid___GENPT__;
|
||||
typedef void (*FUNC_void_GLfloat_GLfloat_GLfloat_GLfloat_GLfloat)(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height);
|
||||
typedef struct {
|
||||
GLfloat a1;
|
||||
GLfloat a2;
|
||||
GLfloat a3;
|
||||
GLfloat a4;
|
||||
GLfloat a5;
|
||||
} ARGS_void_GLfloat_GLfloat_GLfloat_GLfloat_GLfloat;
|
||||
typedef struct {
|
||||
int format;
|
||||
FUNC_void_GLfloat_GLfloat_GLfloat_GLfloat_GLfloat func;
|
||||
ARGS_void_GLfloat_GLfloat_GLfloat_GLfloat_GLfloat args;
|
||||
} PACKED_void_GLfloat_GLfloat_GLfloat_GLfloat_GLfloat;
|
||||
typedef struct {
|
||||
int func;
|
||||
ARGS_void_GLfloat_GLfloat_GLfloat_GLfloat_GLfloat args;
|
||||
} INDEXED_void_GLfloat_GLfloat_GLfloat_GLfloat_GLfloat;
|
||||
typedef void (*FUNC_void_GLint_GLint_GLint_GLint_GLint)(GLint x, GLint y, GLint z, GLint width, GLint height);
|
||||
typedef struct {
|
||||
GLint a1;
|
||||
GLint a2;
|
||||
GLint a3;
|
||||
GLint a4;
|
||||
GLint a5;
|
||||
} ARGS_void_GLint_GLint_GLint_GLint_GLint;
|
||||
typedef struct {
|
||||
int format;
|
||||
FUNC_void_GLint_GLint_GLint_GLint_GLint func;
|
||||
ARGS_void_GLint_GLint_GLint_GLint_GLint args;
|
||||
} PACKED_void_GLint_GLint_GLint_GLint_GLint;
|
||||
typedef struct {
|
||||
int func;
|
||||
ARGS_void_GLint_GLint_GLint_GLint_GLint args;
|
||||
} INDEXED_void_GLint_GLint_GLint_GLint_GLint;
|
||||
typedef void (*FUNC_void)();
|
||||
typedef struct {
|
||||
int format;
|
||||
@@ -599,6 +675,39 @@ typedef struct {
|
||||
int func;
|
||||
ARGS_void_GLenum_GLfixed args;
|
||||
} INDEXED_void_GLenum_GLfixed;
|
||||
typedef void (*FUNC_void_GLenum_GLenum_GLenum_GLuint)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
|
||||
typedef struct {
|
||||
GLenum a1;
|
||||
GLenum a2;
|
||||
GLenum a3;
|
||||
GLuint a4;
|
||||
} ARGS_void_GLenum_GLenum_GLenum_GLuint;
|
||||
typedef struct {
|
||||
int format;
|
||||
FUNC_void_GLenum_GLenum_GLenum_GLuint func;
|
||||
ARGS_void_GLenum_GLenum_GLenum_GLuint args;
|
||||
} PACKED_void_GLenum_GLenum_GLenum_GLuint;
|
||||
typedef struct {
|
||||
int func;
|
||||
ARGS_void_GLenum_GLenum_GLenum_GLuint args;
|
||||
} INDEXED_void_GLenum_GLenum_GLenum_GLuint;
|
||||
typedef void (*FUNC_void_GLenum_GLenum_GLenum_GLuint_GLint)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
||||
typedef struct {
|
||||
GLenum a1;
|
||||
GLenum a2;
|
||||
GLenum a3;
|
||||
GLuint a4;
|
||||
GLint a5;
|
||||
} ARGS_void_GLenum_GLenum_GLenum_GLuint_GLint;
|
||||
typedef struct {
|
||||
int format;
|
||||
FUNC_void_GLenum_GLenum_GLenum_GLuint_GLint func;
|
||||
ARGS_void_GLenum_GLenum_GLenum_GLuint_GLint args;
|
||||
} PACKED_void_GLenum_GLenum_GLenum_GLuint_GLint;
|
||||
typedef struct {
|
||||
int func;
|
||||
ARGS_void_GLenum_GLenum_GLenum_GLuint_GLint args;
|
||||
} INDEXED_void_GLenum_GLenum_GLenum_GLuint_GLint;
|
||||
typedef void (*FUNC_void_GLfloat_GLfloat_GLfloat_GLfloat_GLfloat_GLfloat)(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat near, GLfloat far);
|
||||
typedef struct {
|
||||
GLfloat a1;
|
||||
@@ -635,20 +744,6 @@ typedef struct {
|
||||
int func;
|
||||
ARGS_void_GLfixed_GLfixed_GLfixed_GLfixed_GLfixed_GLfixed args;
|
||||
} INDEXED_void_GLfixed_GLfixed_GLfixed_GLfixed_GLfixed_GLfixed;
|
||||
typedef void (*FUNC_void_GLsizei_GLuint___GENPT__)(GLsizei n, GLuint * buffers);
|
||||
typedef struct {
|
||||
GLsizei a1;
|
||||
GLuint * a2;
|
||||
} ARGS_void_GLsizei_GLuint___GENPT__;
|
||||
typedef struct {
|
||||
int format;
|
||||
FUNC_void_GLsizei_GLuint___GENPT__ func;
|
||||
ARGS_void_GLsizei_GLuint___GENPT__ args;
|
||||
} PACKED_void_GLsizei_GLuint___GENPT__;
|
||||
typedef struct {
|
||||
int func;
|
||||
ARGS_void_GLsizei_GLuint___GENPT__ args;
|
||||
} INDEXED_void_GLsizei_GLuint___GENPT__;
|
||||
typedef void (*FUNC_void_GLenum_GLboolean___GENPT__)(GLenum pname, GLboolean * params);
|
||||
typedef struct {
|
||||
GLenum a1;
|
||||
@@ -714,6 +809,22 @@ typedef struct {
|
||||
typedef struct {
|
||||
int func;
|
||||
} INDEXED_GLenum;
|
||||
typedef void (*FUNC_void_GLenum_GLenum_GLenum_GLint___GENPT__)(GLenum target, GLenum attachment, GLenum pname, GLint * params);
|
||||
typedef struct {
|
||||
GLenum a1;
|
||||
GLenum a2;
|
||||
GLenum a3;
|
||||
GLint * a4;
|
||||
} ARGS_void_GLenum_GLenum_GLenum_GLint___GENPT__;
|
||||
typedef struct {
|
||||
int format;
|
||||
FUNC_void_GLenum_GLenum_GLenum_GLint___GENPT__ func;
|
||||
ARGS_void_GLenum_GLenum_GLenum_GLint___GENPT__ args;
|
||||
} PACKED_void_GLenum_GLenum_GLenum_GLint___GENPT__;
|
||||
typedef struct {
|
||||
int func;
|
||||
ARGS_void_GLenum_GLenum_GLenum_GLint___GENPT__ args;
|
||||
} INDEXED_void_GLenum_GLenum_GLenum_GLint___GENPT__;
|
||||
typedef void (*FUNC_void_GLenum_GLint___GENPT__)(GLenum pname, GLint * params);
|
||||
typedef struct {
|
||||
GLenum a1;
|
||||
@@ -923,6 +1034,39 @@ typedef struct {
|
||||
int func;
|
||||
ARGS_void_const_GLfixed___GENPT__ args;
|
||||
} INDEXED_void_const_GLfixed___GENPT__;
|
||||
typedef void (*FUNC_void_GLenum_const_GLint___GENPT___const_GLsizei___GENPT___GLsizei)(GLenum mode, const GLint * first, const GLsizei * count, GLsizei primcount);
|
||||
typedef struct {
|
||||
GLenum a1;
|
||||
GLint * a2;
|
||||
GLsizei * a3;
|
||||
GLsizei a4;
|
||||
} ARGS_void_GLenum_const_GLint___GENPT___const_GLsizei___GENPT___GLsizei;
|
||||
typedef struct {
|
||||
int format;
|
||||
FUNC_void_GLenum_const_GLint___GENPT___const_GLsizei___GENPT___GLsizei func;
|
||||
ARGS_void_GLenum_const_GLint___GENPT___const_GLsizei___GENPT___GLsizei args;
|
||||
} PACKED_void_GLenum_const_GLint___GENPT___const_GLsizei___GENPT___GLsizei;
|
||||
typedef struct {
|
||||
int func;
|
||||
ARGS_void_GLenum_const_GLint___GENPT___const_GLsizei___GENPT___GLsizei args;
|
||||
} INDEXED_void_GLenum_const_GLint___GENPT___const_GLsizei___GENPT___GLsizei;
|
||||
typedef void (*FUNC_void_GLenum_GLsizei___GENPT___GLenum_const_void___GENPT___const___GENPT___GLsizei)(GLenum mode, GLsizei * count, GLenum type, const void * const * indices, GLsizei primcount);
|
||||
typedef struct {
|
||||
GLenum a1;
|
||||
GLsizei * a2;
|
||||
GLenum a3;
|
||||
const void * const * a4;
|
||||
GLsizei a5;
|
||||
} ARGS_void_GLenum_GLsizei___GENPT___GLenum_const_void___GENPT___const___GENPT___GLsizei;
|
||||
typedef struct {
|
||||
int format;
|
||||
FUNC_void_GLenum_GLsizei___GENPT___GLenum_const_void___GENPT___const___GENPT___GLsizei func;
|
||||
ARGS_void_GLenum_GLsizei___GENPT___GLenum_const_void___GENPT___const___GENPT___GLsizei args;
|
||||
} PACKED_void_GLenum_GLsizei___GENPT___GLenum_const_void___GENPT___const___GENPT___GLsizei;
|
||||
typedef struct {
|
||||
int func;
|
||||
ARGS_void_GLenum_GLsizei___GENPT___GLenum_const_void___GENPT___const___GENPT___GLsizei args;
|
||||
} INDEXED_void_GLenum_GLsizei___GENPT___GLenum_const_void___GENPT___const___GENPT___GLsizei;
|
||||
typedef void (*FUNC_void_GLenum_GLfloat_GLfloat_GLfloat_GLfloat)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
|
||||
typedef struct {
|
||||
GLenum a1;
|
||||
@@ -1063,6 +1207,22 @@ typedef struct {
|
||||
int func;
|
||||
ARGS_void_GLint_GLint_GLsizei_GLsizei_GLenum_GLenum_GLvoid___GENPT__ args;
|
||||
} INDEXED_void_GLint_GLint_GLsizei_GLsizei_GLenum_GLenum_GLvoid___GENPT__;
|
||||
typedef void (*FUNC_void_GLenum_GLenum_GLsizei_GLsizei)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
typedef struct {
|
||||
GLenum a1;
|
||||
GLenum a2;
|
||||
GLsizei a3;
|
||||
GLsizei a4;
|
||||
} ARGS_void_GLenum_GLenum_GLsizei_GLsizei;
|
||||
typedef struct {
|
||||
int format;
|
||||
FUNC_void_GLenum_GLenum_GLsizei_GLsizei func;
|
||||
ARGS_void_GLenum_GLenum_GLsizei_GLsizei args;
|
||||
} PACKED_void_GLenum_GLenum_GLsizei_GLsizei;
|
||||
typedef struct {
|
||||
int func;
|
||||
ARGS_void_GLenum_GLenum_GLsizei_GLsizei args;
|
||||
} INDEXED_void_GLenum_GLenum_GLsizei_GLsizei;
|
||||
typedef void (*FUNC_void_GLclampf_GLboolean)(GLclampf value, GLboolean invert);
|
||||
typedef struct {
|
||||
GLclampf a1;
|
||||
@@ -1222,167 +1382,6 @@ typedef struct {
|
||||
int func;
|
||||
ARGS_void_GLenum_GLint_GLint_GLint_GLsizei_GLsizei_GLenum_GLenum_const_GLvoid___GENPT__ args;
|
||||
} INDEXED_void_GLenum_GLint_GLint_GLint_GLsizei_GLsizei_GLenum_GLenum_const_GLvoid___GENPT__;
|
||||
typedef void (*FUNC_void_GLenum_GLenum_GLenum_GLenum)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
|
||||
typedef struct {
|
||||
GLenum a1;
|
||||
GLenum a2;
|
||||
GLenum a3;
|
||||
GLenum a4;
|
||||
} ARGS_void_GLenum_GLenum_GLenum_GLenum;
|
||||
typedef struct {
|
||||
int format;
|
||||
FUNC_void_GLenum_GLenum_GLenum_GLenum func;
|
||||
ARGS_void_GLenum_GLenum_GLenum_GLenum args;
|
||||
} PACKED_void_GLenum_GLenum_GLenum_GLenum;
|
||||
typedef struct {
|
||||
int func;
|
||||
ARGS_void_GLenum_GLenum_GLenum_GLenum args;
|
||||
} INDEXED_void_GLenum_GLenum_GLenum_GLenum;
|
||||
typedef GLenum (*FUNC_GLenum_GLenum)(GLenum target);
|
||||
typedef struct {
|
||||
GLenum a1;
|
||||
} ARGS_GLenum_GLenum;
|
||||
typedef struct {
|
||||
int format;
|
||||
FUNC_GLenum_GLenum func;
|
||||
ARGS_GLenum_GLenum args;
|
||||
} PACKED_GLenum_GLenum;
|
||||
typedef struct {
|
||||
int func;
|
||||
ARGS_GLenum_GLenum args;
|
||||
} INDEXED_GLenum_GLenum;
|
||||
typedef void (*FUNC_void_GLfloat_GLfloat_GLfloat_GLfloat_GLfloat)(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height);
|
||||
typedef struct {
|
||||
GLfloat a1;
|
||||
GLfloat a2;
|
||||
GLfloat a3;
|
||||
GLfloat a4;
|
||||
GLfloat a5;
|
||||
} ARGS_void_GLfloat_GLfloat_GLfloat_GLfloat_GLfloat;
|
||||
typedef struct {
|
||||
int format;
|
||||
FUNC_void_GLfloat_GLfloat_GLfloat_GLfloat_GLfloat func;
|
||||
ARGS_void_GLfloat_GLfloat_GLfloat_GLfloat_GLfloat args;
|
||||
} PACKED_void_GLfloat_GLfloat_GLfloat_GLfloat_GLfloat;
|
||||
typedef struct {
|
||||
int func;
|
||||
ARGS_void_GLfloat_GLfloat_GLfloat_GLfloat_GLfloat args;
|
||||
} INDEXED_void_GLfloat_GLfloat_GLfloat_GLfloat_GLfloat;
|
||||
typedef void (*FUNC_void_GLint_GLint_GLint_GLint_GLint)(GLint x, GLint y, GLint z, GLint width, GLint height);
|
||||
typedef struct {
|
||||
GLint a1;
|
||||
GLint a2;
|
||||
GLint a3;
|
||||
GLint a4;
|
||||
GLint a5;
|
||||
} ARGS_void_GLint_GLint_GLint_GLint_GLint;
|
||||
typedef struct {
|
||||
int format;
|
||||
FUNC_void_GLint_GLint_GLint_GLint_GLint func;
|
||||
ARGS_void_GLint_GLint_GLint_GLint_GLint args;
|
||||
} PACKED_void_GLint_GLint_GLint_GLint_GLint;
|
||||
typedef struct {
|
||||
int func;
|
||||
ARGS_void_GLint_GLint_GLint_GLint_GLint args;
|
||||
} INDEXED_void_GLint_GLint_GLint_GLint_GLint;
|
||||
typedef void (*FUNC_void_GLenum_GLenum_GLenum_GLuint)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
|
||||
typedef struct {
|
||||
GLenum a1;
|
||||
GLenum a2;
|
||||
GLenum a3;
|
||||
GLuint a4;
|
||||
} ARGS_void_GLenum_GLenum_GLenum_GLuint;
|
||||
typedef struct {
|
||||
int format;
|
||||
FUNC_void_GLenum_GLenum_GLenum_GLuint func;
|
||||
ARGS_void_GLenum_GLenum_GLenum_GLuint args;
|
||||
} PACKED_void_GLenum_GLenum_GLenum_GLuint;
|
||||
typedef struct {
|
||||
int func;
|
||||
ARGS_void_GLenum_GLenum_GLenum_GLuint args;
|
||||
} INDEXED_void_GLenum_GLenum_GLenum_GLuint;
|
||||
typedef void (*FUNC_void_GLenum_GLenum_GLenum_GLuint_GLint)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
||||
typedef struct {
|
||||
GLenum a1;
|
||||
GLenum a2;
|
||||
GLenum a3;
|
||||
GLuint a4;
|
||||
GLint a5;
|
||||
} ARGS_void_GLenum_GLenum_GLenum_GLuint_GLint;
|
||||
typedef struct {
|
||||
int format;
|
||||
FUNC_void_GLenum_GLenum_GLenum_GLuint_GLint func;
|
||||
ARGS_void_GLenum_GLenum_GLenum_GLuint_GLint args;
|
||||
} PACKED_void_GLenum_GLenum_GLenum_GLuint_GLint;
|
||||
typedef struct {
|
||||
int func;
|
||||
ARGS_void_GLenum_GLenum_GLenum_GLuint_GLint args;
|
||||
} INDEXED_void_GLenum_GLenum_GLenum_GLuint_GLint;
|
||||
typedef void (*FUNC_void_GLenum_GLenum_GLenum_GLint___GENPT__)(GLenum target, GLenum attachment, GLenum pname, GLint * params);
|
||||
typedef struct {
|
||||
GLenum a1;
|
||||
GLenum a2;
|
||||
GLenum a3;
|
||||
GLint * a4;
|
||||
} ARGS_void_GLenum_GLenum_GLenum_GLint___GENPT__;
|
||||
typedef struct {
|
||||
int format;
|
||||
FUNC_void_GLenum_GLenum_GLenum_GLint___GENPT__ func;
|
||||
ARGS_void_GLenum_GLenum_GLenum_GLint___GENPT__ args;
|
||||
} PACKED_void_GLenum_GLenum_GLenum_GLint___GENPT__;
|
||||
typedef struct {
|
||||
int func;
|
||||
ARGS_void_GLenum_GLenum_GLenum_GLint___GENPT__ args;
|
||||
} INDEXED_void_GLenum_GLenum_GLenum_GLint___GENPT__;
|
||||
typedef void (*FUNC_void_GLenum_const_GLint___GENPT___const_GLsizei___GENPT___GLsizei)(GLenum mode, const GLint * first, const GLsizei * count, GLsizei primcount);
|
||||
typedef struct {
|
||||
GLenum a1;
|
||||
GLint * a2;
|
||||
GLsizei * a3;
|
||||
GLsizei a4;
|
||||
} ARGS_void_GLenum_const_GLint___GENPT___const_GLsizei___GENPT___GLsizei;
|
||||
typedef struct {
|
||||
int format;
|
||||
FUNC_void_GLenum_const_GLint___GENPT___const_GLsizei___GENPT___GLsizei func;
|
||||
ARGS_void_GLenum_const_GLint___GENPT___const_GLsizei___GENPT___GLsizei args;
|
||||
} PACKED_void_GLenum_const_GLint___GENPT___const_GLsizei___GENPT___GLsizei;
|
||||
typedef struct {
|
||||
int func;
|
||||
ARGS_void_GLenum_const_GLint___GENPT___const_GLsizei___GENPT___GLsizei args;
|
||||
} INDEXED_void_GLenum_const_GLint___GENPT___const_GLsizei___GENPT___GLsizei;
|
||||
typedef void (*FUNC_void_GLenum_GLsizei___GENPT___GLenum_const_void___GENPT___const___GENPT___GLsizei)(GLenum mode, GLsizei * count, GLenum type, const void * const * indices, GLsizei primcount);
|
||||
typedef struct {
|
||||
GLenum a1;
|
||||
GLsizei * a2;
|
||||
GLenum a3;
|
||||
void * * a4;
|
||||
GLsizei a5;
|
||||
} ARGS_void_GLenum_GLsizei___GENPT___GLenum_const_void___GENPT___const___GENPT___GLsizei;
|
||||
typedef struct {
|
||||
int format;
|
||||
FUNC_void_GLenum_GLsizei___GENPT___GLenum_const_void___GENPT___const___GENPT___GLsizei func;
|
||||
ARGS_void_GLenum_GLsizei___GENPT___GLenum_const_void___GENPT___const___GENPT___GLsizei args;
|
||||
} PACKED_void_GLenum_GLsizei___GENPT___GLenum_const_void___GENPT___const___GENPT___GLsizei;
|
||||
typedef struct {
|
||||
int func;
|
||||
ARGS_void_GLenum_GLsizei___GENPT___GLenum_const_void___GENPT___const___GENPT___GLsizei args;
|
||||
} INDEXED_void_GLenum_GLsizei___GENPT___GLenum_const_void___GENPT___const___GENPT___GLsizei;
|
||||
typedef void (*FUNC_void_GLenum_GLenum_GLsizei_GLsizei)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
typedef struct {
|
||||
GLenum a1;
|
||||
GLenum a2;
|
||||
GLsizei a3;
|
||||
GLsizei a4;
|
||||
} ARGS_void_GLenum_GLenum_GLsizei_GLsizei;
|
||||
typedef struct {
|
||||
int format;
|
||||
FUNC_void_GLenum_GLenum_GLsizei_GLsizei func;
|
||||
ARGS_void_GLenum_GLenum_GLsizei_GLsizei args;
|
||||
} PACKED_void_GLenum_GLenum_GLsizei_GLsizei;
|
||||
typedef struct {
|
||||
int func;
|
||||
ARGS_void_GLenum_GLenum_GLsizei_GLsizei args;
|
||||
} INDEXED_void_GLenum_GLenum_GLsizei_GLsizei;
|
||||
|
||||
extern void glPushCall(void *data);
|
||||
void glPackedCall(const packed_call_t *packed);
|
||||
@@ -4744,5 +4743,3 @@ typedef void (*glViewport_PTR)(glViewport_ARG_EXPAND);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,253 +0,0 @@
|
||||
#ifndef USE_ES2
|
||||
#include "gles.h"
|
||||
#ifndef skip_glBindFramebuffer
|
||||
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("gl4es_glBindFramebuffer"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glBindRenderbuffer
|
||||
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("gl4es_glBindRenderbuffer"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glBlendColor
|
||||
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("gl4es_glBlendColor"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glBlendEquation
|
||||
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("gl4es_glBlendEquation"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glBlendEquationSeparate
|
||||
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("gl4es_glBlendEquationSeparate"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glBlendFuncSeparate
|
||||
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("gl4es_glBlendFuncSeparate"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glCheckFramebufferStatus
|
||||
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("gl4es_glCheckFramebufferStatus"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glDeleteFramebuffers
|
||||
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("gl4es_glDeleteFramebuffers"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glDeleteRenderbuffers
|
||||
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("gl4es_glDeleteRenderbuffers"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glDrawTexf
|
||||
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("gl4es_glDrawTexf"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glDrawTexi
|
||||
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("gl4es_glDrawTexi"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glFramebufferRenderbuffer
|
||||
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("gl4es_glFramebufferRenderbuffer"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glFramebufferTexture2D
|
||||
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("gl4es_glFramebufferTexture2D"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glGenFramebuffers
|
||||
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("gl4es_glGenFramebuffers"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glGenRenderbuffers
|
||||
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("gl4es_glGenRenderbuffers"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glGenerateMipmap
|
||||
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("gl4es_glGenerateMipmap"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glGetFramebufferAttachmentParameteriv
|
||||
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("gl4es_glGetFramebufferAttachmentParameteriv"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glGetRenderbufferParameteriv
|
||||
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("gl4es_glGetRenderbufferParameteriv"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glIsFramebuffer
|
||||
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("gl4es_glIsFramebuffer"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glIsRenderbuffer
|
||||
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("gl4es_glIsRenderbuffer"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glMultiDrawArrays
|
||||
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("gl4es_glMultiDrawArrays"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glMultiDrawElements
|
||||
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("gl4es_glMultiDrawElements"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glRenderbufferStorage
|
||||
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("gl4es_glRenderbufferStorage"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glTexGenfv
|
||||
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("gl4es_glTexGenfv"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#ifndef skip_glTexGeni
|
||||
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("gl4es_glTexGeni"))) __attribute__((visibility("default")));
|
||||
#endif
|
||||
#endif
|
||||
@@ -47,7 +47,7 @@ STUB(void glBlendEquationSeparatei(GLuint buf, GLenum modeRGB, GLenum modeAlpha)
|
||||
STUB(void glBlendFuncSeparatei(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha))
|
||||
*/
|
||||
STUB(void,glClearAccum,(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha));
|
||||
STUB(void,glColorMaterial,(GLenum face, GLenum mode));
|
||||
//STUB(void,glColorMaterial,(GLenum face, GLenum mode));
|
||||
STUB(void,glCopyPixels,(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type));
|
||||
STUB(void,glDrawBuffer,(GLenum mode));
|
||||
STUB(void,glEdgeFlag,(GLboolean flag));
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
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_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);
|
||||
|
||||
@@ -19,13 +19,11 @@
|
||||
|
||||
#include "glx.h"
|
||||
#include "utils.h"
|
||||
//#include <GLES/gl.h>
|
||||
#include "../gl/gl.h"
|
||||
#include "../glx/streaming.h"
|
||||
#include "khash.h"
|
||||
#include "hardext.h"
|
||||
|
||||
//#define EXPORT __attribute__((visibility("default")))
|
||||
#ifndef AliasExport
|
||||
#define AliasExport(name) __attribute__((alias(name))) __attribute__((visibility("default")))
|
||||
#endif
|
||||
@@ -829,7 +827,7 @@ not set to EGL_NO_CONTEXT.
|
||||
Bool gl4es_glXMakeCurrent(Display *display,
|
||||
GLXDrawable drawable,
|
||||
GLXContext context) {
|
||||
DBG(printf("glXMakeCurrent(%p, %p, %p) 'isPBuffer(drawable)=%d\n", display, drawable, context, isPBuffer(drawable));)
|
||||
DBG(printf("glXMakeCurrent(%p, %p, %p) 'isPBuffer(drawable)=%d, context->drawable=%p, context->eglSurface=%p\n", display, drawable, context, isPBuffer(drawable), context?context->drawable:0, context?context->eglSurface:0);)
|
||||
LOAD_EGL(eglMakeCurrent);
|
||||
LOAD_EGL(eglDestroySurface);
|
||||
LOAD_EGL(eglCreateWindowSurface);
|
||||
|
||||
@@ -118,7 +118,7 @@ void GetHardwareExtensions(int notest)
|
||||
S("GL_OES_depth24", depth24, 1);
|
||||
S("GL_OES_rgb8_rgba8", rgba8, 1);
|
||||
S("GL_EXT_multi_draw_arrays", multidraw, 1);
|
||||
S("GL_EXT_texture_format_BGRA8888", bgra8888, 0);
|
||||
S("GL_EXT_texture_format_BGRA8888", bgra8888, 1);
|
||||
S("GL_OES_depth_texture", depthtex, 1);
|
||||
S("GL_OES_texture_cube_map", cubemap, 1);
|
||||
|
||||
@@ -138,7 +138,7 @@ void GetHardwareExtensions(int notest)
|
||||
#endif
|
||||
|
||||
if(strstr(egl_eglQueryString(eglDisplay, EGL_EXTENSIONS), "EGL_KHR_gl_colorspace")) {
|
||||
LOGD("LIBGL: sRGB surface supported\n");
|
||||
SHUT(LOGD("LIBGL: sRGB surface supported\n"));
|
||||
hardext.srgb = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -485,7 +485,7 @@ EXPORT void *glXGetProcAddressARB(const char *name) {
|
||||
STUB(glAccum);
|
||||
STUB(glAreTexturesResident);
|
||||
STUB(glClearAccum);
|
||||
STUB(glColorMaterial);
|
||||
_EX(glColorMaterial);
|
||||
_EX(glCopyTexSubImage3D); // It's a stub, calling the 2D one
|
||||
STUB(glFeedbackBuffer);
|
||||
STUB(glGetClipPlane);
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
|
||||
#define MAJOR 0
|
||||
#define MINOR 9
|
||||
#define REVISION 3
|
||||
#define REVISION 4
|
||||
|
||||
#endif //_GL4ES_VERSION_H
|
||||
#endif //_GL4ES_VERSION_H
|
||||
|
||||
1
project/jni/miniupnpc/include/miniupnpc
Symbolic link
1
project/jni/miniupnpc/include/miniupnpc
Symbolic link
@@ -0,0 +1 @@
|
||||
.
|
||||
Submodule project/jni/shmem updated: c2a28f528d...f6b49516cf
@@ -18,10 +18,11 @@ On RPM based distros they are usually called java-x.x.x-openjdk and java-x.x.x-o
|
||||
On Debian or Ubuntu you install them like this: sudo apt-get install openjdk-8-jdk ant
|
||||
The application will run on Android 2.3 and above, but will use features from Android 6.0 if available.
|
||||
The most supported environment for this port is Linux, MacOs should be okay too.
|
||||
If you're developing under Windows you'd better install Portable Ubuntu, to get proper Linux environment
|
||||
running inside Windows, then install Linux toolchain on it.
|
||||
If you're developing under Windows, you will need to install some Linux environment,
|
||||
such as Bash shell on Windows 10, or Portable Ubuntu, then install Linux toolchain on it.
|
||||
https://msdn.microsoft.com/en-us/commandline/wsl/install_guide
|
||||
https://sourceforge.net/projects/portableubuntu/
|
||||
Cygwin is not supported by the NDK, starting from the NDK r6.
|
||||
Cygwin is not supported by the NDK.
|
||||
|
||||
|
||||
How to compile demo application
|
||||
|
||||
Reference in New Issue
Block a user