gl4es updated, added latest changes by ptitSeb

This commit is contained in:
lubomyr
2017-02-06 19:34:51 +02:00
parent 13295374d7
commit 5df129f2f3
25 changed files with 895 additions and 6740 deletions

View File

@@ -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" &

View File

@@ -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)

View File

@@ -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) }});

View File

@@ -18,7 +18,7 @@
#endif
{% endblock %}
{% block load %}
LOAD_GLES({{ func.name }});
{{ func.loadlib }}({{ func.name }});
{% endblock %}
{% block call %}
#ifndef direct_{{ func.name }}

View File

@@ -9,7 +9,7 @@
#endif
{% endblock %}
{% block load %}
LOAD_GLES_OES({{ func.name }});
{{ func.loadlib }}({{ func.name }});
{% endblock %}
{% block call %}
#ifndef direct_{{ func.name }}

View File

@@ -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 }}; \

View File

@@ -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]