glshim updated, added latest changes by ptitSeb
This commit is contained in:
3
project/jni/glshim/spec/template/base/wrap.c.j2
Normal file → Executable file
3
project/jni/glshim/spec/template/base/wrap.c.j2
Normal file → Executable file
@@ -3,12 +3,13 @@
|
||||
{% include "base/headers.j2" %}
|
||||
{% for func in functions %}
|
||||
{% block definition scoped %}
|
||||
{{ func.return }} {{ func.name }}({{ func.args|args }}) {
|
||||
{{ func.return }} glshim_{{ 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) }});
|
||||
{%- endblock %}
|
||||
}
|
||||
{{ func.return }} {{ func.name }}({{ func.args|args }}) __attribute__((alias("glshim_{{ func.name }}")));
|
||||
{% endblock %}
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
|
||||
2
project/jni/glshim/spec/template/base/wrap.h.j2
Normal file → Executable file
2
project/jni/glshim/spec/template/base/wrap.h.j2
Normal file → Executable file
@@ -57,7 +57,7 @@ void glIndexedCall(const indexed_call_t *packed, void *ret_v);
|
||||
{% endfor %}
|
||||
|
||||
{% for func in functions %}
|
||||
{{ func.return }} {{ func.name }}({{ func.name }}_ARG_EXPAND);
|
||||
{{ func.return }} glshim_{{ func.name }}({{ func.name }}_ARG_EXPAND);
|
||||
typedef {{ func.return }} (*{{ func.name }}_PTR)({{ func.name }}_ARG_EXPAND);
|
||||
{% endfor %}
|
||||
|
||||
|
||||
2
project/jni/glshim/spec/template/glwrap.h.j2
Normal file → Executable file
2
project/jni/glshim/spec/template/glwrap.h.j2
Normal file → Executable 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 = {{ func.name }}; \
|
||||
packed_data->func = glshim_{{ func.name }}; \
|
||||
{% if func.args %}
|
||||
{% for arg in func.args %}
|
||||
packed_data->args.a{{ loop.index }} = ({{ arg.type|unconst }}){{ arg.name }}; \
|
||||
|
||||
@@ -42,13 +42,13 @@
|
||||
#define skip_glBlendFunc
|
||||
|
||||
#define skip_glFogfv
|
||||
/*
|
||||
#define skip_glBlendEquation
|
||||
|
||||
//#define skip_glBlendEquation
|
||||
#define skip_glBlendEquationSeparate
|
||||
#define skip_glBlendEquationSeparatei
|
||||
#define skip_glBlendFuncSeparate
|
||||
#define skip_glBlendFuncSeparatei
|
||||
*/
|
||||
|
||||
#define skip_glGetError
|
||||
|
||||
// light.c
|
||||
|
||||
@@ -13,7 +13,6 @@ GLvoid *copy_gl_array(const GLvoid *src,
|
||||
const char *unknown_str = "libGL: copy_gl_array -> unknown type: %x\n";
|
||||
GLvoid *dst = malloc((count-skip) * to_width * gl_sizeof(to));
|
||||
GLsizei from_size = gl_sizeof(from) * width;
|
||||
GLsizei to_size = gl_sizeof(to) * to_width;
|
||||
if (to_width < width) {
|
||||
/* printf("Warning: copy_gl_array: %i < %i\n", to_width, width);
|
||||
return NULL;*/
|
||||
@@ -77,7 +76,6 @@ GLvoid *copy_gl_array_texcoord(const GLvoid *src,
|
||||
const char *unknown_str = "libGL: copy_gl_array -> unknown type: %x\n";
|
||||
GLvoid *dst = malloc((count-skip) * to_width * gl_sizeof(to));
|
||||
GLsizei from_size = gl_sizeof(from) * width;
|
||||
GLsizei to_size = gl_sizeof(to) * to_width;
|
||||
GLsizei to_elem = gl_sizeof(to);
|
||||
//texcoord are now 4 dim, so this should never happens
|
||||
/* if (to_width < width) {
|
||||
@@ -144,8 +142,6 @@ GLvoid *copy_gl_array_quickconvert(const GLvoid *src,
|
||||
stride = 4 * gl_sizeof(from);
|
||||
const char *unknown_str = "libGL: copy_gl_array_quickconvert -> unknown type: %x\n";
|
||||
GLvoid *dst = malloc((count-skip) * 4 * gl_sizeof(GL_FLOAT));
|
||||
GLsizei from_size = gl_sizeof(from) * 4;
|
||||
GLsizei to_size = gl_sizeof(GL_FLOAT) * 4;
|
||||
|
||||
uintptr_t in = (uintptr_t)src;
|
||||
in += stride*skip;
|
||||
@@ -183,7 +179,6 @@ GLvoid *copy_gl_array_convert(const GLvoid *src,
|
||||
const char *unknown_str = "libGL: copy_gl_array_convert -> unknown type: %x\n";
|
||||
GLvoid *dst = malloc((count-skip) * to_width * gl_sizeof(to));
|
||||
GLsizei from_size = gl_sizeof(from) * width;
|
||||
GLsizei to_size = gl_sizeof(to) * to_width;
|
||||
if (to_width < width) {
|
||||
/*printf("Warning: copy_gl_array: %i < %i\n", to_width, width);
|
||||
return NULL;*/
|
||||
@@ -280,7 +275,7 @@ GLfloat *gl_pointer_index(pointer_state_t *p, GLint index) {
|
||||
GLsizei size = gl_sizeof(p->type);
|
||||
GLsizei stride = (p->stride ? p->stride : size) * p->size;
|
||||
uintptr_t ptr = (uintptr_t)(p->pointer) + (stride * index)
|
||||
+ (uintptr_t)((state.vao->vertex)?state.vao->vertex->data:0);
|
||||
+ (uintptr_t)((glstate.vao->vertex)?glstate.vao->vertex->data:0);
|
||||
|
||||
GL_TYPE_SWITCH(src, ptr, p->type,
|
||||
for (int i = 0; i < p->size; i++) {
|
||||
|
||||
@@ -8,16 +8,16 @@ static GLuint lastbuffer = 1;
|
||||
glbuffer_t** BUFF(GLenum target) {
|
||||
switch(target) {
|
||||
case GL_ARRAY_BUFFER:
|
||||
return &state.vao->vertex;
|
||||
return &glstate.vao->vertex;
|
||||
break;
|
||||
case GL_ELEMENT_ARRAY_BUFFER:
|
||||
return &state.vao->elements;
|
||||
return &glstate.vao->elements;
|
||||
break;
|
||||
case GL_PIXEL_PACK_BUFFER:
|
||||
return &state.vao->pack;
|
||||
return &glstate.vao->pack;
|
||||
break;
|
||||
case GL_PIXEL_UNPACK_BUFFER:
|
||||
return &state.vao->unpack;
|
||||
return &glstate.vao->unpack;
|
||||
break;
|
||||
default:
|
||||
printf("LIBGL: Warning, unknown buffer target 0x%04X\n", target);
|
||||
@@ -54,7 +54,7 @@ int buffer_target(GLenum target) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void glGenBuffers(GLsizei n, GLuint * buffers) {
|
||||
void glshim_glGenBuffers(GLsizei n, GLuint * buffers) {
|
||||
//printf("glGenBuffers(%i, %p)\n", n, buffers);
|
||||
noerrorShim();
|
||||
if (n<1) {
|
||||
@@ -66,17 +66,17 @@ void glGenBuffers(GLsizei n, GLuint * buffers) {
|
||||
}
|
||||
}
|
||||
|
||||
void glBindBuffer(GLenum target, GLuint buffer) {
|
||||
void glshim_glBindBuffer(GLenum target, GLuint buffer) {
|
||||
//printf("glBindBuffer(%s, %u)\n", PrintEnum(target), buffer);
|
||||
if (state.gl_batch) {
|
||||
if (glstate.gl_batch) {
|
||||
flush();
|
||||
}
|
||||
|
||||
khint_t k;
|
||||
int ret;
|
||||
khash_t(buff) *list = state.buffers;
|
||||
khash_t(buff) *list = glstate.buffers;
|
||||
if (! list) {
|
||||
list = state.buffers = kh_init(buff);
|
||||
list = glstate.buffers = kh_init(buff);
|
||||
// segfaults if we don't do a single put
|
||||
kh_put(buff, list, 1, &ret);
|
||||
kh_del(buff, list, 1);
|
||||
@@ -111,7 +111,7 @@ void glBindBuffer(GLenum target, GLuint buffer) {
|
||||
noerrorShim();
|
||||
}
|
||||
|
||||
void glBufferData(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage) {
|
||||
void glshim_glBufferData(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage) {
|
||||
//printf("glBufferData(%s, %i, %p, %s)\n", PrintEnum(target), size, data, PrintEnum(usage));
|
||||
if (!buffer_target(target)) {
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
@@ -135,7 +135,7 @@ void glBufferData(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum us
|
||||
noerrorShim();
|
||||
}
|
||||
|
||||
void glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data) {
|
||||
void glshim_glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data) {
|
||||
//printf("glBufferSubData(%s, %p, %i, %p)\n", PrintEnum(target), offset, size, data);
|
||||
if (!buffer_target(target)) {
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
@@ -151,13 +151,13 @@ void glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvo
|
||||
noerrorShim();
|
||||
}
|
||||
|
||||
void glDeleteBuffers(GLsizei n, const GLuint * buffers) {
|
||||
void glshim_glDeleteBuffers(GLsizei n, const GLuint * buffers) {
|
||||
//printf("glDeleteBuffers(%i, %p)\n", n, buffers);
|
||||
if (state.gl_batch) {
|
||||
if (glstate.gl_batch) {
|
||||
flush();
|
||||
}
|
||||
|
||||
khash_t(buff) *list = state.buffers;
|
||||
khash_t(buff) *list = glstate.buffers;
|
||||
if (list) {
|
||||
khint_t k;
|
||||
glbuffer_t *buff;
|
||||
@@ -167,14 +167,14 @@ void glDeleteBuffers(GLsizei n, const GLuint * buffers) {
|
||||
k = kh_get(buff, list, t);
|
||||
if (k != kh_end(list)) {
|
||||
buff = kh_value(list, k);
|
||||
if (state.vao->vertex == buff)
|
||||
state.vao->vertex = NULL;
|
||||
if (state.vao->elements == buff)
|
||||
state.vao->elements = NULL;
|
||||
if (state.vao->pack == buff)
|
||||
state.vao->pack = NULL;
|
||||
if (state.vao->unpack == buff)
|
||||
state.vao->unpack = NULL;
|
||||
if (glstate.vao->vertex == buff)
|
||||
glstate.vao->vertex = NULL;
|
||||
if (glstate.vao->elements == buff)
|
||||
glstate.vao->elements = NULL;
|
||||
if (glstate.vao->pack == buff)
|
||||
glstate.vao->pack = NULL;
|
||||
if (glstate.vao->unpack == buff)
|
||||
glstate.vao->unpack = NULL;
|
||||
if (buff->data) free(buff->data);
|
||||
kh_del(buff, list, k);
|
||||
free(buff);
|
||||
@@ -185,9 +185,9 @@ void glDeleteBuffers(GLsizei n, const GLuint * buffers) {
|
||||
noerrorShim();
|
||||
}
|
||||
|
||||
GLboolean glIsBuffer(GLuint buffer) {
|
||||
GLboolean glshim_glIsBuffer(GLuint buffer) {
|
||||
//printf("glIsBuffer(%u)\n", buffer);
|
||||
khash_t(buff) *list = state.buffers;
|
||||
khash_t(buff) *list = glstate.buffers;
|
||||
khint_t k;
|
||||
noerrorShim();
|
||||
if (list) {
|
||||
@@ -201,7 +201,7 @@ GLboolean glIsBuffer(GLuint buffer) {
|
||||
|
||||
|
||||
|
||||
void glGetBufferParameteriv(GLenum target, GLenum value, GLint * data) {
|
||||
void glshim_glGetBufferParameteriv(GLenum target, GLenum value, GLint * data) {
|
||||
//printf("glGetBufferParameteriv(%s, %s, %p)\n", PrintEnum(target), PrintEnum(value), data);
|
||||
if (!buffer_target(target)) {
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
@@ -241,7 +241,7 @@ void glGetBufferParameteriv(GLenum target, GLenum value, GLint * data) {
|
||||
}
|
||||
}
|
||||
|
||||
void *glMapBuffer(GLenum target, GLenum access) {
|
||||
void *glshim_glMapBuffer(GLenum target, GLenum access) {
|
||||
//printf("glMapBuffer(%s, %s)\n", PrintEnum(target), PrintEnum(access));
|
||||
if (!buffer_target(target)) {
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
@@ -256,7 +256,7 @@ void *glMapBuffer(GLenum target, GLenum access) {
|
||||
return buff->data; // Not nice, should do some copy or something probably
|
||||
}
|
||||
|
||||
GLboolean glUnmapBuffer(GLenum target) {
|
||||
GLboolean glshim_glUnmapBuffer(GLenum target) {
|
||||
//printf("glUnmapBuffer(%s)\n", PrintEnum(target));
|
||||
if (!buffer_target(target)) {
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
@@ -273,7 +273,7 @@ GLboolean glUnmapBuffer(GLenum target) {
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
void glGetBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid * data) {
|
||||
void glshim_glGetBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid * data) {
|
||||
//printf("glGetBufferSubData(%s, %p, %i, %p)\n", PrintEnum(target), offset, size, data);
|
||||
if (!buffer_target(target)) {
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
@@ -287,7 +287,7 @@ void glGetBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid
|
||||
noerrorShim();
|
||||
}
|
||||
|
||||
void glGetBufferPointerv(GLenum target, GLenum pname, GLvoid ** params) {
|
||||
void glshim_glGetBufferPointerv(GLenum target, GLenum pname, GLvoid ** params) {
|
||||
//printf("glGetBufferPointerv(%s, %s, %p)\n", PrintEnum(target), PrintEnum(pname), params);
|
||||
if (!buffer_target(target)) {
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
@@ -307,45 +307,36 @@ void glGetBufferPointerv(GLenum target, GLenum pname, GLvoid ** params) {
|
||||
}
|
||||
}
|
||||
|
||||
//Direct wrapper
|
||||
void glGenBuffers(GLsizei n, GLuint * buffers) __attribute__((alias("glshim_glGenBuffers")));
|
||||
void glBindBuffer(GLenum target, GLuint buffer) __attribute__((alias("glshim_glBindBuffer")));
|
||||
void glBufferData(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage) __attribute__((alias("glshim_glBufferData")));
|
||||
void glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data) __attribute__((alias("glshim_glBufferSubData")));
|
||||
void glDeleteBuffers(GLsizei n, const GLuint * buffers) __attribute__((alias("glshim_glDeleteBuffers")));
|
||||
GLboolean glIsBuffer(GLuint buffer) __attribute__((alias("glshim_glIsBuffer")));
|
||||
void glGetBufferParameteriv(GLenum target, GLenum value, GLint * data) __attribute__((alias("glshim_glGetBufferParameteriv")));
|
||||
void *glMapBuffer(GLenum target, GLenum access) __attribute__((alias("glshim_glMapBuffer")));
|
||||
GLboolean glUnmapBuffer(GLenum target) __attribute__((alias("glshim_glUnmapBuffer")));
|
||||
void glGetBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid * data) __attribute__((alias("glshim_glGetBufferSubData")));
|
||||
void glGetBufferPointerv(GLenum target, GLenum pname, GLvoid ** params) __attribute__((alias("glshim_glGetBufferPointerv")));
|
||||
|
||||
void glGenBuffersARB(GLsizei n, GLuint * buffers) {
|
||||
glGenBuffers(n, buffers);
|
||||
}
|
||||
void glBindBufferARB(GLenum target, GLuint buffer) {
|
||||
glBindBuffer(target, buffer);
|
||||
}
|
||||
void glBufferDataARB(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage) {
|
||||
glBufferData(target, size, data, usage);
|
||||
}
|
||||
void glBufferSubDataARB(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data) {
|
||||
glBufferSubData(target, offset, size, data);
|
||||
}
|
||||
void glDeleteBuffersARB(GLsizei n, const GLuint * buffers) {
|
||||
glDeleteBuffers(n, buffers);
|
||||
}
|
||||
GLboolean glIsBufferARB(GLuint buffer) {
|
||||
return glIsBuffer(buffer);
|
||||
}
|
||||
void glGetBufferParameterivARB(GLenum target, GLenum value, GLint * data) {
|
||||
glGetBufferParameteriv(target, value, data);
|
||||
}
|
||||
void *glMapBufferARB(GLenum target, GLenum access) {
|
||||
glMapBuffer(target, access);
|
||||
}
|
||||
GLboolean glUnmapBufferARB(GLenum target) {
|
||||
return glUnmapBuffer(target);
|
||||
}
|
||||
void glGetBufferSubDataARB(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid * data) {
|
||||
glGetBufferSubData(target, offset, size, data);
|
||||
}
|
||||
void glGetBufferPointervARB(GLenum target, GLenum pname, GLvoid ** params) {
|
||||
glGetBufferPointerv(target, pname, params);
|
||||
}
|
||||
//ARB wrapper
|
||||
void glGenBuffersARB(GLsizei n, GLuint * buffers) __attribute__((alias("glshim_glGenBuffers")));
|
||||
void glBindBufferARB(GLenum target, GLuint buffer) __attribute__((alias("glshim_glBindBuffer")));
|
||||
void glBufferDataARB(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage) __attribute__((alias("glshim_glBufferData")));
|
||||
void glBufferSubDataARB(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data) __attribute__((alias("glshim_glBufferSubData")));
|
||||
void glDeleteBuffersARB(GLsizei n, const GLuint * buffers) __attribute__((alias("glshim_glDeleteBuffers")));
|
||||
GLboolean glIsBufferARB(GLuint buffer) __attribute__((alias("glshim_glIsBuffer")));
|
||||
void glGetBufferParameterivARB(GLenum target, GLenum value, GLint * data) __attribute__((alias("glshim_glGetBufferParameteriv")));
|
||||
void *glMapBufferARB(GLenum target, GLenum access) __attribute__((alias("glshim_glMapBuffer")));
|
||||
GLboolean glUnmapBufferARB(GLenum target) __attribute__((alias("glshim_glUnmapBuffer")));
|
||||
void glGetBufferSubDataARB(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid * data) __attribute__((alias("glshim_glGetBufferSubData")));
|
||||
void glGetBufferPointervARB(GLenum target, GLenum pname, GLvoid ** params) __attribute__((alias("glshim_glGetBufferPointerv")));
|
||||
|
||||
// VAO ****************
|
||||
static GLuint lastvao = 1;
|
||||
|
||||
void glGenVertexArrays(GLsizei n, GLuint *arrays) {
|
||||
void glshim_glGenVertexArrays(GLsizei n, GLuint *arrays) {
|
||||
//printf("glGenVertexArrays(%i, %p)\n", n, arrays);
|
||||
noerrorShim();
|
||||
if (n<1) {
|
||||
@@ -356,17 +347,17 @@ void glGenVertexArrays(GLsizei n, GLuint *arrays) {
|
||||
arrays[i] = lastvao++;
|
||||
}
|
||||
}
|
||||
void glBindVertexArray(GLuint array) {
|
||||
void glshim_glBindVertexArray(GLuint array) {
|
||||
//printf("glBindVertexArray(%u)\n", array);
|
||||
if (state.gl_batch) {
|
||||
if (glstate.gl_batch) {
|
||||
flush();
|
||||
}
|
||||
|
||||
khint_t k;
|
||||
int ret;
|
||||
khash_t(glvao) *list = state.vaos;
|
||||
khash_t(glvao) *list = glstate.vaos;
|
||||
if (! list) {
|
||||
list = state.vaos = kh_init(glvao);
|
||||
list = glstate.vaos = kh_init(glvao);
|
||||
// segfaults if we don't do a single put
|
||||
kh_put(glvao, list, 1, &ret);
|
||||
kh_del(glvao, list, 1);
|
||||
@@ -374,7 +365,7 @@ void glBindVertexArray(GLuint array) {
|
||||
// if array = 0 => unbind buffer!
|
||||
if (array == 0) {
|
||||
// unbind buffer
|
||||
state.vao = state.defaultvao;
|
||||
glstate.vao = glstate.defaultvao;
|
||||
} else {
|
||||
// search for an existing buffer
|
||||
k = kh_get(glvao, list, array);
|
||||
@@ -385,10 +376,10 @@ void glBindVertexArray(GLuint array) {
|
||||
// new vao is binded to nothing
|
||||
memset(glvao, 0, sizeof(glvao_t));
|
||||
/*
|
||||
state.vao->vertex = state.defaultvbo;
|
||||
state.vao->elements = state.defaultvbo;
|
||||
state.vao->pack = state.defaultvbo;
|
||||
state.vao->unpack = state.defaultvbo;
|
||||
glstate.vao->vertex = glstate.defaultvbo;
|
||||
glstate.vao->elements = glstate.defaultvbo;
|
||||
glstate.vao->pack = glstate.defaultvbo;
|
||||
glstate.vao->unpack = glstate.defaultvbo;
|
||||
*/
|
||||
|
||||
// just put is number
|
||||
@@ -396,16 +387,16 @@ void glBindVertexArray(GLuint array) {
|
||||
} else {
|
||||
glvao = kh_value(list, k);
|
||||
}
|
||||
state.vao = glvao;
|
||||
glstate.vao = glvao;
|
||||
}
|
||||
noerrorShim();
|
||||
}
|
||||
void glDeleteVertexArrays(GLsizei n, const GLuint *arrays) {
|
||||
void glshim_glDeleteVertexArrays(GLsizei n, const GLuint *arrays) {
|
||||
//printf("glDeleteVertexArrays(%i, %p)\n", n, arrays);
|
||||
if (state.gl_batch) {
|
||||
if (glstate.gl_batch) {
|
||||
flush();
|
||||
}
|
||||
khash_t(glvao) *list = state.vaos;
|
||||
khash_t(glvao) *list = glstate.vaos;
|
||||
if (list) {
|
||||
khint_t k;
|
||||
glvao_t *glvao;
|
||||
@@ -423,9 +414,9 @@ void glDeleteVertexArrays(GLsizei n, const GLuint *arrays) {
|
||||
}
|
||||
noerrorShim();
|
||||
}
|
||||
GLboolean glIsVertexArray(GLuint array) {
|
||||
GLboolean glshim_glIsVertexArray(GLuint array) {
|
||||
//printf("glIsVertexArray(%u)\n", array);
|
||||
khash_t(glvao) *list = state.vaos;
|
||||
khash_t(glvao) *list = glstate.vaos;
|
||||
khint_t k;
|
||||
noerrorShim();
|
||||
if (list) {
|
||||
@@ -436,3 +427,10 @@ GLboolean glIsVertexArray(GLuint array) {
|
||||
}
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
//Dirzct wrapper
|
||||
void glGenVertexArrays(GLsizei n, GLuint *arrays) __attribute__((alias("glshim_glGenVertexArrays")));
|
||||
void glBindVertexArray(GLuint array) __attribute__((alias("glshim_glBindVertexArray")));
|
||||
void glDeleteVertexArrays(GLsizei n, const GLuint *arrays) __attribute__((alias("glshim_glDeleteVertexArrays")));
|
||||
GLboolean glIsVertexArray(GLuint array) __attribute__((alias("glshim_glIsVertexArray")));
|
||||
|
||||
|
||||
@@ -16,19 +16,30 @@ typedef struct {
|
||||
|
||||
KHASH_MAP_INIT_INT(buff, glbuffer_t *)
|
||||
|
||||
/*
|
||||
extern void glGenBuffers(GLsizei n, GLuint * buffers);
|
||||
extern void glBindBuffer(GLenum target, GLuint buffer);
|
||||
extern void glBufferData(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage);
|
||||
extern void glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data);
|
||||
extern void glDeleteBuffers(GLsizei n, const GLuint * buffers);
|
||||
extern GLboolean glIsBuffer(GLuint buffer);
|
||||
extern void glGetBufferParameteriv(GLenum target, GLenum value, GLint * data);
|
||||
*/
|
||||
void glshim_glGenBuffers(GLsizei n, GLuint * buffers);
|
||||
void glshim_glBindBuffer(GLenum target, GLuint buffer);
|
||||
void glshim_glBufferData(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage);
|
||||
void glshim_glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data);
|
||||
void glshim_glDeleteBuffers(GLsizei n, const GLuint * buffers);
|
||||
GLboolean glshim_glIsBuffer(GLuint buffer);
|
||||
void glshim_glGetBufferParameteriv(GLenum target, GLenum value, GLint * data);
|
||||
|
||||
void *glshim_glMapBuffer(GLenum target, GLenum access);
|
||||
GLboolean glshim_glUnmapBuffer(GLenum target);
|
||||
void glshim_glGetBufferPointerv(GLenum target, GLenum pname, GLvoid ** params);
|
||||
void glshim_glGetBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid * data);
|
||||
|
||||
void glGenBuffers(GLsizei n, GLuint * buffers);
|
||||
void glBindBuffer(GLenum target, GLuint buffer);
|
||||
void glBufferData(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage);
|
||||
void glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data);
|
||||
void glDeleteBuffers(GLsizei n, const GLuint * buffers);
|
||||
GLboolean glIsBuffer(GLuint buffer);
|
||||
void glGetBufferParameteriv(GLenum target, GLenum value, GLint * data);
|
||||
void *glMapBuffer(GLenum target, GLenum access);
|
||||
GLboolean glUnmapBuffer(GLenum target);
|
||||
void glGetBufferPointerv(GLenum target, GLenum pname, GLvoid ** params);
|
||||
extern void glGetBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid * data);
|
||||
void glGetBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid * data);
|
||||
|
||||
void glGenBuffersARB(GLsizei n, GLuint * buffers);
|
||||
void glBindBufferARB(GLenum target, GLuint buffer);
|
||||
@@ -75,9 +86,13 @@ typedef struct {
|
||||
|
||||
KHASH_MAP_INIT_INT(glvao, glvao_t*)
|
||||
|
||||
void glshim_glGenVertexArrays(GLsizei n, GLuint *arrays);
|
||||
void glshim_glBindVertexArray(GLuint array);
|
||||
void glshim_glDeleteVertexArrays(GLsizei n, const GLuint *arrays);
|
||||
GLboolean glshim_glIsVertexArray(GLuint array);
|
||||
|
||||
void glGenVertexArrays(GLsizei n, GLuint *arrays);
|
||||
void glBindVertexArray(GLuint array);
|
||||
void glDeleteVertexArrays(GLsizei n, const GLuint *arrays);
|
||||
GLboolean glIsVertexArray(GLuint array);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -92,7 +92,7 @@ const char* PrintEnum(GLenum what) {
|
||||
p(GL_TEXTURE6);
|
||||
p(GL_TEXTURE7);
|
||||
// mode
|
||||
p(GL_POINT);
|
||||
p(GL_POINTS);
|
||||
p(GL_LINES);
|
||||
p(GL_LINE_LOOP);
|
||||
p(GL_LINE_STRIP);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include <GL/gl.h>
|
||||
//#include <GL/gl.h>
|
||||
|
||||
// newly-defined GL functions
|
||||
GLboolean glIsList(GLuint list);
|
||||
|
||||
@@ -3,344 +3,437 @@
|
||||
#include "stack.h"
|
||||
|
||||
// Client State
|
||||
void glClientAttribDefaultEXT(GLbitfield mask) {
|
||||
void glshim_glClientAttribDefault(GLbitfield mask) {
|
||||
if (mask & GL_CLIENT_PIXEL_STORE_BIT) {
|
||||
glPixelStorei(GL_PACK_ALIGNMENT, 0);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 0);
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
|
||||
glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
|
||||
glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
|
||||
glPixelStorei(GL_PACK_ROW_LENGTH, 0);
|
||||
glPixelStorei(GL_PACK_SKIP_PIXELS, 0);
|
||||
glPixelStorei(GL_PACK_SKIP_ROWS, 0);
|
||||
glshim_glPixelStorei(GL_PACK_ALIGNMENT, 0);
|
||||
glshim_glPixelStorei(GL_UNPACK_ALIGNMENT, 0);
|
||||
glshim_glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
|
||||
glshim_glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
|
||||
glshim_glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
|
||||
glshim_glPixelStorei(GL_PACK_ROW_LENGTH, 0);
|
||||
glshim_glPixelStorei(GL_PACK_SKIP_PIXELS, 0);
|
||||
glshim_glPixelStorei(GL_PACK_SKIP_ROWS, 0);
|
||||
}
|
||||
#define enable_disable(pname, enabled) \
|
||||
if (enabled) glEnableClientState(pname); \
|
||||
else glDisableClientState(pname)
|
||||
if (enabled) glshim_glEnableClientState(pname); \
|
||||
else glshim_glDisableClientState(pname)
|
||||
|
||||
if (mask & GL_CLIENT_VERTEX_ARRAY_BIT) {
|
||||
int client = state.texture.client;
|
||||
int client = glstate.texture.client;
|
||||
|
||||
enable_disable(GL_VERTEX_ARRAY, false);
|
||||
enable_disable(GL_NORMAL_ARRAY, false);
|
||||
enable_disable(GL_COLOR_ARRAY, false);
|
||||
enable_disable(GL_SECONDARY_COLOR_ARRAY, false);
|
||||
for (int a=0; a<MAX_TEX; a++) {
|
||||
glClientActiveTexture(GL_TEXTURE0+a);
|
||||
glshim_glClientActiveTexture(GL_TEXTURE0+a);
|
||||
enable_disable(GL_TEXTURE_COORD_ARRAY, false);
|
||||
}
|
||||
#undef enable_disable
|
||||
if (state.texture.client != client) glClientActiveTexture(GL_TEXTURE0+client);
|
||||
if (glstate.texture.client != client) glshim_glClientActiveTexture(GL_TEXTURE0+client);
|
||||
}
|
||||
}
|
||||
void glPushClientAttribDefaultEXT(GLbitfield mask) {
|
||||
glPushClientAttrib(mask);
|
||||
glClientAttribDefaultEXT(mask);
|
||||
void glshim_glPushClientAttribDefault(GLbitfield mask) {
|
||||
glshim_glPushClientAttrib(mask);
|
||||
glshim_glClientAttribDefault(mask);
|
||||
}
|
||||
|
||||
// Matrix
|
||||
#define mat(f) \
|
||||
GLenum old_mat; \
|
||||
glGetIntegerv(GL_MATRIX_MODE, &old_mat); \
|
||||
glMatrixMode(matrixMode); \
|
||||
f; \
|
||||
glMatrixMode(old_mat)
|
||||
glshim_glGetIntegerv(GL_MATRIX_MODE, &old_mat); \
|
||||
glshim_glMatrixMode(matrixMode); \
|
||||
glshim_##f; \
|
||||
glshim_glMatrixMode(old_mat)
|
||||
|
||||
void glMatrixLoadfEXT(GLenum matrixMode, const GLfloat *m) {
|
||||
void glshim_glMatrixLoadf(GLenum matrixMode, const GLfloat *m) {
|
||||
mat(glLoadMatrixf(m));
|
||||
}
|
||||
void glMatrixLoaddEXT(GLenum matrixMode, const GLdouble *m) {
|
||||
void glshim_glMatrixLoadd(GLenum matrixMode, const GLdouble *m) {
|
||||
mat(glLoadMatrixd(m));
|
||||
}
|
||||
void glMatrixMultfEXT(GLenum matrixMode, const GLfloat *m) {
|
||||
void glshim_glMatrixMultf(GLenum matrixMode, const GLfloat *m) {
|
||||
mat(glMultMatrixf(m));
|
||||
}
|
||||
void glMatrixMultdEXT(GLenum matrixMode, const GLdouble *m) {
|
||||
void glshim_glMatrixMultd(GLenum matrixMode, const GLdouble *m) {
|
||||
mat(glMultMatrixd(m));
|
||||
}
|
||||
void glMatrixLoadIdentityEXT(GLenum matrixMode) {
|
||||
void glshim_glMatrixLoadIdentity(GLenum matrixMode) {
|
||||
mat(glLoadIdentity());
|
||||
}
|
||||
void glMatrixRotatefEXT(GLenum matrixMode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z) {
|
||||
void glshim_glMatrixRotatef(GLenum matrixMode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z) {
|
||||
mat(glRotatef(angle, x, y, z));
|
||||
}
|
||||
void glMatrixRotatedEXT(GLenum matrixMode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z) {
|
||||
void glshim_glMatrixRotated(GLenum matrixMode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z) {
|
||||
mat(glRotated(angle, x, y, z));
|
||||
}
|
||||
void glMatrixScalefEXT(GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z) {
|
||||
void glshim_glMatrixScalef(GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z) {
|
||||
mat(glScalef(x, y, z));
|
||||
}
|
||||
void glMatrixScaledEXT(GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z) {
|
||||
void glshim_glMatrixScaled(GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z) {
|
||||
mat(glScaled(x, y, z));
|
||||
}
|
||||
void glMatrixTranslatefEXT(GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z) {
|
||||
void glshim_glMatrixTranslatef(GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z) {
|
||||
mat(glTranslatef(x, y, z));
|
||||
}
|
||||
void glMatrixTranslatedEXT(GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z) {
|
||||
void glshim_glMatrixTranslated(GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z) {
|
||||
mat(glTranslated(x, y, z));
|
||||
}
|
||||
void glMatrixOrthoEXT(GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f) {
|
||||
void glshim_glMatrixOrtho(GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f) {
|
||||
mat(glOrtho(l, r, b ,t, n, f));
|
||||
}
|
||||
void glMatrixFrustumEXT(GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f) {
|
||||
void glshim_glMatrixFrustum(GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f) {
|
||||
mat(glFrustum(l, r, b, t, n, f));
|
||||
}
|
||||
void glMatrixPushEXT(GLenum matrixMode) {
|
||||
void glshim_glMatrixPush(GLenum matrixMode) {
|
||||
mat(glPushMatrix());
|
||||
}
|
||||
void glMatrixPopEXT(GLenum matrixMode) {
|
||||
void glshim_glMatrixPop(GLenum matrixMode) {
|
||||
mat(glPopMatrix());
|
||||
}
|
||||
void glMatrixLoadTransposefEXT(GLenum matrixMode, const GLfloat *m) {
|
||||
void glshim_glMatrixLoadTransposef(GLenum matrixMode, const GLfloat *m) {
|
||||
mat(glLoadTransposeMatrixf(m));
|
||||
}
|
||||
void glMatrixLoadTransposedEXT(GLenum matrixMode, const GLdouble *m) {
|
||||
void glshim_glMatrixLoadTransposed(GLenum matrixMode, const GLdouble *m) {
|
||||
mat(glLoadTransposeMatrixd(m));
|
||||
}
|
||||
void glMatrixMultTransposefEXT(GLenum matrixMode, const GLfloat *m) {
|
||||
void glshim_glMatrixMultTransposef(GLenum matrixMode, const GLfloat *m) {
|
||||
mat(glMultTransposeMatrixf(m));
|
||||
}
|
||||
void glMatrixMultTransposedEXT(GLenum matrixMode, const GLdouble *m) {
|
||||
void glshim_glMatrixMultTransposed(GLenum matrixMode, const GLdouble *m) {
|
||||
mat(glMultTransposeMatrixd(m));
|
||||
}
|
||||
#undef mat
|
||||
|
||||
// Textures
|
||||
#define text(f) \
|
||||
glBindTexture(target, texture); \
|
||||
f
|
||||
glshim_glBindTexture(target, texture); \
|
||||
glshim_##f
|
||||
|
||||
void glTextureParameteriEXT(GLuint texture, GLenum target, GLenum pname, GLint param) {
|
||||
void glshim_glTextureParameteri(GLuint texture, GLenum target, GLenum pname, GLint param) {
|
||||
text(glTexParameteri(target, pname, param));
|
||||
}
|
||||
void glTextureParameterivEXT(GLuint texture, GLenum target, GLenum pname, const GLint *param) {
|
||||
void glshim_glTextureParameteriv(GLuint texture, GLenum target, GLenum pname, const GLint *param) {
|
||||
text(glTexParameteriv(target, pname, param));
|
||||
}
|
||||
void glTextureParameterfEXT(GLuint texture, GLenum target, GLenum pname, GLfloat param) {
|
||||
void glshim_glTextureParameterf(GLuint texture, GLenum target, GLenum pname, GLfloat param) {
|
||||
text(glTexParameterf(target, pname, param));
|
||||
}
|
||||
void glTextureParameterfvEXT(GLuint texture, GLenum target, GLenum pname, const GLfloat *param) {
|
||||
void glshim_glTextureParameterfv(GLuint texture, GLenum target, GLenum pname, const GLfloat *param) {
|
||||
text(glTexParameterfv(target, pname, param));
|
||||
}
|
||||
void glTextureImage1DEXT(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
void glshim_glTextureImage1D(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
text(glTexImage1D(target, level, internalformat, width, border, format, type, pixels));
|
||||
}
|
||||
void glTextureImage2DEXT(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
void glshim_glTextureImage2D(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
text(glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels));
|
||||
}
|
||||
void glTextureSubImage1DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
void glshim_glTextureSubImage1D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
text(glTexSubImage1D(target, level, xoffset, width, format, type, pixels));
|
||||
}
|
||||
void glTextureSubImage2DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
void glshim_glTextureSubImage2D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
text(glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels));
|
||||
}
|
||||
void glCopyTextureImage1DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) {
|
||||
void glshim_glCopyTextureImage1D(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) {
|
||||
text(glCopyTexImage1D(target, level, internalformat, x, y, width, border));
|
||||
}
|
||||
void glCopyTextureImage2DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) {
|
||||
void glshim_glCopyTextureImage2D(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) {
|
||||
text(glCopyTexImage2D(target, level, internalformat, x, y, width, height, border));
|
||||
}
|
||||
void glCopyTextureSubImage1DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) {
|
||||
void glshim_glCopyTextureSubImage1D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) {
|
||||
text(glCopyTexSubImage1D(target, level, xoffset, x, y, width));
|
||||
}
|
||||
void glCopyTextureSubImage2DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
|
||||
void glshim_glCopyTextureSubImage2D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
|
||||
text(glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height));
|
||||
}
|
||||
void glGetTextureImageEXT(GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels) {
|
||||
void glshim_glGetTextureImage(GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels) {
|
||||
text(glGetTexImage(target, level, format, type, pixels));
|
||||
}
|
||||
void glGetTextureParameterfvEXT(GLuint texture, GLenum target, GLenum pname, GLfloat *params) {
|
||||
void glshim_glGetTextureParameterfv(GLuint texture, GLenum target, GLenum pname, GLfloat *params) {
|
||||
text(glGetTexParameterfv(target, pname, params));
|
||||
}
|
||||
void glGetTextureParameterivEXT(GLuint texture, GLenum target, GLenum pname, GLint *params) {
|
||||
void glshim_glGetTextureParameteriv(GLuint texture, GLenum target, GLenum pname, GLint *params) {
|
||||
text(glGetTexParameteriv(target, pname, params));
|
||||
}
|
||||
void glGetTextureLevelParameterfvEXT(GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params) {
|
||||
void glshim_glGetTextureLevelParameterfv(GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params) {
|
||||
text(glGetTexLevelParameterfv(target, level, pname, params));
|
||||
}
|
||||
void glGetTextureLevelParameterivEXT(GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params) {
|
||||
void glshim_glGetTextureLevelParameteriv(GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params) {
|
||||
text(glGetTexLevelParameteriv(target, level, pname, params));
|
||||
}
|
||||
|
||||
// Texture 3D
|
||||
void glTextureImage3DEXT(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
void glshim_glTextureImage3D(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
text(glTexImage3D(target, level, internalformat, width, height, depth, border, format, type, pixels));
|
||||
}
|
||||
void glTextureSubImage3DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
void glshim_glTextureSubImage3D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
text(glTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels));
|
||||
}
|
||||
void glCopyTextureSubImage3DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
|
||||
void glshim_glCopyTextureSubImage3D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
|
||||
text(glCopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height));
|
||||
}
|
||||
// Compressed texture
|
||||
void glCompressedTextureImage3DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data) {
|
||||
void glshim_glCompressedTextureImage3D(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data) {
|
||||
text(glCompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data));
|
||||
}
|
||||
void glCompressedTextureImage2DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data) {
|
||||
void glshim_glCompressedTextureImage2D(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data) {
|
||||
text(glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data));
|
||||
}
|
||||
void glCompressedTextureImage1DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data) {
|
||||
void glshim_glCompressedTextureImage1D(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data) {
|
||||
text(glCompressedTexImage1D(target, level, internalformat, width, border, imageSize, data));
|
||||
}
|
||||
void glCompressedTextureSubImage3DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data) {
|
||||
void glshim_glCompressedTextureSubImage3D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data) {
|
||||
text(glCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data));
|
||||
}
|
||||
void glCompressedTextureSubImage2DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data) {
|
||||
void glshim_glCompressedTextureSubImage2D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data) {
|
||||
text(glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data));
|
||||
}
|
||||
void glCompressedTextureSubImage1DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data) {
|
||||
void glshim_glCompressedTextureSubImage1D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data) {
|
||||
text(glCompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, data));
|
||||
}
|
||||
void glGetCompressedTextureImageEXT(GLuint texture, GLenum target, GLint level, GLvoid *img) {
|
||||
void glshim_glGetCompressedTextureImage(GLuint texture, GLenum target, GLint level, GLvoid *img) {
|
||||
text(glGetCompressedTexImage(target, level, img));
|
||||
}
|
||||
|
||||
#undef text
|
||||
#define text(f) \
|
||||
GLenum old_tex = state.texture.active; \
|
||||
if(texunit != old_tex) glActiveTexture(texunit); \
|
||||
f; \
|
||||
if(texunit != old_tex) glActiveTexture(old_tex)
|
||||
GLenum old_tex = glstate.texture.active; \
|
||||
if(texunit != old_tex) glshim_glActiveTexture(texunit); \
|
||||
glshim_##f; \
|
||||
if(texunit != old_tex) glshim_glActiveTexture(old_tex)
|
||||
#define texc(f) \
|
||||
GLenum old_tex = state.texture.client; \
|
||||
if(texunit != old_tex) glClientActiveTexture(texunit); \
|
||||
f; \
|
||||
if(texunit != old_tex) glClientActiveTexture(old_tex)
|
||||
GLenum old_tex = glstate.texture.client; \
|
||||
if(texunit != old_tex) glshim_glClientActiveTexture(texunit); \
|
||||
glshim_##f; \
|
||||
if(texunit != old_tex) glshim_glClientActiveTexture(old_tex)
|
||||
|
||||
void glBindMultiTextureEXT(GLenum texunit, GLenum target, GLuint texture) {
|
||||
void glshim_glBindMultiTexture(GLenum texunit, GLenum target, GLuint texture) {
|
||||
text(glBindTexture(target, texture));
|
||||
}
|
||||
void glMultiTexCoordPointerEXT(GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) {
|
||||
void glshim_glMultiTexCoordPointer(GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) {
|
||||
texc(glTexCoordPointer(size, type, stride, pointer));
|
||||
}
|
||||
void glMultiTexEnvfEXT(GLenum texunit, GLenum target, GLenum pname, GLfloat param) {
|
||||
void glshim_glMultiTexEnvf(GLenum texunit, GLenum target, GLenum pname, GLfloat param) {
|
||||
text(glTexEnvf(target, pname, param));
|
||||
}
|
||||
void glMultiTexEnvfvEXT(GLenum texunit, GLenum target, GLenum pname, const GLfloat *params) {
|
||||
void glshim_glMultiTexEnvfv(GLenum texunit, GLenum target, GLenum pname, const GLfloat *params) {
|
||||
text(glTexEnvfv(target, pname, params));
|
||||
}
|
||||
void glMultiTexEnviEXT(GLenum texunit, GLenum target, GLenum pname, GLint param) {
|
||||
void glshim_glMultiTexEnvi(GLenum texunit, GLenum target, GLenum pname, GLint param) {
|
||||
text(glTexEnvi(target, pname, param));
|
||||
}
|
||||
void glMultiTexEnvivEXT(GLenum texunit, GLenum target, GLenum pname, const GLint *params) {
|
||||
void glshim_glMultiTexEnviv(GLenum texunit, GLenum target, GLenum pname, const GLint *params) {
|
||||
text(glTexEnviv(target, pname, params));
|
||||
}
|
||||
void glMultiTexGendEXT(GLenum texunit, GLenum coord, GLenum pname, GLdouble param) {
|
||||
void glshim_glMultiTexGend(GLenum texunit, GLenum coord, GLenum pname, GLdouble param) {
|
||||
text(glTexGend(coord, pname, param));
|
||||
}
|
||||
void glMultiTexGendvEXT(GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params) {
|
||||
void glshim_glMultiTexGendv(GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params) {
|
||||
text(glTexGendv(coord, pname, params));
|
||||
}
|
||||
void glMultiTexGenfEXT(GLenum texunit, GLenum coord, GLenum pname, GLfloat param) {
|
||||
void glshim_glMultiTexGenf(GLenum texunit, GLenum coord, GLenum pname, GLfloat param) {
|
||||
text(glTexGenf(coord, pname, param));
|
||||
}
|
||||
void glMultiTexGenfvEXT(GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params) {
|
||||
void glshim_glMultiTexGenfv(GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params) {
|
||||
text(glTexGenfv(coord, pname, params));
|
||||
}
|
||||
void glMultiTexGeniEXT(GLenum texunit, GLenum coord, GLenum pname, GLint param) {
|
||||
void glshim_glMultiTexGeni(GLenum texunit, GLenum coord, GLenum pname, GLint param) {
|
||||
text(glTexGeni(coord, pname, param));
|
||||
}
|
||||
void glMultiTexGenivEXT(GLenum texunit, GLenum coord, GLenum pname, const GLint *params) {
|
||||
void glshim_glMultiTexGeniv(GLenum texunit, GLenum coord, GLenum pname, const GLint *params) {
|
||||
text(glTexGeniv(coord, pname, params));
|
||||
}
|
||||
void glGetMultiTexEnvfvEXT(GLenum texunit, GLenum target, GLenum pname, GLfloat *params) {
|
||||
void glshim_glGetMultiTexEnvfv(GLenum texunit, GLenum target, GLenum pname, GLfloat *params) {
|
||||
text(glGetTexEnvfv(target, pname, params));
|
||||
}
|
||||
void glGetMultiTexEnvivEXT(GLenum texunit, GLenum target, GLenum pname, GLint *params) {
|
||||
void glshim_glGetMultiTexEnviv(GLenum texunit, GLenum target, GLenum pname, GLint *params) {
|
||||
text(glGetTexEnviv(target, pname, params));
|
||||
}
|
||||
void glGetMultiTexGendvEXT(GLenum texunit, GLenum coord, GLenum pname, GLdouble *params) {
|
||||
void glshim_glGetMultiTexGendv(GLenum texunit, GLenum coord, GLenum pname, GLdouble *params) {
|
||||
text(glGetTexGendv(coord, pname, params));
|
||||
}
|
||||
void glGetMultiTexGenfvEXT(GLenum texunit, GLenum coord, GLenum pname, GLfloat *params) {
|
||||
void glshim_glGetMultiTexGenfv(GLenum texunit, GLenum coord, GLenum pname, GLfloat *params) {
|
||||
text(glGetTexGenfv(coord, pname, params));
|
||||
}
|
||||
void glGetMultiTexGenivEXT(GLenum texunit, GLenum coord, GLenum pname, GLint *params) {
|
||||
void glshim_glGetMultiTexGeniv(GLenum texunit, GLenum coord, GLenum pname, GLint *params) {
|
||||
text(glGetTexGeniv(coord, pname, params));
|
||||
}
|
||||
void glMultiTexParameteriEXT(GLenum texunit, GLenum target, GLenum pname, GLint param) {
|
||||
void glshim_glMultiTexParameteri(GLenum texunit, GLenum target, GLenum pname, GLint param) {
|
||||
text(glTexParameteri(target, pname, param));
|
||||
}
|
||||
void glMultiTexParameterivEXT(GLenum texunit, GLenum target, GLenum pname, const GLint *param) {
|
||||
void glshim_glMultiTexParameteriv(GLenum texunit, GLenum target, GLenum pname, const GLint *param) {
|
||||
text(glTexParameteriv(target, pname, param));
|
||||
}
|
||||
void glMultiTexParameterfEXT(GLenum texunit, GLenum target, GLenum pname, GLfloat param) {
|
||||
void glshim_glMultiTexParameterf(GLenum texunit, GLenum target, GLenum pname, GLfloat param) {
|
||||
text(glTexParameterf(target, pname, param));
|
||||
}
|
||||
void glMultiTexParameterfvEXT(GLenum texunit, GLenum target, GLenum pname, const GLfloat *param) {
|
||||
void glshim_glMultiTexParameterfv(GLenum texunit, GLenum target, GLenum pname, const GLfloat *param) {
|
||||
text(glTexParameterfv(target, pname, param));
|
||||
}
|
||||
void glMultiTexImage1DEXT(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
void glshim_glMultiTexImage1D(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
text(glTexImage1D(target, level, internalformat, width, border, format, type, pixels));
|
||||
}
|
||||
void glMultiTexImage2DEXT(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
void glshim_glMultiTexImage2D(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
text(glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels));
|
||||
}
|
||||
void glMultiTexSubImage1DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
void glshim_glMultiTexSubImage1D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
text(glTexSubImage1D(target, level, xoffset, width, format, type, pixels));
|
||||
}
|
||||
void glMultiTexSubImage2DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
void glshim_glMultiTexSubImage2D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
text(glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels));
|
||||
}
|
||||
void glCopyMultiTexImage1DEXT(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) {
|
||||
void glshim_glCopyMultiTexImage1D(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) {
|
||||
text(glCopyTexImage1D(target, level, internalformat, x, y, width, border));
|
||||
}
|
||||
void glCopyMultiTexImage2DEXT(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) {
|
||||
void glshim_glCopyMultiTexImage2D(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) {
|
||||
text(glCopyTexImage2D(target, level, internalformat, x, y, width, height, border));
|
||||
}
|
||||
void glCopyMultiTexSubImage1DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) {
|
||||
void glshim_glCopyMultiTexSubImage1D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) {
|
||||
text(glCopyTexSubImage1D(target, level, xoffset, x, y, width));
|
||||
}
|
||||
void glCopyMultiTexSubImage2DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
|
||||
void glshim_glCopyMultiTexSubImage2D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
|
||||
text(glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height));
|
||||
}
|
||||
void glGetMultiTexImageEXT(GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels) {
|
||||
void glshim_glGetMultiTexImage(GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels) {
|
||||
text(glGetTexImage(target, level, format, type, pixels));
|
||||
}
|
||||
void glGetMultiTexParameterfvEXT(GLenum texunit, GLenum target, GLenum pname, GLfloat *params) {
|
||||
void glshim_glGetMultiTexParameterfv(GLenum texunit, GLenum target, GLenum pname, GLfloat *params) {
|
||||
text(glGetTexParameterfv(target, pname, params));
|
||||
}
|
||||
void glGetMultiTexParameterivEXT(GLenum texunit, GLenum target, GLenum pname, GLint *params) {
|
||||
void glshim_glGetMultiTexParameteriv(GLenum texunit, GLenum target, GLenum pname, GLint *params) {
|
||||
text(glGetTexParameteriv(target, pname, params));
|
||||
}
|
||||
void glGetMultiTexLevelParameterfvEXT(GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params) {
|
||||
void glshim_glGetMultiTexLevelParameterfv(GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params) {
|
||||
text(glGetTexLevelParameterfv(target, level, pname, params));
|
||||
}
|
||||
void glGetMultiTexLevelParameterivEXT(GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params) {
|
||||
void glshim_glGetMultiTexLevelParameteriv(GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params) {
|
||||
text(glGetTexLevelParameteriv(target, level, pname, params));
|
||||
}
|
||||
void glMultiTexImage3DEXT(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
void glshim_glMultiTexImage3D(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
text(glTexImage3D(target, level, internalformat, width, height, depth, border, format, type, pixels));
|
||||
}
|
||||
void glMultiTexSubImage3DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
void glshim_glMultiTexSubImage3D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels) {
|
||||
text(glTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels));
|
||||
}
|
||||
void glCopyMultiTexSubImage3DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
|
||||
void glshim_glCopyMultiTexSubImage3D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) {
|
||||
text(glCopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height));
|
||||
}
|
||||
// Compressed texture
|
||||
void glCompressedMultiTexImage3DEXT(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data) {
|
||||
void glshim_glCompressedMultiTexImage3D(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data) {
|
||||
text(glCompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data));
|
||||
}
|
||||
void glCompressedMultiTexImage2DEXT(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data) {
|
||||
void glshim_glCompressedMultiTexImage2D(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data) {
|
||||
text(glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data));
|
||||
}
|
||||
void glCompressedMultiTexImage1DEXT(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data) {
|
||||
void glshim_glCompressedMultiTexImage1D(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data) {
|
||||
text(glCompressedTexImage1D(target, level, internalformat, width, border, imageSize, data));
|
||||
}
|
||||
void glCompressedMultiTexSubImage3DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data) {
|
||||
void glshim_glCompressedMultiTexSubImage3D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data) {
|
||||
text(glCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data));
|
||||
}
|
||||
void glCompressedMultiTexSubImage2DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data) {
|
||||
void glshim_glCompressedMultiTexSubImage2D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data) {
|
||||
text(glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data));
|
||||
}
|
||||
void glCompressedMultiTexSubImage1DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data) {
|
||||
void glshim_glCompressedMultiTexSubImage1D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data) {
|
||||
text(glCompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, data));
|
||||
}
|
||||
void glGetCompressedMultiTexImageEXT(GLenum texunit, GLenum target, GLint level, GLvoid *img) {
|
||||
void glshim_glGetCompressedMultiTexImage(GLenum texunit, GLenum target, GLint level, GLvoid *img) {
|
||||
text(glGetCompressedTexImage(target, level, img));
|
||||
}
|
||||
|
||||
//EXT wrapper
|
||||
void glClientAttribDefaultEXT(GLbitfield mask) __attribute__((alias("glshim_glClientAttribDefault")));
|
||||
void glPushClientAttribDefaultEXT(GLbitfield mask) __attribute__((alias("glshim_glPushClientAttribDefault")));
|
||||
void glMatrixLoadfEXT(GLenum matrixMode, const GLfloat *m) __attribute__((alias("glshim_glMatrixLoadf")));
|
||||
void glMatrixLoaddEXT(GLenum matrixMode, const GLdouble *m) __attribute__((alias("glshim_glMatrixLoadd")));
|
||||
void glMatrixMultfEXT(GLenum matrixMode, const GLfloat *m) __attribute__((alias("glshim_glMatrixMultf")));
|
||||
void glMatrixMultdEXT(GLenum matrixMode, const GLdouble *m) __attribute__((alias("glshim_glMatrixMultd")));
|
||||
void glMatrixLoadIdentityEXT(GLenum matrixMode) __attribute__((alias("glshim_glMatrixLoadIdentity")));
|
||||
void glMatrixRotatefEXT(GLenum matrixMode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z) __attribute__((alias("glshim_glMatrixRotatef")));
|
||||
void glMatrixRotatedEXT(GLenum matrixMode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z) __attribute__((alias("glshim_glMatrixRotated")));
|
||||
void glMatrixScalefEXT(GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z) __attribute__((alias("glshim_glMatrixScalef")));
|
||||
void glMatrixScaledEXT(GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z) __attribute__((alias("glshim_glMatrixScaled")));
|
||||
void glMatrixTranslatefEXT(GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z) __attribute__((alias("glshim_glMatrixTranslatef")));
|
||||
void glMatrixTranslatedEXT(GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z) __attribute__((alias("glshim_glMatrixTranslated")));
|
||||
void glMatrixOrthoEXT(GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f) __attribute__((alias("glshim_glMatrixOrtho")));
|
||||
void glMatrixFrustumEXT(GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f) __attribute__((alias("glshim_glMatrixFrustum")));
|
||||
void glMatrixPushEXT(GLenum matrixMode) __attribute__((alias("glshim_glMatrixPush")));
|
||||
void glMatrixPopEXT(GLenum matrixMode) __attribute__((alias("glshim_glMatrixPop")));
|
||||
void glTextureParameteriEXT(GLuint texture, GLenum target, GLenum pname, GLint param) __attribute__((alias("glshim_glTextureParameteri")));
|
||||
void glTextureParameterivEXT(GLuint texture, GLenum target, GLenum pname, const GLint *param) __attribute__((alias("glshim_glTextureParameteriv")));
|
||||
void glTextureParameterfEXT(GLuint texture, GLenum target, GLenum pname, GLfloat param) __attribute__((alias("glshim_glTextureParameterf")));
|
||||
void glTextureParameterfvEXT(GLuint texture, GLenum target, GLenum pname, const GLfloat *param) __attribute__((alias("glshim_glTextureParameterfv")));
|
||||
void glTextureImage1DEXT(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels) __attribute__((alias("glshim_glTextureImage1D")));
|
||||
void glTextureImage2DEXT(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels) __attribute__((alias("glshim_glTextureImage2D")));
|
||||
void glTextureSubImage1DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels) __attribute__((alias("glshim_glTextureSubImage1D")));
|
||||
void glTextureSubImage2DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels) __attribute__((alias("glshim_glTextureSubImage2D")));
|
||||
void glCopyTextureImage1DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) __attribute__((alias("glshim_glCopyTextureImage1D")));
|
||||
void glCopyTextureImage2DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) __attribute__((alias("glshim_glCopyTextureImage2D")));
|
||||
void glCopyTextureSubImage1DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) __attribute__((alias("glshim_glCopyTextureSubImage1D")));
|
||||
void glCopyTextureSubImage2DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) __attribute__((alias("glshim_glCopyTextureSubImage2D")));
|
||||
void glGetTextureImageEXT(GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels) __attribute__((alias("glshim_glGetTextureImage")));
|
||||
void glGetTextureParameterfvEXT(GLuint texture, GLenum target, GLenum pname, GLfloat *params) __attribute__((alias("glshim_glGetTextureParameterfv")));
|
||||
void glGetTextureParameterivEXT(GLuint texture, GLenum target, GLenum pname, GLint *params) __attribute__((alias("glshim_glGetTextureParameteriv")));
|
||||
void glGetTextureLevelParameterfvEXT(GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params) __attribute__((alias("glshim_glGetTextureLevelParameterfv")));
|
||||
void glGetTextureLevelParameterivEXT(GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params) __attribute__((alias("glshim_glGetTextureLevelParameteriv")));
|
||||
void glTextureImage3DEXT(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels) __attribute__((alias("glshim_glTextureImage3D")));
|
||||
void glTextureSubImage3DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels) __attribute__((alias("glshim_glTextureSubImage3D")));
|
||||
void glCopyTextureSubImage3DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) __attribute__((alias("glshim_glCopyTextureSubImage3D")));
|
||||
void glBindMultiTextureEXT(GLenum texunit, GLenum target, GLuint texture) __attribute__((alias("glshim_glBindMultiTexture")));
|
||||
void glMultiTexCoordPointerEXT(GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) __attribute__((alias("glshim_glMultiTexCoordPointer")));
|
||||
void glMultiTexEnvfEXT(GLenum texunit, GLenum target, GLenum pname, GLfloat param) __attribute__((alias("glshim_glMultiTexEnvf")));
|
||||
void glMultiTexEnvfvEXT(GLenum texunit, GLenum target, GLenum pname, const GLfloat *params) __attribute__((alias("glshim_glMultiTexEnvfv")));
|
||||
void glMultiTexEnviEXT(GLenum texunit, GLenum target, GLenum pname, GLint param) __attribute__((alias("glshim_glMultiTexEnvi")));
|
||||
void glMultiTexEnvivEXT(GLenum texunit, GLenum target, GLenum pname, const GLint *params) __attribute__((alias("glshim_glMultiTexEnviv")));
|
||||
void glMultiTexGendEXT(GLenum texunit, GLenum coord, GLenum pname, GLdouble param) __attribute__((alias("glshim_glMultiTexGend")));
|
||||
void glMultiTexGendvEXT(GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params) __attribute__((alias("glshim_glMultiTexGendv")));
|
||||
void glMultiTexGenfEXT(GLenum texunit, GLenum coord, GLenum pname, GLfloat param) __attribute__((alias("glshim_glMultiTexGenf")));
|
||||
void glMultiTexGenfvEXT(GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params) __attribute__((alias("glshim_glMultiTexGenfv")));
|
||||
void glMultiTexGeniEXT(GLenum texunit, GLenum coord, GLenum pname, GLint param) __attribute__((alias("glshim_glMultiTexGeni")));
|
||||
void glMultiTexGenivEXT(GLenum texunit, GLenum coord, GLenum pname, const GLint *params) __attribute__((alias("glshim_glMultiTexGeniv")));
|
||||
void glGetMultiTexEnvfvEXT(GLenum texunit, GLenum target, GLenum pname, GLfloat *params) __attribute__((alias("glshim_glGetMultiTexEnvfv")));
|
||||
void glGetMultiTexEnvivEXT(GLenum texunit, GLenum target, GLenum pname, GLint *params) __attribute__((alias("glshim_glGetMultiTexEnviv")));
|
||||
void glGetMultiTexGendvEXT(GLenum texunit, GLenum coord, GLenum pname, GLdouble *params) __attribute__((alias("glshim_glGetMultiTexGendv")));
|
||||
void glGetMultiTexGenfvEXT(GLenum texunit, GLenum coord, GLenum pname, GLfloat *params) __attribute__((alias("glshim_glGetMultiTexGenfv")));
|
||||
void glGetMultiTexGenivEXT(GLenum texunit, GLenum coord, GLenum pname, GLint *params) __attribute__((alias("glshim_glGetMultiTexGeniv")));
|
||||
void glMultiTexParameteriEXT(GLenum texunit, GLenum target, GLenum pname, GLint param) __attribute__((alias("glshim_glMultiTexParameteri")));
|
||||
void glMultiTexParameterivEXT(GLenum texunit, GLenum target, GLenum pname, const GLint *param) __attribute__((alias("glshim_glMultiTexParameteriv")));
|
||||
void glMultiTexParameterfEXT(GLenum texunit, GLenum target, GLenum pname, GLfloat param) __attribute__((alias("glshim_glMultiTexParameterf")));
|
||||
void glMultiTexParameterfvEXT(GLenum texunit, GLenum target, GLenum pname, const GLfloat *param) __attribute__((alias("glshim_glMultiTexParameterfv")));
|
||||
void glMultiTexImage1DEXT(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels) __attribute__((alias("glshim_glMultiTexImage1D")));
|
||||
void glMultiTexImage2DEXT(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels) __attribute__((alias("glshim_glMultiTexImage2D")));
|
||||
void glMultiTexSubImage1DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels) __attribute__((alias("glshim_glMultiTexSubImage1D")));
|
||||
void glMultiTexSubImage2DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels) __attribute__((alias("glshim_glMultiTexSubImage2D")));
|
||||
void glCopyMultiTexImage1DEXT(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) __attribute__((alias("glshim_glCopyMultiTexImage1D")));
|
||||
void glCopyMultiTexImage2DEXT(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) __attribute__((alias("glshim_glCopyMultiTexImage2D")));
|
||||
void glCopyMultiTexSubImage1DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) __attribute__((alias("glshim_glCopyMultiTexSubImage1D")));
|
||||
void glCopyMultiTexSubImage2DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) __attribute__((alias("glshim_glCopyMultiTexSubImage2D")));
|
||||
void glGetMultiTexImageEXT(GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels) __attribute__((alias("glshim_glGetMultiTexImage")));
|
||||
void glGetMultiTexParameterfvEXT(GLenum texunit, GLenum target, GLenum pname, GLfloat *params) __attribute__((alias("glshim_glGetMultiTexParameterfv")));
|
||||
void glGetMultiTexParameterivEXT(GLenum texunit, GLenum target, GLenum pname, GLint *params) __attribute__((alias("glshim_glGetMultiTexParameteriv")));
|
||||
void glGetMultiTexLevelParameterfvEXT(GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params) __attribute__((alias("glshim_glGetMultiTexLevelParameterfv")));
|
||||
void glGetMultiTexLevelParameterivEXT(GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params) __attribute__((alias("glshim_glGetMultiTexLevelParameteriv")));
|
||||
void glMultiTexImage3DEXT(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels) __attribute__((alias("glshim_glMultiTexImage3D")));
|
||||
void glMultiTexSubImage3DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels) __attribute__((alias("glshim_glMultiTexSubImage3D")));
|
||||
void glCopyMultiTexSubImage3DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) __attribute__((alias("glshim_glCopyMultiTexSubImage3D")));
|
||||
void glCompressedTextureImage3DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data) __attribute__((alias("glshim_glCompressedTextureImage3D")));
|
||||
void glCompressedTextureImage2DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data) __attribute__((alias("glshim_glCompressedTextureImage2D")));
|
||||
void glCompressedTextureImage1DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data) __attribute__((alias("glshim_glCompressedTextureImage1D")));
|
||||
void glCompressedTextureSubImage3DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data) __attribute__((alias("glshim_glCompressedTextureSubImage3D")));
|
||||
void glCompressedTextureSubImage2DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data) __attribute__((alias("glshim_glCompressedTextureSubImage2D")));
|
||||
void glCompressedTextureSubImage1DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data) __attribute__((alias("glshim_glCompressedTextureSubImage1D")));
|
||||
void glGetCompressedTextureImageEXT(GLuint texture, GLenum target, GLint level, GLvoid *img) __attribute__((alias("glshim_glGetCompressedTextureImage")));
|
||||
void glCompressedMultiTexImage3DEXT(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data) __attribute__((alias("glshim_glCompressedMultiTexImage3D")));
|
||||
void glCompressedMultiTexImage2DEXT(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data) __attribute__((alias("glshim_glCompressedMultiTexImage2D")));
|
||||
void glCompressedMultiTexImage1DEXT(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data) __attribute__((alias("glshim_glCompressedMultiTexImage1D")));
|
||||
void glCompressedMultiTexSubImage3DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data) __attribute__((alias("glshim_glCompressedMultiTexSubImage3D")));
|
||||
void glCompressedMultiTexSubImage2DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data) __attribute__((alias("glshim_glCompressedMultiTexSubImage2D")));
|
||||
void glCompressedMultiTexSubImage1DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data) __attribute__((alias("glshim_glCompressedMultiTexSubImage1D")));
|
||||
void glGetCompressedMultiTexImageEXT(GLenum texunit, GLenum target, GLint level, GLvoid *img) __attribute__((alias("glshim_glGetCompressedMultiTexImage")));
|
||||
void glMatrixLoadTransposefEXT(GLenum matrixMode, const GLfloat *m) __attribute__((alias("glshim_glMatrixLoadTransposef")));
|
||||
void glMatrixLoadTransposedEXT(GLenum matrixMode, const GLdouble *m) __attribute__((alias("glshim_glMatrixLoadTransposed")));
|
||||
void glMatrixMultTransposefEXT(GLenum matrixMode, const GLfloat *m) __attribute__((alias("glshim_glMatrixMultTransposef")));
|
||||
void glMatrixMultTransposedEXT(GLenum matrixMode, const GLdouble *m) __attribute__((alias("glshim_glMatrixMultTransposed")));
|
||||
|
||||
#undef text
|
||||
#undef texc
|
||||
|
||||
@@ -3,104 +3,104 @@
|
||||
|
||||
#include "gl.h"
|
||||
|
||||
void glClientAttribDefaultEXT(GLbitfield mask);
|
||||
void glPushClientAttribDefaultEXT(GLbitfield mask);
|
||||
void glshim_glClientAttribDefault(GLbitfield mask);
|
||||
void glshim_glPushClientAttribDefault(GLbitfield mask);
|
||||
|
||||
void glMatrixLoadfEXT(GLenum matrixMode, const GLfloat *m);
|
||||
void glMatrixLoaddEXT(GLenum matrixMode, const GLdouble *m);
|
||||
void glMatrixMultfEXT(GLenum matrixMode, const GLfloat *m);
|
||||
void glMatrixMultdEXT(GLenum matrixMode, const GLdouble *m);
|
||||
void glMatrixLoadIdentityEXT(GLenum matrixMode);
|
||||
void glMatrixRotatefEXT(GLenum matrixMode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
|
||||
void glMatrixRotatedEXT(GLenum matrixMode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
|
||||
void glMatrixScalefEXT(GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z);
|
||||
void glMatrixScaledEXT(GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z);
|
||||
void glMatrixTranslatefEXT(GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z);
|
||||
void glMatrixTranslatedEXT(GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z);
|
||||
void glMatrixOrthoEXT(GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f);
|
||||
void glMatrixFrustumEXT(GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f);
|
||||
void glMatrixPushEXT(GLenum matrixMode);
|
||||
void glMatrixPopEXT(GLenum matrixMode);
|
||||
void glshim_glMatrixLoadf(GLenum matrixMode, const GLfloat *m);
|
||||
void glshim_glMatrixLoadd(GLenum matrixMode, const GLdouble *m);
|
||||
void glshim_glMatrixMultf(GLenum matrixMode, const GLfloat *m);
|
||||
void glshim_glMatrixMultd(GLenum matrixMode, const GLdouble *m);
|
||||
void glshim_glMatrixLoadIdentity(GLenum matrixMode);
|
||||
void glshim_glMatrixRotatef(GLenum matrixMode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
|
||||
void glshim_glMatrixRotated(GLenum matrixMode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
|
||||
void glshim_glMatrixScalef(GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z);
|
||||
void glshim_glMatrixScaled(GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z);
|
||||
void glshim_glMatrixTranslatef(GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z);
|
||||
void glshim_glMatrixTranslated(GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z);
|
||||
void glshim_glMatrixOrtho(GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f);
|
||||
void glshim_glMatrixFrustum(GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f);
|
||||
void glshim_glMatrixPush(GLenum matrixMode);
|
||||
void glshim_glMatrixPop(GLenum matrixMode);
|
||||
|
||||
void glTextureParameteriEXT(GLuint texture, GLenum target, GLenum pname, GLint param);
|
||||
void glTextureParameterivEXT(GLuint texture, GLenum target, GLenum pname, const GLint *param);
|
||||
void glTextureParameterfEXT(GLuint texture, GLenum target, GLenum pname, GLfloat param);
|
||||
void glTextureParameterfvEXT(GLuint texture, GLenum target, GLenum pname, const GLfloat *param);
|
||||
void glTextureImage1DEXT(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void glTextureImage2DEXT(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void glTextureSubImage1DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void glTextureSubImage2DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void glCopyTextureImage1DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
|
||||
void glCopyTextureImage2DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
|
||||
void glCopyTextureSubImage1DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
|
||||
void glCopyTextureSubImage2DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
void glGetTextureImageEXT(GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
|
||||
void glGetTextureParameterfvEXT(GLuint texture, GLenum target, GLenum pname, GLfloat *params);
|
||||
void glGetTextureParameterivEXT(GLuint texture, GLenum target, GLenum pname, GLint *params);
|
||||
void glGetTextureLevelParameterfvEXT(GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params);
|
||||
void glGetTextureLevelParameterivEXT(GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params);
|
||||
void glshim_glTextureParameteri(GLuint texture, GLenum target, GLenum pname, GLint param);
|
||||
void glshim_glTextureParameteriv(GLuint texture, GLenum target, GLenum pname, const GLint *param);
|
||||
void glshim_glTextureParameterf(GLuint texture, GLenum target, GLenum pname, GLfloat param);
|
||||
void glshim_glTextureParameterfv(GLuint texture, GLenum target, GLenum pname, const GLfloat *param);
|
||||
void glshim_glTextureImage1D(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void glshim_glTextureImage2D(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void glshim_glTextureSubImage1D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void glshim_glTextureSubImage2D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void glshim_glCopyTextureImage1D(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
|
||||
void glshim_glCopyTextureImage2D(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
|
||||
void glshim_glCopyTextureSubImage1D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
|
||||
void glshim_glCopyTextureSubImage2D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
void glshim_glGetTextureImage(GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
|
||||
void glshim_glGetTextureParameterfv(GLuint texture, GLenum target, GLenum pname, GLfloat *params);
|
||||
void glshim_glGetTextureParameteriv(GLuint texture, GLenum target, GLenum pname, GLint *params);
|
||||
void glshim_glGetTextureLevelParameterfv(GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params);
|
||||
void glshim_glGetTextureLevelParameteriv(GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params);
|
||||
|
||||
void glTextureImage3DEXT(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void glTextureSubImage3DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void glCopyTextureSubImage3DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
void glshim_glTextureImage3D(GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void glshim_glTextureSubImage3D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void glshim_glCopyTextureSubImage3D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
|
||||
void glBindMultiTextureEXT(GLenum texunit, GLenum target, GLuint texture);
|
||||
void glMultiTexCoordPointerEXT(GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
void glMultiTexEnvfEXT(GLenum texunit, GLenum target, GLenum pname, GLfloat param);
|
||||
void glMultiTexEnvfvEXT(GLenum texunit, GLenum target, GLenum pname, const GLfloat *params);
|
||||
void glMultiTexEnviEXT(GLenum texunit, GLenum target, GLenum pname, GLint param);
|
||||
void glMultiTexEnvivEXT(GLenum texunit, GLenum target, GLenum pname, const GLint *params);
|
||||
void glMultiTexGendEXT(GLenum texunit, GLenum coord, GLenum pname, GLdouble param);
|
||||
void glMultiTexGendvEXT(GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params);
|
||||
void glMultiTexGenfEXT(GLenum texunit, GLenum coord, GLenum pname, GLfloat param);
|
||||
void glMultiTexGenfvEXT(GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params);
|
||||
void glMultiTexGeniEXT(GLenum texunit, GLenum coord, GLenum pname, GLint param);
|
||||
void glMultiTexGenivEXT(GLenum texunit, GLenum coord, GLenum pname, const GLint *params);
|
||||
void glGetMultiTexEnvfvEXT(GLenum texunit, GLenum target, GLenum pname, GLfloat *params);
|
||||
void glGetMultiTexEnvivEXT(GLenum texunit, GLenum target, GLenum pname, GLint *params);
|
||||
void glGetMultiTexGendvEXT(GLenum texunit, GLenum coord, GLenum pname, GLdouble *params);
|
||||
void glGetMultiTexGenfvEXT(GLenum texunit, GLenum coord, GLenum pname, GLfloat *params);
|
||||
void glGetMultiTexGenivEXT(GLenum texunit, GLenum coord, GLenum pname, GLint *params);
|
||||
void glMultiTexParameteriEXT(GLenum texunit, GLenum target, GLenum pname, GLint param);
|
||||
void glMultiTexParameterivEXT(GLenum texunit, GLenum target, GLenum pname, const GLint *param);
|
||||
void glMultiTexParameterfEXT(GLenum texunit, GLenum target, GLenum pname, GLfloat param);
|
||||
void glMultiTexParameterfvEXT(GLenum texunit, GLenum target, GLenum pname, const GLfloat *param);
|
||||
void glMultiTexImage1DEXT(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void glMultiTexImage2DEXT(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void glMultiTexSubImage1DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void glMultiTexSubImage2DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void glCopyMultiTexImage1DEXT(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
|
||||
void glCopyMultiTexImage2DEXT(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
|
||||
void glCopyMultiTexSubImage1DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
|
||||
void glCopyMultiTexSubImage2DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
void glGetMultiTexImageEXT(GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
|
||||
void glGetMultiTexParameterfvEXT(GLenum texunit, GLenum target, GLenum pname, GLfloat *params);
|
||||
void glGetMultiTexParameterivEXT(GLenum texunit, GLenum target, GLenum pname, GLint *params);
|
||||
void glGetMultiTexLevelParameterfvEXT(GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params);
|
||||
void glGetMultiTexLevelParameterivEXT(GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params);
|
||||
void glMultiTexImage3DEXT(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void glMultiTexSubImage3DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void glCopyMultiTexSubImage3DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
void glshim_glBindMultiTexture(GLenum texunit, GLenum target, GLuint texture);
|
||||
void glshim_glMultiTexCoordPointer(GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
void glshim_glMultiTexEnvf(GLenum texunit, GLenum target, GLenum pname, GLfloat param);
|
||||
void glshim_glMultiTexEnvfv(GLenum texunit, GLenum target, GLenum pname, const GLfloat *params);
|
||||
void glshim_glMultiTexEnvi(GLenum texunit, GLenum target, GLenum pname, GLint param);
|
||||
void glshim_glMultiTexEnviv(GLenum texunit, GLenum target, GLenum pname, const GLint *params);
|
||||
void glshim_glMultiTexGend(GLenum texunit, GLenum coord, GLenum pname, GLdouble param);
|
||||
void glshim_glMultiTexGendv(GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params);
|
||||
void glshim_glMultiTexGenf(GLenum texunit, GLenum coord, GLenum pname, GLfloat param);
|
||||
void glshim_glMultiTexGenfv(GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params);
|
||||
void glshim_glMultiTexGeni(GLenum texunit, GLenum coord, GLenum pname, GLint param);
|
||||
void glshim_glMultiTexGeniv(GLenum texunit, GLenum coord, GLenum pname, const GLint *params);
|
||||
void glshim_glGetMultiTexEnvfv(GLenum texunit, GLenum target, GLenum pname, GLfloat *params);
|
||||
void glshim_glGetMultiTexEnviv(GLenum texunit, GLenum target, GLenum pname, GLint *params);
|
||||
void glshim_glGetMultiTexGendv(GLenum texunit, GLenum coord, GLenum pname, GLdouble *params);
|
||||
void glshim_glGetMultiTexGenfv(GLenum texunit, GLenum coord, GLenum pname, GLfloat *params);
|
||||
void glshim_glGetMultiTexGeniv(GLenum texunit, GLenum coord, GLenum pname, GLint *params);
|
||||
void glshim_glMultiTexParameteri(GLenum texunit, GLenum target, GLenum pname, GLint param);
|
||||
void glshim_glMultiTexParameteriv(GLenum texunit, GLenum target, GLenum pname, const GLint *param);
|
||||
void glshim_glMultiTexParameterf(GLenum texunit, GLenum target, GLenum pname, GLfloat param);
|
||||
void glshim_glMultiTexParameterfv(GLenum texunit, GLenum target, GLenum pname, const GLfloat *param);
|
||||
void glshim_glMultiTexImage1D(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void glshim_glMultiTexImage2D(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void glshim_glMultiTexSubImage1D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void glshim_glMultiTexSubImage2D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void glshim_glCopyMultiTexImage1D(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
|
||||
void glshim_glCopyMultiTexImage2D(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
|
||||
void glshim_glCopyMultiTexSubImage1D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
|
||||
void glshim_glCopyMultiTexSubImage2D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
void glshim_glGetMultiTexImage(GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
|
||||
void glshim_glGetMultiTexParameterfv(GLenum texunit, GLenum target, GLenum pname, GLfloat *params);
|
||||
void glshim_glGetMultiTexParameteriv(GLenum texunit, GLenum target, GLenum pname, GLint *params);
|
||||
void glshim_glGetMultiTexLevelParameterfv(GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params);
|
||||
void glshim_glGetMultiTexLevelParameteriv(GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params);
|
||||
void glshim_glMultiTexImage3D(GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void glshim_glMultiTexSubImage3D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
void glshim_glCopyMultiTexSubImage3D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
|
||||
void glCompressedTextureImage3DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
|
||||
void glCompressedTextureImage2DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
|
||||
void glCompressedTextureImage1DEXT(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
|
||||
void glCompressedTextureSubImage3DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
|
||||
void glCompressedTextureSubImage2DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
|
||||
void glCompressedTextureSubImage1DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
|
||||
void glGetCompressedTextureImageEXT(GLuint texture, GLenum target, GLint level, GLvoid *img);
|
||||
void glshim_glCompressedTextureImage3D(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
|
||||
void glshim_glCompressedTextureImage2D(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
|
||||
void glshim_glCompressedTextureImage1D(GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
|
||||
void glshim_glCompressedTextureSubImage3D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
|
||||
void glshim_glCompressedTextureSubImage2D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
|
||||
void glshim_glCompressedTextureSubImage1D(GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
|
||||
void glshim_glGetCompressedTextureImage(GLuint texture, GLenum target, GLint level, GLvoid *img);
|
||||
|
||||
void glCompressedMultiTexImage3DEXT(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
|
||||
void glCompressedMultiTexImage2DEXT(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
|
||||
void glCompressedMultiTexImage1DEXT(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
|
||||
void glCompressedMultiTexSubImage3DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
|
||||
void glCompressedMultiTexSubImage2DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
|
||||
void glCompressedMultiTexSubImage1DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
|
||||
void glGetCompressedMultiTexImageEXT(GLenum texunit, GLenum target, GLint level, GLvoid *img);
|
||||
void glshim_glCompressedMultiTexImage3D(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
|
||||
void glshim_glCompressedMultiTexImage2D(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
|
||||
void glshim_glCompressedMultiTexImage1D(GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
|
||||
void glshim_glCompressedMultiTexSubImage3D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
|
||||
void glshim_glCompressedMultiTexSubImage2D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
|
||||
void glshim_glCompressedMultiTexSubImage1D(GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
|
||||
void glshim_glGetCompressedMultiTexImage(GLenum texunit, GLenum target, GLint level, GLvoid *img);
|
||||
|
||||
void glMatrixLoadTransposefEXT(GLenum matrixMode, const GLfloat *m);
|
||||
void glMatrixLoadTransposedEXT(GLenum matrixMode, const GLdouble *m);
|
||||
void glMatrixMultTransposefEXT(GLenum matrixMode, const GLfloat *m);
|
||||
void glMatrixMultTransposedEXT(GLenum matrixMode, const GLdouble *m);
|
||||
void glshim_glMatrixLoadTransposef(GLenum matrixMode, const GLfloat *m);
|
||||
void glshim_glMatrixLoadTransposed(GLenum matrixMode, const GLdouble *m);
|
||||
void glshim_glMatrixMultTransposef(GLenum matrixMode, const GLfloat *m);
|
||||
void glshim_glMatrixMultTransposed(GLenum matrixMode, const GLdouble *m);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -6,22 +6,22 @@
|
||||
|
||||
static inline map_state_t **get_map_pointer(GLenum target) {
|
||||
switch (target) {
|
||||
case GL_MAP1_COLOR_4: return &state.map1.color4;
|
||||
case GL_MAP1_INDEX: return &state.map1.index;
|
||||
case GL_MAP1_TEXTURE_COORD_1: return &state.map1.texture1;
|
||||
case GL_MAP1_TEXTURE_COORD_2: return &state.map1.texture2;
|
||||
case GL_MAP1_TEXTURE_COORD_3: return &state.map1.texture3;
|
||||
case GL_MAP1_TEXTURE_COORD_4: return &state.map1.texture4;
|
||||
case GL_MAP1_VERTEX_3: return &state.map1.vertex3;
|
||||
case GL_MAP1_VERTEX_4: return &state.map1.vertex4;
|
||||
case GL_MAP2_COLOR_4: return &state.map2.color4;
|
||||
case GL_MAP2_INDEX: return &state.map2.index;
|
||||
case GL_MAP2_TEXTURE_COORD_1: return &state.map2.texture1;
|
||||
case GL_MAP2_TEXTURE_COORD_2: return &state.map2.texture2;
|
||||
case GL_MAP2_TEXTURE_COORD_3: return &state.map2.texture3;
|
||||
case GL_MAP2_TEXTURE_COORD_4: return &state.map2.texture4;
|
||||
case GL_MAP2_VERTEX_3: return &state.map2.vertex3;
|
||||
case GL_MAP2_VERTEX_4: return &state.map2.vertex4;
|
||||
case GL_MAP1_COLOR_4: return &glstate.map1.color4;
|
||||
case GL_MAP1_INDEX: return &glstate.map1.index;
|
||||
case GL_MAP1_TEXTURE_COORD_1: return &glstate.map1.texture1;
|
||||
case GL_MAP1_TEXTURE_COORD_2: return &glstate.map1.texture2;
|
||||
case GL_MAP1_TEXTURE_COORD_3: return &glstate.map1.texture3;
|
||||
case GL_MAP1_TEXTURE_COORD_4: return &glstate.map1.texture4;
|
||||
case GL_MAP1_VERTEX_3: return &glstate.map1.vertex3;
|
||||
case GL_MAP1_VERTEX_4: return &glstate.map1.vertex4;
|
||||
case GL_MAP2_COLOR_4: return &glstate.map2.color4;
|
||||
case GL_MAP2_INDEX: return &glstate.map2.index;
|
||||
case GL_MAP2_TEXTURE_COORD_1: return &glstate.map2.texture1;
|
||||
case GL_MAP2_TEXTURE_COORD_2: return &glstate.map2.texture2;
|
||||
case GL_MAP2_TEXTURE_COORD_3: return &glstate.map2.texture3;
|
||||
case GL_MAP2_TEXTURE_COORD_4: return &glstate.map2.texture4;
|
||||
case GL_MAP2_VERTEX_3: return &glstate.map2.vertex3;
|
||||
case GL_MAP2_VERTEX_4: return &glstate.map2.vertex4;
|
||||
default:
|
||||
printf("libGL: unknown glMap target 0x%x\n", target);
|
||||
}
|
||||
@@ -38,13 +38,13 @@ static inline map_state_t **get_map_pointer(GLenum target) {
|
||||
#define case_state(dims, magic, name) \
|
||||
case magic: { \
|
||||
map->width = get_map_width(magic); \
|
||||
map_statef_t *m = (map_statef_t *)state.map##dims.name; \
|
||||
map_statef_t *m = (map_statef_t *)glstate.map##dims.name; \
|
||||
if (m) { \
|
||||
if (m->free) \
|
||||
free((void *)m->points); \
|
||||
free(m); \
|
||||
} \
|
||||
state.map##dims.name = (map_state_t *)map; \
|
||||
glstate.map##dims.name = (map_state_t *)map; \
|
||||
break; \
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ static inline map_state_t **get_map_pointer(GLenum target) {
|
||||
case_state(dims, GL_MAP##dims##_VERTEX_4, vertex4); \
|
||||
}
|
||||
|
||||
void glMap1d(GLenum target, GLdouble u1, GLdouble u2,
|
||||
void glshim_glMap1d(GLenum target, GLdouble u1, GLdouble u2,
|
||||
GLint ustride, GLint uorder, const GLdouble *points) {
|
||||
noerrorShim();
|
||||
map_statef_t *map = malloc(sizeof(map_statef_t));
|
||||
@@ -71,7 +71,7 @@ void glMap1d(GLenum target, GLdouble u1, GLdouble u2,
|
||||
map->points = copy_eval_double(target, ustride, uorder, 0, 1, points);
|
||||
}
|
||||
|
||||
void glMap1f(GLenum target, GLfloat u1, GLfloat u2,
|
||||
void glshim_glMap1f(GLenum target, GLfloat u1, GLfloat u2,
|
||||
GLint ustride, GLint uorder, const GLfloat *points) {
|
||||
noerrorShim();
|
||||
map_statef_t *map = malloc(sizeof(map_statef_t));
|
||||
@@ -81,7 +81,7 @@ void glMap1f(GLenum target, GLfloat u1, GLfloat u2,
|
||||
map->points = points;
|
||||
}
|
||||
|
||||
void glMap2d(GLenum target, GLdouble u1, GLdouble u2,
|
||||
void glshim_glMap2d(GLenum target, GLdouble u1, GLdouble u2,
|
||||
GLint ustride, GLint uorder, GLdouble v1, GLdouble v2,
|
||||
GLint vstride, GLint vorder, const GLdouble *points) {
|
||||
noerrorShim();
|
||||
@@ -93,7 +93,7 @@ void glMap2d(GLenum target, GLdouble u1, GLdouble u2,
|
||||
map->points = copy_eval_double(target, ustride, uorder, vstride, vorder, points);
|
||||
}
|
||||
|
||||
void glMap2f(GLenum target, GLfloat u1, GLfloat u2,
|
||||
void glshim_glMap2f(GLenum target, GLfloat u1, GLfloat u2,
|
||||
GLint ustride, GLint uorder, GLfloat v1, GLfloat v2,
|
||||
GLint vstride, GLint vorder, const GLfloat *points) {
|
||||
noerrorShim();
|
||||
@@ -110,7 +110,7 @@ void glMap2f(GLenum target, GLfloat u1, GLfloat u2,
|
||||
#undef map_switch
|
||||
|
||||
#define p_map(d, name, func, code) { \
|
||||
map_state_t *_map = state.map##d.name; \
|
||||
map_state_t *_map = glstate.map##d.name; \
|
||||
if (_map) { \
|
||||
if (_map->type == GL_DOUBLE) { \
|
||||
map_stated_t *map = (map_stated_t *)_map; \
|
||||
@@ -119,7 +119,7 @@ void glMap2f(GLenum target, GLfloat u1, GLfloat u2,
|
||||
map_statef_t *map = (map_statef_t *)_map; \
|
||||
GLfloat out[4]; \
|
||||
code \
|
||||
func##v(out); \
|
||||
glshim_##func##v(out); \
|
||||
} \
|
||||
}}
|
||||
|
||||
@@ -134,7 +134,7 @@ void glMap2f(GLenum target, GLfloat u1, GLfloat u2,
|
||||
p_map(d, vertex3, glVertex3f, code); \
|
||||
p_map(d, vertex4, glVertex4f, code);
|
||||
|
||||
void glEvalCoord1f(GLfloat u) {
|
||||
void glshim_glEvalCoord1f(GLfloat u) {
|
||||
noerrorShim();
|
||||
iter_maps(1,
|
||||
GLfloat uu = (u - map->u._1) * map->u.d;
|
||||
@@ -142,7 +142,7 @@ void glEvalCoord1f(GLfloat u) {
|
||||
)
|
||||
}
|
||||
|
||||
void glEvalCoord2f(GLfloat u, GLfloat v) {
|
||||
void glshim_glEvalCoord2f(GLfloat u, GLfloat v) {
|
||||
noerrorShim();
|
||||
iter_maps(2,
|
||||
GLfloat uu = (u - map->u._1) * map->u.d;
|
||||
@@ -157,29 +157,29 @@ void glEvalCoord2f(GLfloat u, GLfloat v) {
|
||||
#undef p_map
|
||||
#undef iter_maps
|
||||
|
||||
void glMapGrid1f(GLint un, GLfloat u1, GLfloat u2) {
|
||||
void glshim_glMapGrid1f(GLint un, GLfloat u1, GLfloat u2) {
|
||||
noerrorShim();
|
||||
// TODO: double support?
|
||||
map_statef_t *map;
|
||||
if (! state.map_grid)
|
||||
state.map_grid = malloc(sizeof(map_statef_t));
|
||||
if (! glstate.map_grid)
|
||||
glstate.map_grid = malloc(sizeof(map_statef_t));
|
||||
|
||||
map = (map_statef_t *)state.map_grid;
|
||||
map = (map_statef_t *)glstate.map_grid;
|
||||
map->dims = 1;
|
||||
map->u.n = un;
|
||||
map->u._1 = u1;
|
||||
map->u._2 = u2;
|
||||
}
|
||||
|
||||
void glMapGrid2f(GLint un, GLfloat u1, GLfloat u2,
|
||||
void glshim_glMapGrid2f(GLint un, GLfloat u1, GLfloat u2,
|
||||
GLint vn, GLfloat v1, GLfloat v2) {
|
||||
noerrorShim();
|
||||
// TODO: double support?
|
||||
map_statef_t *map;
|
||||
if (! state.map_grid)
|
||||
state.map_grid = malloc(sizeof(map_statef_t));
|
||||
if (! glstate.map_grid)
|
||||
glstate.map_grid = malloc(sizeof(map_statef_t));
|
||||
|
||||
map = (map_statef_t *)state.map_grid;
|
||||
map = (map_statef_t *)glstate.map_grid;
|
||||
map->dims = 2;
|
||||
map->u.n = un;
|
||||
map->u._1 = u1;
|
||||
@@ -190,10 +190,10 @@ void glMapGrid2f(GLint un, GLfloat u1, GLfloat u2,
|
||||
}
|
||||
|
||||
static inline GLenum eval_mesh_prep(map_statef_t **map, GLenum mode) {
|
||||
if (state.map2.vertex4) {
|
||||
*map = (map_statef_t *)state.map2.vertex4;
|
||||
} else if (state.map2.vertex3) {
|
||||
*map = (map_statef_t *)state.map2.vertex3;
|
||||
if (glstate.map2.vertex4) {
|
||||
*map = (map_statef_t *)glstate.map2.vertex4;
|
||||
} else if (glstate.map2.vertex3) {
|
||||
*map = (map_statef_t *)glstate.map2.vertex3;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
@@ -214,7 +214,7 @@ static inline GLenum eval_mesh_prep(map_statef_t **map, GLenum mode) {
|
||||
}
|
||||
}
|
||||
|
||||
void glEvalMesh1(GLenum mode, GLint i1, GLint i2) {
|
||||
void glshim_glEvalMesh1(GLenum mode, GLint i1, GLint i2) {
|
||||
noerrorShim();
|
||||
map_statef_t *map;
|
||||
GLenum renderMode = eval_mesh_prep(&map, mode);
|
||||
@@ -224,14 +224,14 @@ void glEvalMesh1(GLenum mode, GLint i1, GLint i2) {
|
||||
GLfloat u, du, u1;
|
||||
du = map->u.d;
|
||||
GLint i;
|
||||
glBegin(renderMode);
|
||||
glshim_glBegin(renderMode);
|
||||
for (u = u1, i = i1; i <= i2; i++, u += du) {
|
||||
glEvalCoord1f(u);
|
||||
glshim_glEvalCoord1f(u);
|
||||
}
|
||||
glEnd();
|
||||
glshim_glEnd();
|
||||
}
|
||||
|
||||
void glEvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2) {
|
||||
void glshim_glEvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2) {
|
||||
noerrorShim();
|
||||
map_statef_t *map;
|
||||
GLenum renderMode = eval_mesh_prep(&map, mode);
|
||||
@@ -242,40 +242,40 @@ void glEvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2) {
|
||||
du = map->u.d;
|
||||
dv = map->v.d;
|
||||
GLint i, j;
|
||||
glBegin(renderMode);
|
||||
glshim_glBegin(renderMode);
|
||||
for (v = v1, j = j1; j <= j2; j++, v += dv) {
|
||||
for (u = u1, i = i1; i <= i2; i++, u += du) {
|
||||
glEvalCoord2f(u, v);
|
||||
glshim_glEvalCoord2f(u, v);
|
||||
if (mode == GL_FILL)
|
||||
glEvalCoord2f(u, v + dv);
|
||||
glshim_glEvalCoord2f(u, v + dv);
|
||||
}
|
||||
}
|
||||
glEnd();
|
||||
glshim_glEnd();
|
||||
if (mode == GL_LINE) {
|
||||
glBegin(renderMode);
|
||||
glshim_glBegin(renderMode);
|
||||
for (u = u1, i = i1; i <= i2; i++, u += du) {
|
||||
for (v = v1, j = j1; j <= j2; j++, v += dv) {
|
||||
glEvalCoord2f(u, v);
|
||||
glshim_glEvalCoord2f(u, v);
|
||||
}
|
||||
}
|
||||
glEnd();
|
||||
glshim_glEnd();
|
||||
}
|
||||
}
|
||||
|
||||
void glEvalPoint1(GLint i) {
|
||||
void glshim_glEvalPoint1(GLint i) {
|
||||
map_statef_t *map;
|
||||
if (eval_mesh_prep(&map, 0))
|
||||
glEvalCoord1f(i + map->u.d);
|
||||
glshim_glEvalCoord1f(i + map->u.d);
|
||||
}
|
||||
|
||||
void glEvalPoint2(GLint i, GLint j) {
|
||||
void glshim_glEvalPoint2(GLint i, GLint j) {
|
||||
map_statef_t *map;
|
||||
if (eval_mesh_prep(&map, 0))
|
||||
glEvalCoord2f(i + map->u.d, j + map->v.d);
|
||||
glshim_glEvalCoord2f(i + map->u.d, j + map->v.d);
|
||||
}
|
||||
|
||||
#define GL_GET_MAP(t, type) \
|
||||
void glGetMap##t##v(GLenum target, GLenum query, type *v) { \
|
||||
void glshim_glGetMap##t##v(GLenum target, GLenum query, type *v) { \
|
||||
noerrorShim(); \
|
||||
map_statef_t *map = *(map_statef_t **)get_map_pointer(target); \
|
||||
if (map) { \
|
||||
@@ -315,3 +315,20 @@ GL_GET_MAP(f, GLfloat)
|
||||
GL_GET_MAP(d, GLdouble)
|
||||
|
||||
#undef GL_GET_MAP
|
||||
|
||||
//Direct wrapper
|
||||
void glMap1d(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points) __attribute__((alias("glshim_glMap1d")));
|
||||
void glMap1f(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points) __attribute__((alias("glshim_glMap1f")));
|
||||
void glMap2d(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points) __attribute__((alias("glshim_glMap2d")));
|
||||
void glMap2f(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points) __attribute__((alias("glshim_glMap2f")));
|
||||
void glEvalCoord1f(GLfloat u) __attribute__((alias("glshim_glEvalCoord1f")));
|
||||
void glEvalCoord2f(GLfloat u, GLfloat v) __attribute__((alias("glshim_glEvalCoord2f")));
|
||||
void glEvalMesh1(GLenum mode, GLint i1, GLint i2) __attribute__((alias("glshim_glEvalMesh1")));
|
||||
void glEvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2) __attribute__((alias("glshim_glEvalMesh2")));
|
||||
void glEvalPoint1(GLint i) __attribute__((alias("glshim_glEvalPoint1")));
|
||||
void glEvalPoint2(GLint i, GLint j) __attribute__((alias("glshim_glEvalPoint2")));
|
||||
void glMapGrid1f(GLint un, GLfloat u1, GLfloat u2) __attribute__((alias("glshim_glMapGrid1f")));
|
||||
void glMapGrid2f(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2) __attribute__((alias("glshim_glMapGrid2f")));
|
||||
void glGetMapdv(GLenum target, GLenum query, GLdouble *v) __attribute__((alias("glshim_glGetMapdv")));
|
||||
void glGetMapfv(GLenum target, GLenum query, GLfloat *v) __attribute__((alias("glshim_glGetMapfv")));
|
||||
void glGetMapiv(GLenum target, GLenum query, GLint *v) __attribute__((alias("glshim_glGetMapiv")));
|
||||
|
||||
38
project/jni/glshim/src/gl/eval.h
Normal file → Executable file
38
project/jni/glshim/src/gl/eval.h
Normal file → Executable file
@@ -3,27 +3,27 @@
|
||||
#ifndef GL_MAP_H
|
||||
#define GL_MAP_H
|
||||
|
||||
void glMap1d(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points);
|
||||
void glMap1f(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points);
|
||||
void glMap2d(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points);
|
||||
void glMap2f(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points);
|
||||
void glshim_glMap1d(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points);
|
||||
void glshim_glMap1f(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points);
|
||||
void glshim_glMap2d(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points);
|
||||
void glshim_glMap2f(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points);
|
||||
|
||||
void glEvalCoord1d(GLdouble u);
|
||||
void glEvalCoord1f(GLfloat u);
|
||||
void glEvalCoord2d(GLdouble u, GLdouble v);
|
||||
void glEvalCoord2f(GLfloat u, GLfloat v);
|
||||
void glshim_glEvalCoord1d(GLdouble u);
|
||||
void glshim_glEvalCoord1f(GLfloat u);
|
||||
void glshim_glEvalCoord2d(GLdouble u, GLdouble v);
|
||||
void glshim_glEvalCoord2f(GLfloat u, GLfloat v);
|
||||
|
||||
void glEvalMesh1(GLenum mode, GLint i1, GLint i2);
|
||||
void glEvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2);
|
||||
void glEvalPoint1(GLint i);
|
||||
void glEvalPoint2(GLint i, GLint j);
|
||||
void glMapGrid1d(GLint un, GLdouble u1, GLdouble u2);
|
||||
void glMapGrid1f(GLint un, GLfloat u1, GLfloat u2);
|
||||
void glMapGrid2d(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2);
|
||||
void glMapGrid2f(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2);
|
||||
void glGetMapdv(GLenum target, GLenum query, GLdouble *v);
|
||||
void glGetMapfv(GLenum target, GLenum query, GLfloat *v);
|
||||
void glGetMapiv(GLenum target, GLenum query, GLint *v);
|
||||
void glshim_glEvalMesh1(GLenum mode, GLint i1, GLint i2);
|
||||
void glshim_glEvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2);
|
||||
void glshim_glEvalPoint1(GLint i);
|
||||
void glshim_glEvalPoint2(GLint i, GLint j);
|
||||
void glshim_glMapGrid1d(GLint un, GLdouble u1, GLdouble u2);
|
||||
void glshim_glMapGrid1f(GLint un, GLfloat u1, GLfloat u2);
|
||||
void glshim_glMapGrid2d(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2);
|
||||
void glshim_glMapGrid2f(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2);
|
||||
void glshim_glGetMapdv(GLenum target, GLenum query, GLdouble *v);
|
||||
void glshim_glGetMapfv(GLenum target, GLenum query, GLfloat *v);
|
||||
void glshim_glGetMapiv(GLenum target, GLenum query, GLint *v);
|
||||
|
||||
typedef struct {
|
||||
GLenum type;
|
||||
|
||||
@@ -53,7 +53,7 @@ void readfboEnd() {
|
||||
gles_glBindFramebuffer(GL_FRAMEBUFFER, fbo);
|
||||
}
|
||||
|
||||
void glGenFramebuffers(GLsizei n, GLuint *ids) {
|
||||
void glshim_glGenFramebuffers(GLsizei n, GLuint *ids) {
|
||||
LOAD_GLES_OES(glGenFramebuffers);
|
||||
//printf("glGenFramebuffers(%i, %p)\n", n, ids);
|
||||
GLsizei m = 0;
|
||||
@@ -68,9 +68,9 @@ void glGenFramebuffers(GLsizei n, GLuint *ids) {
|
||||
gles_glGenFramebuffers(n-m, ids+m);
|
||||
}
|
||||
|
||||
void glDeleteFramebuffers(GLsizei n, GLuint *framebuffers) {
|
||||
void glshim_glDeleteFramebuffers(GLsizei n, GLuint *framebuffers) {
|
||||
//printf("glDeleteFramebuffers(%i, %p), framebuffers[0]=%u\n", n, framebuffers, framebuffers[0]);
|
||||
if (state.gl_batch) flush();
|
||||
if (glstate.gl_batch) flush();
|
||||
if (g_recyclefbo) {
|
||||
//printf("Recycling %i FBOs\n", n);
|
||||
noerrorShim();
|
||||
@@ -91,9 +91,9 @@ void glDeleteFramebuffers(GLsizei n, GLuint *framebuffers) {
|
||||
}
|
||||
}
|
||||
|
||||
GLboolean glIsFramebuffer(GLuint framebuffer) {
|
||||
GLboolean glshim_glIsFramebuffer(GLuint framebuffer) {
|
||||
//printf("glIsFramebuffer(%u)\n", framebuffer);
|
||||
if (state.gl_batch) flush();
|
||||
if (glstate.gl_batch) flush();
|
||||
LOAD_GLES_OES(glIsFramebuffer);
|
||||
|
||||
errorGL();
|
||||
@@ -102,8 +102,8 @@ GLboolean glIsFramebuffer(GLuint framebuffer) {
|
||||
|
||||
GLenum fb_status;
|
||||
|
||||
GLenum glCheckFramebufferStatus(GLenum target) {
|
||||
if (state.gl_batch) flush();
|
||||
GLenum glshim_glCheckFramebufferStatus(GLenum target) {
|
||||
if (glstate.gl_batch) flush();
|
||||
//#define BEFORE 1
|
||||
#ifdef BEFORE
|
||||
GLenum result = fb_status;
|
||||
@@ -119,10 +119,10 @@ GLenum glCheckFramebufferStatus(GLenum target) {
|
||||
return result;
|
||||
}
|
||||
|
||||
void glBindFramebuffer(GLenum target, GLuint framebuffer) {
|
||||
//printf("glBindFramebuffer(%s, %u), list=%s\n", PrintEnum(target), framebuffer, state.list.active?"active":"none");
|
||||
void glshim_glBindFramebuffer(GLenum target, GLuint framebuffer) {
|
||||
//printf("glBindFramebuffer(%s, %u), list=%s\n", PrintEnum(target), framebuffer, glstate.list.active?"active":"none");
|
||||
//PUSH_IF_COMPILING(glBindFramebuffer);
|
||||
if (state.gl_batch) flush();
|
||||
if (glstate.gl_batch) flush();
|
||||
LOAD_GLES_OES(glBindFramebuffer);
|
||||
LOAD_GLES_OES(glCheckFramebufferStatus);
|
||||
LOAD_GLES(glGetError);
|
||||
@@ -164,12 +164,12 @@ void glBindFramebuffer(GLenum target, GLuint framebuffer) {
|
||||
}
|
||||
|
||||
|
||||
void glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {
|
||||
void glshim_glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {
|
||||
static GLuint scrap_tex = 0;
|
||||
static int scrap_width = 0;
|
||||
static int scrap_height = 0;
|
||||
|
||||
if (state.gl_batch) flush();
|
||||
if (glstate.gl_batch) flush();
|
||||
LOAD_GLES_OES(glFramebufferTexture2D);
|
||||
LOAD_GLES(glTexImage2D);
|
||||
LOAD_GLES(glBindTexture);
|
||||
@@ -187,9 +187,9 @@ void glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget,
|
||||
gltexture_t *tex = NULL;
|
||||
int ret;
|
||||
khint_t k;
|
||||
khash_t(tex) *list = state.texture.list;
|
||||
khash_t(tex) *list = glstate.texture.list;
|
||||
if (! list) {
|
||||
list = state.texture.list = kh_init(tex);
|
||||
list = glstate.texture.list = kh_init(tex);
|
||||
// segfaults if we don't do a single put
|
||||
kh_put(tex, list, 1, &ret);
|
||||
kh_del(tex, list, 1);
|
||||
@@ -209,7 +209,7 @@ void glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget,
|
||||
tex->nwidth = npot(tex->width);
|
||||
tex->nheight = npot(tex->height);
|
||||
tex->shrink = 0;
|
||||
gltexture_t *bound = state.texture.bound[state.texture.active];
|
||||
gltexture_t *bound = glstate.texture.bound[glstate.texture.active];
|
||||
GLuint oldtex = (bound)?bound->glname:0;
|
||||
if (oldtex!=tex->glname) gles_glBindTexture(GL_TEXTURE_2D, tex->glname);
|
||||
gles_glTexImage2D(GL_TEXTURE_2D, 0, tex->format, tex->nwidth, tex->nheight, 0, tex->format, tex->type, NULL);
|
||||
@@ -222,7 +222,7 @@ void glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget,
|
||||
tex->nwidth = (tex->nwidth<32)?32:tex->nwidth;
|
||||
tex->nheight = (tex->nheight<32)?32:tex->nheight;
|
||||
tex->shrink = 0;
|
||||
gltexture_t *bound = state.texture.bound[state.texture.active];
|
||||
gltexture_t *bound = glstate.texture.bound[glstate.texture.active];
|
||||
GLuint oldtex = (bound)?bound->glname:0;
|
||||
if (oldtex!=tex->glname) gles_glBindTexture(GL_TEXTURE_2D, tex->glname);
|
||||
gles_glTexImage2D(GL_TEXTURE_2D, 0, tex->format, tex->nwidth, tex->nheight, 0, tex->format, tex->type, NULL);
|
||||
@@ -238,11 +238,11 @@ void glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget,
|
||||
if (level!=0) {
|
||||
//bind a scrap texture, we don't want level != 0 binding on GLES
|
||||
if(!scrap_tex)
|
||||
glGenTextures(1, &scrap_tex);
|
||||
glshim_glGenTextures(1, &scrap_tex);
|
||||
if ((scrap_width!=twidth) || (scrap_height!=theight)) {
|
||||
scrap_width = twidth;
|
||||
scrap_height = theight;
|
||||
gltexture_t *bound = state.texture.bound[state.texture.active];
|
||||
gltexture_t *bound = glstate.texture.bound[glstate.texture.active];
|
||||
GLuint oldtex = (bound)?bound->glname:0;
|
||||
if (oldtex!=scrap_tex) gles_glBindTexture(GL_TEXTURE_2D, scrap_tex);
|
||||
gles_glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, scrap_width, scrap_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
|
||||
@@ -255,15 +255,15 @@ void glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget,
|
||||
gles_glFramebufferTexture2D(target, attachment, textarget, texture, 0);
|
||||
}
|
||||
|
||||
void glFramebufferTexture1D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {
|
||||
glFramebufferTexture2D(target, attachment, GL_TEXTURE_2D, texture, level);
|
||||
void glshim_glFramebufferTexture1D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {
|
||||
glshim_glFramebufferTexture2D(target, attachment, GL_TEXTURE_2D, texture, level);
|
||||
}
|
||||
void glFramebufferTexture3D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer) {
|
||||
void glshim_glFramebufferTexture3D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer) {
|
||||
(void)layer;
|
||||
glFramebufferTexture2D(target, attachment, GL_TEXTURE_2D, texture, level);
|
||||
glshim_glFramebufferTexture2D(target, attachment, GL_TEXTURE_2D, texture, level);
|
||||
}
|
||||
|
||||
void glGenRenderbuffers(GLsizei n, GLuint *renderbuffers) {
|
||||
void glshim_glGenRenderbuffers(GLsizei n, GLuint *renderbuffers) {
|
||||
LOAD_GLES_OES(glGenRenderbuffers);
|
||||
//printf("glGenRenderbuffers(%i, %p)\n", n, renderbuffers);
|
||||
|
||||
@@ -271,7 +271,7 @@ void glGenRenderbuffers(GLsizei n, GLuint *renderbuffers) {
|
||||
gles_glGenRenderbuffers(n, renderbuffers);
|
||||
}
|
||||
|
||||
void glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) {
|
||||
void glshim_glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) {
|
||||
LOAD_GLES_OES(glFramebufferRenderbuffer);
|
||||
LOAD_GLES_OES(glGetFramebufferAttachmentParameteriv);
|
||||
//printf("glFramebufferRenderbuffer(%s, %s, %s, %u)\n", PrintEnum(target), PrintEnum(attachment), PrintEnum(renderbuffertarget), renderbuffer);
|
||||
@@ -296,8 +296,8 @@ void glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbu
|
||||
gles_glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
|
||||
}
|
||||
|
||||
void glDeleteRenderbuffers(GLsizei n, GLuint *renderbuffers) {
|
||||
if (state.gl_batch) flush();
|
||||
void glshim_glDeleteRenderbuffers(GLsizei n, GLuint *renderbuffers) {
|
||||
if (glstate.gl_batch) flush();
|
||||
LOAD_GLES_OES(glDeleteRenderbuffers);
|
||||
|
||||
// check if we delete a depthstencil
|
||||
@@ -322,7 +322,7 @@ void glDeleteRenderbuffers(GLsizei n, GLuint *renderbuffers) {
|
||||
gles_glDeleteRenderbuffers(n, renderbuffers);
|
||||
}
|
||||
|
||||
void glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) {
|
||||
void glshim_glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) {
|
||||
LOAD_GLES_OES(glRenderbufferStorage);
|
||||
LOAD_GLES_OES(glGenRenderbuffers);
|
||||
LOAD_GLES_OES(glBindRenderbuffer);
|
||||
@@ -369,12 +369,12 @@ void glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width,
|
||||
gles_glRenderbufferStorage(target, internalformat, width, height);
|
||||
}
|
||||
|
||||
void glRenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) { //STUB
|
||||
glRenderbufferStorage(target, internalformat, width, height);
|
||||
void glshim_glRenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) { //STUB
|
||||
glshim_glRenderbufferStorage(target, internalformat, width, height);
|
||||
}
|
||||
|
||||
void glBindRenderbuffer(GLenum target, GLuint renderbuffer) {
|
||||
if (state.gl_batch) flush();
|
||||
void glshim_glBindRenderbuffer(GLenum target, GLuint renderbuffer) {
|
||||
if (glstate.gl_batch) flush();
|
||||
LOAD_GLES_OES(glBindRenderbuffer);
|
||||
//printf("glBindRenderbuffer(%s, %u), binded Fbo=%u\n", PrintEnum(target), renderbuffer, current_fb);
|
||||
|
||||
@@ -384,16 +384,16 @@ void glBindRenderbuffer(GLenum target, GLuint renderbuffer) {
|
||||
gles_glBindRenderbuffer(target, renderbuffer);
|
||||
}
|
||||
|
||||
GLboolean glIsRenderbuffer(GLuint renderbuffer) {
|
||||
GLboolean glshim_glIsRenderbuffer(GLuint renderbuffer) {
|
||||
//printf("glIsRenderbuffer(%u)\n", renderbuffer);
|
||||
if (state.gl_batch) flush();
|
||||
if (glstate.gl_batch) flush();
|
||||
LOAD_GLES_OES(glIsRenderbuffer);
|
||||
|
||||
errorGL();
|
||||
return gles_glIsRenderbuffer(renderbuffer);
|
||||
}
|
||||
|
||||
void glGenerateMipmap(GLenum target) {
|
||||
void glshim_glGenerateMipmap(GLenum target) {
|
||||
//printf("glGenerateMipmap(0x%04X)\n", target);
|
||||
LOAD_GLES_OES(glGenerateMipmap);
|
||||
|
||||
@@ -401,7 +401,7 @@ void glGenerateMipmap(GLenum target) {
|
||||
return gles_glGenerateMipmap(target);
|
||||
}
|
||||
|
||||
void glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint *params) {
|
||||
void glshim_glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint *params) {
|
||||
//printf("glGetFramebufferAttachmentParameteriv(%s, %s, %s, %p)\n", PrintEnum(target), PrintEnum(attachment), PrintEnum(pname), params);
|
||||
LOAD_GLES_OES(glGetFramebufferAttachmentParameteriv);
|
||||
|
||||
@@ -409,7 +409,7 @@ void glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLe
|
||||
return gles_glGetFramebufferAttachmentParameteriv(target, attachment, pname, params);
|
||||
}
|
||||
|
||||
void glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint * params) {
|
||||
void glshim_glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint * params) {
|
||||
//printf("glGetRenderbufferParameteriv(%s, %s, %p)\n", PrintEnum(target), PrintEnum(pname), params);
|
||||
LOAD_GLES_OES(glGetRenderbufferParameteriv);
|
||||
|
||||
@@ -441,9 +441,9 @@ void createMainFBO(int width, int height) {
|
||||
deleteMainFBO();
|
||||
}
|
||||
// switch to texture unit 0 if needed
|
||||
if (state.texture.active != 0)
|
||||
if (glstate.texture.active != 0)
|
||||
gles_glActiveTexture(GL_TEXTURE0);
|
||||
if (state.texture.client != 0)
|
||||
if (glstate.texture.client != 0)
|
||||
gles_glClientActiveTexture(GL_TEXTURE0);
|
||||
|
||||
mainfbo_width = width;
|
||||
@@ -495,12 +495,12 @@ void createMainFBO(int width, int height) {
|
||||
gles_glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
|
||||
}
|
||||
// Put everything back, and active the MainFBO
|
||||
if (state.texture.bound[0])
|
||||
gles_glBindTexture(GL_TEXTURE_2D, state.texture.bound[0]->glname);
|
||||
if (state.texture.active != 0)
|
||||
gles_glActiveTexture(GL_TEXTURE0 + state.texture.active);
|
||||
if (state.texture.client != 0)
|
||||
gles_glClientActiveTexture(GL_TEXTURE0 + state.texture.client);
|
||||
if (glstate.texture.bound[0])
|
||||
gles_glBindTexture(GL_TEXTURE_2D, glstate.texture.bound[0]->glname);
|
||||
if (glstate.texture.active != 0)
|
||||
gles_glActiveTexture(GL_TEXTURE0 + glstate.texture.active);
|
||||
if (glstate.texture.client != 0)
|
||||
gles_glClientActiveTexture(GL_TEXTURE0 + glstate.texture.client);
|
||||
|
||||
}
|
||||
|
||||
@@ -518,12 +518,12 @@ void blitMainFBO() {
|
||||
return;
|
||||
|
||||
// switch to texture unit 0 if needed
|
||||
int old_tex = state.texture.active;
|
||||
int old_client = state.texture.client;
|
||||
if (state.texture.active != 0)
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
if (state.texture.client != 0)
|
||||
glClientActiveTexture(GL_TEXTURE0);
|
||||
int old_tex = glstate.texture.active;
|
||||
int old_client = glstate.texture.client;
|
||||
if (glstate.texture.active != 0)
|
||||
glshim_glActiveTexture(GL_TEXTURE0);
|
||||
if (glstate.texture.client != 0)
|
||||
glshim_glClientActiveTexture(GL_TEXTURE0);
|
||||
// bind the FBO texture
|
||||
gles_glEnable(GL_TEXTURE_2D);
|
||||
gles_glBindTexture(GL_TEXTURE_2D, mainfbo_tex);
|
||||
@@ -546,17 +546,17 @@ void blitMainFBO() {
|
||||
LOAD_GLES(glPushMatrix);
|
||||
LOAD_GLES(glPopMatrix);
|
||||
|
||||
glPushAttrib(GL_TEXTURE_BIT | GL_ENABLE_BIT | GL_TRANSFORM_BIT | GL_COLOR_BUFFER_BIT | GL_CURRENT_BIT);
|
||||
glshim_glPushAttrib(GL_TEXTURE_BIT | GL_ENABLE_BIT | GL_TRANSFORM_BIT | GL_COLOR_BUFFER_BIT | GL_CURRENT_BIT);
|
||||
|
||||
glMatrixMode(GL_TEXTURE);
|
||||
glshim_glMatrixMode(GL_TEXTURE);
|
||||
gles_glPushMatrix();
|
||||
glLoadIdentity();
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glshim_glLoadIdentity();
|
||||
glshim_glMatrixMode(GL_PROJECTION);
|
||||
gles_glPushMatrix();
|
||||
glLoadIdentity();
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glshim_glLoadIdentity();
|
||||
glshim_glMatrixMode(GL_MODELVIEW);
|
||||
gles_glPushMatrix();
|
||||
glLoadIdentity();
|
||||
glshim_glLoadIdentity();
|
||||
GLfloat vert[] = {
|
||||
-1, -1,
|
||||
+1, -1,
|
||||
@@ -572,69 +572,69 @@ void blitMainFBO() {
|
||||
0, sh
|
||||
};
|
||||
|
||||
glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT);
|
||||
glshim_glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT);
|
||||
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
glDisable(GL_LIGHTING);
|
||||
glDisable(GL_CULL_FACE);
|
||||
glDisable(GL_ALPHA_TEST);
|
||||
glDisable(GL_BLEND);
|
||||
glshim_glDisable(GL_DEPTH_TEST);
|
||||
glshim_glDisable(GL_LIGHTING);
|
||||
glshim_glDisable(GL_CULL_FACE);
|
||||
glshim_glDisable(GL_ALPHA_TEST);
|
||||
glshim_glDisable(GL_BLEND);
|
||||
|
||||
// glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
|
||||
if(!state.clientstate.vertex_array) {
|
||||
if(!glstate.clientstate.vertex_array) {
|
||||
gles_glEnableClientState(GL_VERTEX_ARRAY);
|
||||
state.clientstate.vertex_array = 1;
|
||||
glstate.clientstate.vertex_array = 1;
|
||||
}
|
||||
gles_glVertexPointer(2, GL_FLOAT, 0, vert);
|
||||
if(!state.clientstate.tex_coord_array[0]) {
|
||||
if(!glstate.clientstate.tex_coord_array[0]) {
|
||||
gles_glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
state.clientstate.tex_coord_array[0] = 1;
|
||||
glstate.clientstate.tex_coord_array[0] = 1;
|
||||
}
|
||||
gles_glTexCoordPointer(2, GL_FLOAT, 0, tex);
|
||||
for (int a=1; a <MAX_TEX; a++)
|
||||
if(state.clientstate.tex_coord_array[a]) {
|
||||
glClientActiveTexture(GL_TEXTURE0 + a);
|
||||
if(glstate.clientstate.tex_coord_array[a]) {
|
||||
glshim_glClientActiveTexture(GL_TEXTURE0 + a);
|
||||
gles_glDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
state.clientstate.tex_coord_array[a] = 0;
|
||||
glstate.clientstate.tex_coord_array[a] = 0;
|
||||
}
|
||||
if(state.clientstate.color_array) {
|
||||
if(glstate.clientstate.color_array) {
|
||||
gles_glDisableClientState(GL_COLOR_ARRAY);
|
||||
state.clientstate.color_array = 0;
|
||||
glstate.clientstate.color_array = 0;
|
||||
}
|
||||
if(state.clientstate.normal_array) {
|
||||
if(glstate.clientstate.normal_array) {
|
||||
gles_glDisableClientState(GL_NORMAL_ARRAY);
|
||||
state.clientstate.normal_array = 0;
|
||||
glstate.clientstate.normal_array = 0;
|
||||
}
|
||||
|
||||
|
||||
glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
glshim_glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
|
||||
gles_glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
|
||||
// All the previous states are Pushed / Poped anyway...
|
||||
glPopClientAttrib();
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glshim_glPopClientAttrib();
|
||||
glshim_glMatrixMode(GL_MODELVIEW);
|
||||
gles_glPopMatrix();
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glshim_glMatrixMode(GL_PROJECTION);
|
||||
gles_glPopMatrix();
|
||||
glMatrixMode(GL_TEXTURE);
|
||||
glshim_glMatrixMode(GL_TEXTURE);
|
||||
gles_glPopMatrix();
|
||||
glPopAttrib();
|
||||
glshim_glPopAttrib();
|
||||
}
|
||||
#endif
|
||||
// put back viewport
|
||||
gles_glViewport(old_vp[0], old_vp[1], old_vp[2], old_vp[3]);
|
||||
// Put everything back
|
||||
if (state.texture.bound[0])
|
||||
gles_glBindTexture(GL_TEXTURE_2D, state.texture.bound[0]->glname);
|
||||
if (glstate.texture.bound[0])
|
||||
gles_glBindTexture(GL_TEXTURE_2D, glstate.texture.bound[0]->glname);
|
||||
else
|
||||
gles_glBindTexture(GL_TEXTURE_2D, 0);
|
||||
if (!state.enable.texture_2d[0])
|
||||
if (!glstate.enable.texture_2d[0])
|
||||
gles_glDisable(GL_TEXTURE_2D);
|
||||
if (old_tex != 0)
|
||||
glActiveTexture(GL_TEXTURE0 + old_tex);
|
||||
glshim_glActiveTexture(GL_TEXTURE0 + old_tex);
|
||||
if (old_client != 0)
|
||||
glClientActiveTexture(GL_TEXTURE0 + old_client);
|
||||
glshim_glClientActiveTexture(GL_TEXTURE0 + old_client);
|
||||
}
|
||||
|
||||
void bindMainFBO() {
|
||||
@@ -683,11 +683,11 @@ void deleteMainFBO() {
|
||||
// all done...
|
||||
}
|
||||
|
||||
void glFramebufferTextureLayer( GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) {
|
||||
glFramebufferTexture2D(target, attachment, GL_TEXTURE_2D, texture, level); // Force Texture2D, ignore layer...
|
||||
void glshim_glFramebufferTextureLayer( GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) {
|
||||
glshim_glFramebufferTexture2D(target, attachment, GL_TEXTURE_2D, texture, level); // Force Texture2D, ignore layer...
|
||||
}
|
||||
|
||||
void glBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) {
|
||||
void glshim_glBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) {
|
||||
// TODO!
|
||||
// create a temp texture
|
||||
// glCopyPixel of read FBO
|
||||
@@ -697,64 +697,45 @@ printf("glBlitFramebuffer(%d, %d, %d, %d, %d, %d, %d, %d, 0x%04X, 0x%04X)\n",
|
||||
srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
|
||||
}
|
||||
|
||||
// direct wrapper
|
||||
|
||||
void glGenFramebuffers(GLsizei n, GLuint *ids) __attribute__((alias ("glshim_glGenFramebuffers")));
|
||||
void glDeleteFramebuffers(GLsizei n, GLuint *framebuffers) __attribute__((alias ("glshim_glDeleteFramebuffers")));
|
||||
GLboolean glIsFramebuffer(GLuint framebuffer) __attribute__((alias ("glshim_glIsFramebuffer")));
|
||||
GLenum glCheckFramebufferStatus(GLenum target) __attribute__((alias ("glshim_glCheckFramebufferStatus")));
|
||||
void glBindFramebuffer(GLenum target, GLuint framebuffer) __attribute__((alias ("glshim_glBindFramebuffer")));
|
||||
void glFramebufferTexture1D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) __attribute__((alias ("glshim_glFramebufferTexture1D")));
|
||||
void glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) __attribute__((alias ("glshim_glFramebufferTexture2D")));
|
||||
void glFramebufferTexture3D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer) __attribute__((alias ("glshim_glFramebufferTexture3D")));
|
||||
void glGenRenderbuffers(GLsizei n, GLuint *renderbuffers) __attribute__((alias ("glshim_glGenRenderbuffers")));
|
||||
void glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) __attribute__((alias ("glshim_glFramebufferRenderbuffer")));
|
||||
void glDeleteRenderbuffers(GLsizei n, GLuint *renderbuffers) __attribute__((alias ("glshim_glDeleteRenderbuffers")));
|
||||
void glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) __attribute__((alias ("glshim_glRenderbufferStorage")));
|
||||
void glBindRenderbuffer(GLenum target, GLuint renderbuffer) __attribute__((alias ("glshim_glBindRenderbuffer")));
|
||||
GLboolean glIsRenderbuffer(GLuint renderbuffer) __attribute__((alias ("glshim_glIsRenderbuffer")));
|
||||
void glGenerateMipmap(GLenum target) __attribute__((alias ("glshim_glGenerateMipmap")));
|
||||
void glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint *params) __attribute__((alias ("glshim_glGetFramebufferAttachmentParameteriv")));
|
||||
void glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint * params) __attribute__((alias ("glshim_glGetRenderbufferParameteriv")));
|
||||
void glFramebufferTextureLayer( GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) __attribute__((alias ("glshim_glFramebufferTextureLayer")));
|
||||
void glBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) __attribute__((alias ("glshim_glBlitFramebuffer")));
|
||||
|
||||
// EXT direct wrapper
|
||||
void glGenFramebuffersEXT(GLsizei n, GLuint *ids) {
|
||||
glGenFramebuffers(n, ids);
|
||||
}
|
||||
void glDeleteFramebuffersEXT(GLsizei n, GLuint *framebuffers) {
|
||||
glDeleteFramebuffers(n, framebuffers);
|
||||
}
|
||||
GLboolean glIsFramebufferEXT(GLuint framebuffer) {
|
||||
return glIsFramebuffer(framebuffer);
|
||||
}
|
||||
GLenum glCheckFramebufferStatusEXT(GLenum target) {
|
||||
return glCheckFramebufferStatus(target);
|
||||
}
|
||||
void glBindFramebufferEXT(GLenum target, GLuint framebuffer) {
|
||||
glBindFramebuffer(target, framebuffer);
|
||||
}
|
||||
void glFramebufferTexture1DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {
|
||||
glFramebufferTexture1D(target, attachment, textarget, texture, level);
|
||||
}
|
||||
void glFramebufferTexture2DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {
|
||||
glFramebufferTexture2D(target, attachment, textarget, texture, level);
|
||||
}
|
||||
void glFramebufferTexture3DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer) {
|
||||
glFramebufferTexture3D(target, attachment, textarget, texture, level, layer);
|
||||
}
|
||||
void glGenRenderbuffersEXT(GLsizei n, GLuint *renderbuffers) {
|
||||
glGenRenderbuffers(n, renderbuffers);
|
||||
}
|
||||
void glFramebufferRenderbufferEXT(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) {
|
||||
glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
|
||||
}
|
||||
void glDeleteRenderbuffersEXT(GLsizei n, GLuint *renderbuffers) {
|
||||
glDeleteRenderbuffers(n, renderbuffers);
|
||||
}
|
||||
void glRenderbufferStorageEXT(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) {
|
||||
glRenderbufferStorage(target, internalformat, width, height);
|
||||
}
|
||||
void glBindRenderbufferEXT(GLenum target, GLuint renderbuffer) {
|
||||
glBindRenderbuffer(target, renderbuffer);
|
||||
}
|
||||
GLboolean glIsRenderbufferEXT(GLuint renderbuffer) {
|
||||
return glIsRenderbuffer(renderbuffer);
|
||||
}
|
||||
void glGenerateMipmapEXT(GLenum target) {
|
||||
glGenerateMipmap(target);
|
||||
}
|
||||
void glGetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, GLenum pname, GLint *params) {
|
||||
glGetFramebufferAttachmentParameteriv(target, attachment, pname, params);
|
||||
}
|
||||
void glGetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint * params) {
|
||||
glGetRenderbufferParameteriv(target, pname, params);
|
||||
}
|
||||
|
||||
void glFramebufferTextureLayerEXT( GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) {
|
||||
glFramebufferTextureLayer(target, attachment, texture, level, layer);
|
||||
}
|
||||
|
||||
void glBlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) {
|
||||
glBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
|
||||
}
|
||||
void glGenFramebuffersEXT(GLsizei n, GLuint *ids) __attribute__((alias ("glshim_glGenFramebuffers")));
|
||||
void glDeleteFramebuffersEXT(GLsizei n, GLuint *framebuffers) __attribute__((alias ("glshim_glDeleteFramebuffers")));
|
||||
GLboolean glIsFramebufferEXT(GLuint framebuffer) __attribute__((alias ("glshim_glIsFramebuffer")));
|
||||
GLenum glCheckFramebufferStatusEXT(GLenum target) __attribute__((alias ("glshim_glCheckFramebufferStatus")));
|
||||
void glBindFramebufferEXT(GLenum target, GLuint framebuffer) __attribute__((alias ("glshim_glBindFramebuffer")));
|
||||
void glFramebufferTexture1DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) __attribute__((alias ("glshim_glFramebufferTexture1D")));
|
||||
void glFramebufferTexture2DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) __attribute__((alias ("glshim_glFramebufferTexture2D")));
|
||||
void glFramebufferTexture3DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer) __attribute__((alias ("glshim_glFramebufferTexture3D")));
|
||||
void glGenRenderbuffersEXT(GLsizei n, GLuint *renderbuffers) __attribute__((alias ("glshim_glGenRenderbuffers")));
|
||||
void glFramebufferRenderbufferEXT(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) __attribute__((alias ("glshim_glFramebufferRenderbuffer")));
|
||||
void glDeleteRenderbuffersEXT(GLsizei n, GLuint *renderbuffers) __attribute__((alias ("glshim_glDeleteRenderbuffers")));
|
||||
void glRenderbufferStorageEXT(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) __attribute__((alias ("glshim_glRenderbufferStorage")));
|
||||
void glBindRenderbufferEXT(GLenum target, GLuint renderbuffer) __attribute__((alias ("glshim_glBindRenderbuffer")));
|
||||
GLboolean glIsRenderbufferEXT(GLuint renderbuffer) __attribute__((alias ("glshim_glIsRenderbuffer")));
|
||||
void glGenerateMipmapEXT(GLenum target) __attribute__((alias ("glshim_glGenerateMipmap")));
|
||||
void glGetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, GLenum pname, GLint *params) __attribute__((alias ("glshim_glGetFramebufferAttachmentParameteriv")));
|
||||
void glGetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint * params) __attribute__((alias ("glshim_glGetRenderbufferParameteriv")));
|
||||
void glFramebufferTextureLayerEXT( GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) __attribute__((alias ("glshim_glFramebufferTextureLayer")));
|
||||
void glBlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) __attribute__((alias ("glshim_glBlitFramebuffer")));
|
||||
|
||||
@@ -3,49 +3,28 @@
|
||||
#ifndef GL_FRAMEBUFFERS_H
|
||||
#define GL_FRAMEBUFFERS_H
|
||||
|
||||
/*
|
||||
void glGenFramebuffers(GLsizei n, GLuint *ids);
|
||||
void glDeleteFramebuffers(GLsizei n, GLuint *framebuffers);
|
||||
GLboolean glIsFramebuffer(GLuint framebuffer);
|
||||
GLenum glCheckFramebufferStatus(GLenum target);
|
||||
void glBindFramebuffer(GLenum target, GLuint framebuffer);
|
||||
void glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
||||
void glGenRenderbuffers(GLsizei n, GLuint *renderbuffers);
|
||||
void glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
|
||||
void glDeleteRenderbuffers(GLsizei n, GLuint *renderbuffers);
|
||||
void glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
void glBindRenderbuffer(GLenum target, GLuint renderbuffer);
|
||||
GLboolean glIsRenderbuffer(GLuint renderbuffer);
|
||||
void glGenerateMipmap(GLenum target);
|
||||
void glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint *params);
|
||||
void glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint * params);
|
||||
*/
|
||||
void glFramebufferTexture1D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); // naive Wrap
|
||||
void glFramebufferTexture3D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer); // naive Wrap
|
||||
void glRenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); //STUB
|
||||
void glFramebufferTextureLayer( GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); // naive Wrap
|
||||
void glBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
|
||||
void glshim_glGenerateMipmap(GLenum target);
|
||||
void glshim_glGenFramebuffers(GLsizei n, GLuint *ids);
|
||||
void glshim_glDeleteFramebuffers(GLsizei n, GLuint *framebuffers);
|
||||
GLboolean glshim_glIsFramebuffer(GLuint framebuffer);
|
||||
GLenum glshim_glCheckFramebufferStatus(GLenum target);
|
||||
void glshim_glBindFramebuffer(GLenum target, GLuint framebuffer);
|
||||
void glshim_glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
||||
void glshim_glGenRenderbuffers(GLsizei n, GLuint *renderbuffers);
|
||||
void glshim_glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
|
||||
void glshim_glDeleteRenderbuffers(GLsizei n, GLuint *renderbuffers);
|
||||
void glshim_glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
void glshim_glBindRenderbuffer(GLenum target, GLuint renderbuffer);
|
||||
GLboolean glshim_glIsRenderbuffer(GLuint renderbuffer);
|
||||
void glshim_glGenerateMipmap(GLenum target);
|
||||
void glshim_glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint *params);
|
||||
void glshim_glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint * params);
|
||||
|
||||
// Direct creation of EXT versions...
|
||||
void glGenFramebuffersEXT(GLsizei n, GLuint *ids);
|
||||
void glDeleteFramebuffersEXT(GLsizei n, GLuint *framebuffers);
|
||||
GLboolean glIsFramebufferEXT(GLuint framebuffer);
|
||||
GLenum glCheckFramebufferStatusEXT(GLenum target);
|
||||
void glBindFramebufferEXT(GLenum target, GLuint framebuffer);
|
||||
void glFramebufferTexture1DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); // naive Wrap
|
||||
void glFramebufferTexture2DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
||||
void glFramebufferTexture3DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer); // naive Wrap
|
||||
void glGenRenderbuffersEXT(GLsizei n, GLuint *renderbuffers);
|
||||
void glFramebufferRenderbufferEXT(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
|
||||
void glDeleteRenderbuffersEXT(GLsizei n, GLuint *renderbuffers);
|
||||
void glRenderbufferStorageEXT(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
void glBindRenderbufferEXT(GLenum target, GLuint renderbuffer);
|
||||
GLboolean glIsRenderbufferEXT(GLuint renderbuffer);
|
||||
void glGenerateMipmapEXT(GLenum target);
|
||||
void glGetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, GLenum pname, GLint *params);
|
||||
void glGetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint * params);
|
||||
void glFramebufferTextureLayerEXT( GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
|
||||
void glBlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
|
||||
void glshim_glFramebufferTexture1D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); // naive Wrap
|
||||
void glshim_glFramebufferTexture3D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer); // naive Wrap
|
||||
void glshim_glRenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); //STUB
|
||||
void glshim_glFramebufferTextureLayer( GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); // naive Wrap
|
||||
void glshim_glBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
|
||||
|
||||
// Need to keep track of Renderbuffer that are created as DEPTH_STENCIL, to create 2 seperate buffers...
|
||||
typedef struct {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,6 @@
|
||||
#include <dlfcn.h>
|
||||
#include <GLES/gl.h>
|
||||
//#include <GLES/gl.h>
|
||||
#include "gles.h"
|
||||
#include <EGL/egl.h>
|
||||
#ifdef TEXSTREAM
|
||||
#include <EGL/eglext.h>
|
||||
@@ -96,8 +97,6 @@ typedef EGLSurface (*eglCreateStreamProducerSurfaceKHR_PTR)(EGLDisplay dpy, EGLC
|
||||
{int error; if ((error = glGetError())) \
|
||||
printf(file ":%i -> %i\n", line, error);}
|
||||
|
||||
#define GLdouble double
|
||||
|
||||
#define GL_TYPE_CASE(name, var, magic, type, code) \
|
||||
case magic: { \
|
||||
type *name = (type *)var; \
|
||||
@@ -162,14 +161,14 @@ typedef EGLSurface (*eglCreateStreamProducerSurfaceKHR_PTR)(EGLDisplay dpy, EGLC
|
||||
}
|
||||
|
||||
#define PUSH_IF_COMPILING_EXT(nam, ...) \
|
||||
if ((state.list.compiling || state.gl_batch) && state.list.active) { \
|
||||
NewStage(state.list.active, STAGE_GLCALL); \
|
||||
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; \
|
||||
}
|
||||
|
||||
//printf("list:%i, " #nam "\n", state.list.name); \
|
||||
//printf("list:%i, " #nam "\n", state.list.name);
|
||||
|
||||
#define PUSH_IF_COMPILING(name) PUSH_IF_COMPILING_EXT(name, name##_ARG_NAMES)
|
||||
|
||||
@@ -332,27 +331,72 @@ static inline const GLboolean valid_vertex_type(GLenum type) {
|
||||
#include "array.h"
|
||||
#include "framebuffers.h"
|
||||
|
||||
extern void glSecondaryColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
extern void glIndexPointer(GLenum type, GLsizei stride, const GLvoid * pointer);
|
||||
extern void glEdgeFlagPointer(GLsizei stride, const GLvoid * pointer);
|
||||
extern void glGetPointerv(GLenum pname, GLvoid* *params);
|
||||
extern void glFlush();
|
||||
extern void glFinish();
|
||||
const GLubyte *glshim_glGetString(GLenum name);
|
||||
void glshim_glGetIntegerv(GLenum pname, GLint *params);
|
||||
void glshim_glGetFloatv(GLenum pname, GLfloat *params);
|
||||
void glshim_glEnable(GLenum cap);
|
||||
void glshim_glDisable(GLenum cap);
|
||||
void glshim_glEnableClientState(GLenum cap);
|
||||
void glshim_glDisableClientState(GLenum cap);
|
||||
GLboolean glshim_glIsEnabled(GLenum cap);
|
||||
void glshim_glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
|
||||
void glshim_glDrawArrays(GLenum mode, GLint first, GLsizei count);
|
||||
void glshim_glInterleavedArrays(GLenum format, GLsizei stride, const GLvoid *pointer);
|
||||
void glshim_glBegin(GLenum mode);
|
||||
void glshim_glEnd();
|
||||
void glshim_glNormal3f(GLfloat nx, GLfloat ny, GLfloat nz);
|
||||
void glshim_glVertex4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
||||
void glshim_glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
|
||||
void glshim_glSecondaryColor3f(GLfloat r, GLfloat g, GLfloat b);
|
||||
void glshim_glMaterialfv(GLenum face, GLenum pname, const GLfloat *params);
|
||||
void glshim_glMaterialf(GLenum face, GLenum pname, const GLfloat param);
|
||||
void glshim_glTexCoord4f(GLfloat s, GLfloat t, GLfloat r, GLfloat q);
|
||||
void glshim_glMultiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
|
||||
void glshim_glArrayElement(GLint i);
|
||||
void glshim_glLockArrays(GLint first, GLsizei count);
|
||||
void glshim_glUnlockArrays();
|
||||
GLuint glshim_glGenLists(GLsizei range);
|
||||
void glshim_glNewList(GLuint list, GLenum mode);
|
||||
void glshim_glEndList();
|
||||
void glshim_glCallList(GLuint list);
|
||||
void glshim_glCallLists(GLsizei n, GLenum type, const GLvoid *lists);
|
||||
void glshim_glDeleteLists(GLuint list, GLsizei range);
|
||||
void glshim_glListBase(GLuint base);
|
||||
GLboolean glshim_glIsList(GLuint list);
|
||||
void glshim_glPolygonMode(GLenum face, GLenum mode);
|
||||
void glshim_glPushMatrix();
|
||||
void glshim_glPopMatrix();
|
||||
GLenum glshim_glGetError();
|
||||
|
||||
void glshim_glSecondaryColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
void glshim_glIndexPointer(GLenum type, GLsizei stride, const GLvoid * pointer);
|
||||
void glshim_glEdgeFlagPointer(GLsizei stride, const GLvoid * pointer);
|
||||
void glshim_glGetPointerv(GLenum pname, GLvoid* *params);
|
||||
void glshim_glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
|
||||
void glshim_glBlendFuncSeparate(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
|
||||
void glshim_glBlendEquationSeparate(GLenum modeRGB, GLenum modeA);
|
||||
void glshim_glBlendFunc(GLenum sfactor, GLenum dfactor);
|
||||
void glshim_glFlush();
|
||||
void glshim_glFinish();
|
||||
void glshim_glLoadMatrixf(const GLfloat * m);
|
||||
void glshim_glMultMatrixf(const GLfloat * m);
|
||||
void glshim_glFogfv(GLenum pname, const GLfloat* params);
|
||||
|
||||
|
||||
void flush();
|
||||
void init_batch();
|
||||
|
||||
#include "state.h"
|
||||
extern glstate_t state;
|
||||
extern glstate_t glstate;
|
||||
|
||||
extern GLuint gl_batch; // 0 = off, 1 = on
|
||||
GLuint gl_batch; // 0 = off, 1 = on
|
||||
|
||||
static inline void errorGL() { // next glGetError will be from GL
|
||||
state.shim_error = 0;
|
||||
glstate.shim_error = 0;
|
||||
}
|
||||
static inline void errorShim(GLenum error) { // next glGetError will be "error" from glShim
|
||||
state.shim_error = 1;
|
||||
state.last_error = error;
|
||||
glstate.shim_error = 1;
|
||||
glstate.last_error = error;
|
||||
}
|
||||
static inline void noerrorShim() {
|
||||
errorShim(GL_NO_ERROR);
|
||||
|
||||
1110
project/jni/glshim/src/gl/gles.h
Executable file
1110
project/jni/glshim/src/gl/gles.h
Executable file
File diff suppressed because it is too large
Load Diff
@@ -1,12 +1,12 @@
|
||||
#include "light.h"
|
||||
|
||||
#ifndef USE_ES2
|
||||
void glLightModelf(GLenum pname, GLfloat param) {
|
||||
void glshim_glLightModelf(GLenum pname, GLfloat param) {
|
||||
//printf("%sglLightModelf(%04X, %.2f)\n", (state.list.compiling)?"list":"", pname, param);
|
||||
if (state.list.compiling && state.list.active) {
|
||||
if (glstate.list.compiling && glstate.list.active) {
|
||||
GLfloat dummy[4];
|
||||
dummy[0]=param;
|
||||
glLightModelfv(pname, dummy);
|
||||
glshim_glLightModelfv(pname, dummy);
|
||||
return;
|
||||
}
|
||||
LOAD_GLES(glLightModelf);
|
||||
@@ -23,15 +23,15 @@ void glLightModelf(GLenum pname, GLfloat param) {
|
||||
}
|
||||
}
|
||||
|
||||
void glLightModelfv(GLenum pname, const GLfloat* params) {
|
||||
void glshim_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 (state.list.compiling && state.list.active) {
|
||||
NewStage(state.list.active, STAGE_LIGHTMODEL);
|
||||
/* if (state.list.active->lightmodel)
|
||||
state.list.active = extend_renderlist(state.list.active);*/
|
||||
state.list.active->lightmodelparam = pname;
|
||||
state.list.active->lightmodel = (GLfloat*)malloc(4*sizeof(GLfloat));
|
||||
memcpy(state.list.active->lightmodel, params, 4*sizeof(GLfloat));
|
||||
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;
|
||||
}
|
||||
@@ -49,11 +49,11 @@ void glLightModelfv(GLenum pname, const GLfloat* params) {
|
||||
}
|
||||
}
|
||||
|
||||
void glLightfv(GLenum light, GLenum pname, const GLfloat* params) {
|
||||
void glshim_glLightfv(GLenum light, GLenum pname, const GLfloat* params) {
|
||||
//printf("%sglLightfv(%04X, %04X, [%.2f, %.2f, %.2f, %.2f])\n", (state.list.compiling)?"list":"", light, pname, params[0], params[1], params[2], params[3]);
|
||||
if (state.list.compiling && state.list.active) {
|
||||
NewStage(state.list.active, STAGE_LIGHT);
|
||||
rlLightfv(state.list.active, light, pname, params);
|
||||
if (glstate.list.compiling && glstate.list.active) {
|
||||
NewStage(glstate.list.active, STAGE_LIGHT);
|
||||
rlLightfv(glstate.list.active, light, pname, params);
|
||||
noerrorShim();
|
||||
return;
|
||||
}
|
||||
@@ -62,10 +62,15 @@ void glLightfv(GLenum light, GLenum pname, const GLfloat* params) {
|
||||
errorGL();
|
||||
}
|
||||
|
||||
void glLightf(GLenum light, GLenum pname, const GLfloat params) {
|
||||
void glshim_glLightf(GLenum light, GLenum pname, const GLfloat params) {
|
||||
GLfloat dummy[4];
|
||||
dummy[0]=params;
|
||||
glLightfv(light, pname, dummy);
|
||||
glshim_glLightfv(light, pname, dummy);
|
||||
errorGL();
|
||||
}
|
||||
|
||||
void glLightModelf(GLenum pname, GLfloat param) __attribute__((alias("glshim_glLightModelf")));
|
||||
void glLightModelfv(GLenum pname, const GLfloat* params) __attribute__((alias("glshim_glLightModelfv")));
|
||||
void glLightfv(GLenum light, GLenum pname, const GLfloat* params) __attribute__((alias("glshim_glLightfv")));
|
||||
void glLightf(GLenum light, GLenum pname, const GLfloat params) __attribute__((alias("glshim_glLightf")));
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "gl.h"
|
||||
|
||||
void glLightModelf(GLenum pname, GLfloat param);
|
||||
void glLightModelfv(GLenum pname, const GLfloat* params);
|
||||
void glLightfv(GLenum light, GLenum pname, const GLfloat* params);
|
||||
void glLightf(GLenum light, GLenum pname, const GLfloat params);
|
||||
void glshim_glLightModelf(GLenum pname, GLfloat param);
|
||||
void glshim_glLightModelfv(GLenum pname, const GLfloat* params);
|
||||
void glshim_glLightfv(GLenum light, GLenum pname, const GLfloat* params);
|
||||
void glshim_glLightf(GLenum light, GLenum pname, const GLfloat params);
|
||||
|
||||
@@ -5,7 +5,7 @@ GLushort stipplePattern = 0xFFFF;
|
||||
GLubyte *stippleData = NULL;
|
||||
GLuint stippleTexture = 0;
|
||||
|
||||
void glLineStipple(GLuint factor, GLushort pattern) {
|
||||
void glshim_glLineStipple(GLuint factor, GLushort pattern) {
|
||||
stippleFactor = factor;
|
||||
stipplePattern = pattern;
|
||||
if (stippleData != NULL) {
|
||||
@@ -16,23 +16,24 @@ void glLineStipple(GLuint factor, GLushort pattern) {
|
||||
stippleData[i] = (stipplePattern >> i) & 1 ? 255 : 0;
|
||||
}
|
||||
|
||||
glPushAttrib(GL_TEXTURE_BIT);
|
||||
glshim_glPushAttrib(GL_TEXTURE_BIT);
|
||||
if (! stippleTexture)
|
||||
glGenTextures(1, &stippleTexture);
|
||||
glshim_glGenTextures(1, &stippleTexture);
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, stippleTexture);
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
glshim_glBindTexture(GL_TEXTURE_2D, stippleTexture);
|
||||
glshim_glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
glshim_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glshim_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA,
|
||||
glshim_glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA,
|
||||
16, 1, 0, GL_ALPHA, GL_UNSIGNED_BYTE, stippleData);
|
||||
glPopAttrib();
|
||||
glshim_glPopAttrib();
|
||||
noerrorShim();
|
||||
}
|
||||
void glLineStipple(GLuint factor, GLushort pattern) __attribute__((alias("glshim_glLineStipple")));
|
||||
|
||||
void bind_stipple_tex() {
|
||||
glBindTexture(GL_TEXTURE_2D, stippleTexture);
|
||||
glshim_glBindTexture(GL_TEXTURE_2D, stippleTexture);
|
||||
}
|
||||
|
||||
GLfloat *gen_stipple_tex_coords(GLfloat *vert, int length) {
|
||||
|
||||
6
project/jni/glshim/src/gl/line.h
Normal file → Executable file
6
project/jni/glshim/src/gl/line.h
Normal file → Executable file
@@ -1,5 +1,5 @@
|
||||
#include "gl.h"
|
||||
|
||||
extern void glLineStipple(GLuint factor, GLushort pattern);
|
||||
extern GLfloat *gen_stipple_tex_coords(GLfloat *vert, int length);
|
||||
extern void bind_stipple_tex();
|
||||
void glshim_glLineStipple(GLuint factor, GLushort pattern);
|
||||
GLfloat *gen_stipple_tex_coords(GLfloat *vert, int length);
|
||||
void bind_stipple_tex();
|
||||
|
||||
@@ -63,7 +63,7 @@ renderlist_t *alloc_renderlist() {
|
||||
list->set_texture = false;
|
||||
list->texture = 0;*/
|
||||
list->target_texture = GL_TEXTURE_2D;
|
||||
list->tmu = state.texture.active;
|
||||
list->tmu = glstate.texture.active;
|
||||
/*
|
||||
list->polygon_mode = 0;
|
||||
list->fog_op = 0;
|
||||
@@ -559,7 +559,7 @@ void free_renderlist(renderlist_t *list) {
|
||||
|
||||
if (list->raster) {
|
||||
if (list->raster->texture)
|
||||
glDeleteTextures(1, &list->raster->texture);
|
||||
glshim_glDeleteTextures(1, &list->raster->texture);
|
||||
free(list->raster);
|
||||
}
|
||||
|
||||
@@ -588,16 +588,16 @@ void adjust_renderlist(renderlist_t *list) {
|
||||
list->stage = STAGE_LAST;
|
||||
list->open = false;
|
||||
for (int a=0; a<MAX_TEX; a++) {
|
||||
gltexture_t *bound = state.texture.bound[a];
|
||||
gltexture_t *bound = glstate.texture.bound[a];
|
||||
// in case of Texture bounding inside a list
|
||||
if (list->set_texture && (list->tmu == a))
|
||||
bound = getTexture(list->target_texture, list->texture);
|
||||
bound = glshim_getTexture(list->target_texture, list->texture);
|
||||
// adjust the tex_coord now
|
||||
if ((list->tex[a]) && (bound) && ((bound->width != bound->nwidth) || (bound->height != bound->nheight))) {
|
||||
tex_coord_npot(list->tex[a], list->len, bound->width, bound->height, bound->nwidth, bound->nheight);
|
||||
}
|
||||
// GL_ARB_texture_rectangle
|
||||
if ((list->tex[a]) && state.texture.rect_arb[a] && (bound)) {
|
||||
if ((list->tex[a]) && glstate.texture.rect_arb[a] && (bound)) {
|
||||
tex_coord_rect_arb(list->tex[a], list->len, bound->width, bound->height);
|
||||
}
|
||||
}
|
||||
@@ -631,7 +631,7 @@ void draw_renderlist(renderlist_t *list) {
|
||||
// go to 1st...
|
||||
while (list->prev) list = list->prev;
|
||||
// ok, go on now, draw everything
|
||||
//printf("draw_renderlist %p, gl_batch=%i, size=%i, mode=%s(%s), ilen=%d, next=%p, color=%p, secondarycolor=%p\n", list, state.gl_batch, list->len, PrintEnum(list->mode), PrintEnum(list->mode_init), list->ilen, list->next, list->color, list->secondary);
|
||||
//printf("draw_renderlist %p, gl_batch=%i, size=%i, mode=%s(%s), ilen=%d, next=%p, color=%p, secondarycolor=%p\n", list, glstate.gl_batch, list->len, PrintEnum(list->mode), PrintEnum(list->mode_init), list->ilen, list->next, list->color, list->secondary);
|
||||
LOAD_GLES(glDrawArrays);
|
||||
LOAD_GLES(glDrawElements);
|
||||
#ifdef USE_ES2
|
||||
@@ -646,7 +646,7 @@ void draw_renderlist(renderlist_t *list) {
|
||||
LOAD_GLES(glDisable);
|
||||
LOAD_GLES(glEnableClientState);
|
||||
LOAD_GLES(glDisableClientState);
|
||||
glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT);
|
||||
glshim_glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT);
|
||||
|
||||
GLfloat *final_colors;
|
||||
int old_tex;
|
||||
@@ -654,12 +654,12 @@ void draw_renderlist(renderlist_t *list) {
|
||||
do {
|
||||
// push/pop attributes
|
||||
if (list->pushattribute)
|
||||
glPushAttrib(list->pushattribute);
|
||||
glshim_glPushAttrib(list->pushattribute);
|
||||
if (list->popattribute)
|
||||
glPopAttrib();
|
||||
glshim_glPopAttrib();
|
||||
// do call_list
|
||||
if (list->glcall_list)
|
||||
glCallList(list->glcall_list);
|
||||
glshim_glCallList(list->glcall_list);
|
||||
call_list_t *cl = &list->calls;
|
||||
if (cl->len > 0) {
|
||||
for (int i = 0; i < cl->len; i++) {
|
||||
@@ -669,37 +669,37 @@ void draw_renderlist(renderlist_t *list) {
|
||||
if (list->fog_op) {
|
||||
switch (list->fog_op) {
|
||||
case 1: // GL_FOG_COLOR
|
||||
glFogfv(GL_FOG_COLOR, list->fog_val);
|
||||
glshim_glFogfv(GL_FOG_COLOR, list->fog_val);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (list->matrix_op) {
|
||||
switch (list->matrix_op) {
|
||||
case 1: // load
|
||||
glLoadMatrixf(list->matrix_val);
|
||||
glshim_glLoadMatrixf(list->matrix_val);
|
||||
break;
|
||||
case 2: // mult
|
||||
glMultMatrixf(list->matrix_val);
|
||||
glshim_glMultMatrixf(list->matrix_val);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (list->set_tmu) {
|
||||
glActiveTexture(GL_TEXTURE0+list->tmu);
|
||||
glshim_glActiveTexture(GL_TEXTURE0+list->tmu);
|
||||
}
|
||||
if (list->set_texture) {
|
||||
glBindTexture(list->target_texture, list->texture);
|
||||
glshim_glBindTexture(list->target_texture, list->texture);
|
||||
}
|
||||
// raster
|
||||
old_tex = state.texture.active;
|
||||
old_tex = glstate.texture.active;
|
||||
if (list->raster_op) {
|
||||
if (list->raster_op==1) {
|
||||
glRasterPos3f(list->raster_xyz[0], list->raster_xyz[1], list->raster_xyz[2]);
|
||||
glshim_glRasterPos3f(list->raster_xyz[0], list->raster_xyz[1], list->raster_xyz[2]);
|
||||
} else if (list->raster_op==2) {
|
||||
glWindowPos3f(list->raster_xyz[0], list->raster_xyz[1], list->raster_xyz[2]);
|
||||
glshim_glWindowPos3f(list->raster_xyz[0], list->raster_xyz[1], list->raster_xyz[2]);
|
||||
} else if (list->raster_op==3) {
|
||||
glPixelZoom(list->raster_xyz[0], list->raster_xyz[1]);
|
||||
glshim_glPixelZoom(list->raster_xyz[0], list->raster_xyz[1]);
|
||||
} else if ((list->raster_op&0x10000) == 0x10000) {
|
||||
glPixelTransferf(list->raster_op&0xFFFF, list->raster_xyz[0]);
|
||||
glshim_glPixelTransferf(list->raster_op&0xFFFF, list->raster_xyz[0]);
|
||||
}
|
||||
}
|
||||
if (list->raster) {
|
||||
@@ -715,10 +715,10 @@ void draw_renderlist(renderlist_t *list) {
|
||||
kh_foreach_value(map, m,
|
||||
switch (m->pname) {
|
||||
case GL_SHININESS:
|
||||
glMaterialf(GL_FRONT_AND_BACK, m->pname, m->color[0]);
|
||||
glshim_glMaterialf(GL_FRONT_AND_BACK, m->pname, m->color[0]);
|
||||
break;
|
||||
default:
|
||||
glMaterialfv(GL_FRONT_AND_BACK, m->pname, m->color);
|
||||
glshim_glMaterialfv(GL_FRONT_AND_BACK, m->pname, m->color);
|
||||
}
|
||||
)
|
||||
}
|
||||
@@ -728,30 +728,30 @@ void draw_renderlist(renderlist_t *list) {
|
||||
kh_foreach_value(lig, m,
|
||||
switch (m->pname) {
|
||||
default:
|
||||
glLightfv(m->which, m->pname, m->color);
|
||||
glshim_glLightfv(m->which, m->pname, m->color);
|
||||
}
|
||||
)
|
||||
}
|
||||
if (list->lightmodel) {
|
||||
glLightModelfv(list->lightmodelparam, list->lightmodel);
|
||||
glshim_glLightModelfv(list->lightmodelparam, list->lightmodel);
|
||||
}
|
||||
|
||||
if (list->texgen) {
|
||||
khash_t(texgen) *tgn = list->texgen;
|
||||
rendertexgen_t *m;
|
||||
kh_foreach_value(tgn, m,
|
||||
glTexGenfv(m->coord, m->pname, m->color);
|
||||
glshim_glTexGenfv(m->coord, m->pname, m->color);
|
||||
)
|
||||
}
|
||||
|
||||
if (list->polygon_mode) {
|
||||
glPolygonMode(GL_FRONT_AND_BACK, list->polygon_mode);}
|
||||
glshim_glPolygonMode(GL_FRONT_AND_BACK, list->polygon_mode);}
|
||||
|
||||
if (! list->len)
|
||||
continue;
|
||||
#ifdef USE_ES2
|
||||
if (list->vert) {
|
||||
glEnableVertexAttribArray(0);
|
||||
glshim_glEnableVertexAttribArray(0);
|
||||
gles_glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 0, list->vert);
|
||||
}
|
||||
gles_glDrawArrays(list->mode, 0, list->len);
|
||||
@@ -759,19 +759,19 @@ void draw_renderlist(renderlist_t *list) {
|
||||
if (list->vert) {
|
||||
gles_glEnableClientState(GL_VERTEX_ARRAY);
|
||||
gles_glVertexPointer(4, GL_FLOAT, 0, list->vert);
|
||||
state.clientstate.vertex_array = 1;
|
||||
glstate.clientstate.vertex_array = 1;
|
||||
} else {
|
||||
gles_glDisableClientState(GL_VERTEX_ARRAY);
|
||||
state.clientstate.vertex_array = false;
|
||||
glstate.clientstate.vertex_array = false;
|
||||
}
|
||||
|
||||
if (list->normal) {
|
||||
gles_glEnableClientState(GL_NORMAL_ARRAY);
|
||||
gles_glNormalPointer(GL_FLOAT, 0, list->normal);
|
||||
state.clientstate.normal_array = 1;
|
||||
glstate.clientstate.normal_array = 1;
|
||||
} else {
|
||||
gles_glDisableClientState(GL_NORMAL_ARRAY);
|
||||
state.clientstate.normal_array = 0;
|
||||
glstate.clientstate.normal_array = 0;
|
||||
}
|
||||
|
||||
indices = list->indices;
|
||||
@@ -779,8 +779,8 @@ void draw_renderlist(renderlist_t *list) {
|
||||
final_colors = NULL;
|
||||
if (list->color) {
|
||||
gles_glEnableClientState(GL_COLOR_ARRAY);
|
||||
state.clientstate.color_array = 1;
|
||||
if (state.enable.color_sum && (list->secondary)) {
|
||||
glstate.clientstate.color_array = 1;
|
||||
if (glstate.enable.color_sum && (list->secondary)) {
|
||||
final_colors=(GLfloat*)malloc(list->len * 4 * sizeof(GLfloat));
|
||||
if (indices) {
|
||||
for (int i=0; i<list->ilen; i++)
|
||||
@@ -799,19 +799,19 @@ void draw_renderlist(renderlist_t *list) {
|
||||
}
|
||||
} else {
|
||||
gles_glDisableClientState(GL_COLOR_ARRAY);
|
||||
state.clientstate.color_array = 0;
|
||||
glstate.clientstate.color_array = 0;
|
||||
}
|
||||
GLuint texture;
|
||||
bool stipple;
|
||||
stipple = false;
|
||||
if (! list->tex[0]) {
|
||||
// TODO: do we need to support GL_LINE_STRIP?
|
||||
if (list->mode == GL_LINES && state.enable.line_stipple) {
|
||||
if (list->mode == GL_LINES && glstate.enable.line_stipple) {
|
||||
stipple = true;
|
||||
glPushAttrib(GL_COLOR_BUFFER_BIT | GL_ENABLE_BIT | GL_TEXTURE_BIT);
|
||||
glEnable(GL_BLEND);
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
|
||||
glshim_glPushAttrib(GL_COLOR_BUFFER_BIT | GL_ENABLE_BIT | GL_TEXTURE_BIT);
|
||||
glshim_glEnable(GL_BLEND);
|
||||
glshim_glEnable(GL_TEXTURE_2D);
|
||||
glshim_glBlendFunc(GL_SRC_ALPHA, GL_ONE);
|
||||
list->tex[0] = gen_stipple_tex_coords(list->vert, list->len);
|
||||
}
|
||||
}
|
||||
@@ -820,46 +820,46 @@ void draw_renderlist(renderlist_t *list) {
|
||||
for (int a=0; a<MAX_TEX; a++) {
|
||||
texgened[a]=NULL;
|
||||
needclean[a]=0;
|
||||
if ((state.enable.texgen_s[a] || state.enable.texgen_t[a] || state.enable.texgen_r[a])) {
|
||||
if ((glstate.enable.texgen_s[a] || glstate.enable.texgen_t[a] || glstate.enable.texgen_r[a])) {
|
||||
gen_tex_coords(list->vert, list->normal, &texgened[a], list->len, &needclean[a], a, (list->ilen<list->len)?indices:NULL, (list->ilen<list->len)?list->ilen:0);
|
||||
} else if (state.enable.texture_2d[a] && (list->tex[a]==NULL)) {
|
||||
} else if (glstate.enable.texture_2d[a] && (list->tex[a]==NULL)) {
|
||||
gen_tex_coords(list->vert, list->normal, &texgened[a], list->len, &needclean[a], a, (list->ilen<list->len)?indices:NULL, (list->ilen<list->len)?list->ilen:0);
|
||||
}
|
||||
}
|
||||
old_tex = state.texture.client;
|
||||
old_tex = glstate.texture.client;
|
||||
for (int a=0; a<MAX_TEX; a++) {
|
||||
if ((list->tex[a] || texgened[a])/* && state.enable.texture_2d[a]*/) {
|
||||
glClientActiveTexture(GL_TEXTURE0+a);
|
||||
if ((list->tex[a] || texgened[a])/* && glstate.enable.texture_2d[a]*/) {
|
||||
glshim_glClientActiveTexture(GL_TEXTURE0+a);
|
||||
gles_glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
state.clientstate.tex_coord_array[a] = 1;
|
||||
glstate.clientstate.tex_coord_array[a] = 1;
|
||||
gles_glTexCoordPointer(4, GL_FLOAT, 0, (texgened[a])?texgened[a]:list->tex[a]);
|
||||
} else {
|
||||
if (state.clientstate.tex_coord_array[a]) {
|
||||
glClientActiveTexture(GL_TEXTURE0+a);
|
||||
if (glstate.clientstate.tex_coord_array[a]) {
|
||||
glshim_glClientActiveTexture(GL_TEXTURE0+a);
|
||||
gles_glDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
state.clientstate.tex_coord_array[a] = 0;
|
||||
glstate.clientstate.tex_coord_array[a] = 0;
|
||||
}
|
||||
//else if (!state.enable.texgen_s[a] && state.enable.texture_2d[a]) printf("LIBGL: texture_2d[%i] without TexCoord, mode=0x%04X (init=0x%04X), listlen=%i\n", a, list->mode, list->mode_init, list->len);
|
||||
//else if (!glstate.enable.texgen_s[a] && glstate.enable.texture_2d[a]) printf("LIBGL: texture_2d[%i] without TexCoord, mode=0x%04X (init=0x%04X), listlen=%i\n", a, list->mode, list->mode_init, list->len);
|
||||
|
||||
}
|
||||
}
|
||||
for (int aa=0; aa<MAX_TEX; aa++) {
|
||||
if (!state.enable.texture_2d[aa] && (state.enable.texture_1d[aa] || state.enable.texture_3d[aa])) {
|
||||
glClientActiveTexture(aa+GL_TEXTURE0);
|
||||
if (!glstate.enable.texture_2d[aa] && (glstate.enable.texture_1d[aa] || glstate.enable.texture_3d[aa])) {
|
||||
glshim_glClientActiveTexture(aa+GL_TEXTURE0);
|
||||
gles_glEnable(GL_TEXTURE_2D);
|
||||
}
|
||||
}
|
||||
if (state.texture.client != old_tex) glClientActiveTexture(GL_TEXTURE0+old_tex);
|
||||
if (glstate.texture.client != old_tex) glshim_glClientActiveTexture(GL_TEXTURE0+old_tex);
|
||||
|
||||
GLenum mode;
|
||||
mode = list->mode;
|
||||
if ((state.polygon_mode == GL_LINE) && (mode>=GL_TRIANGLES))
|
||||
if ((glstate.polygon_mode == GL_LINE) && (mode>=GL_TRIANGLES))
|
||||
mode = GL_LINES;
|
||||
if ((state.polygon_mode == GL_POINT) && (mode>=GL_TRIANGLES))
|
||||
if ((glstate.polygon_mode == GL_POINT) && (mode>=GL_TRIANGLES))
|
||||
mode = GL_POINTS;
|
||||
|
||||
if (indices) {
|
||||
if (state.render_mode == GL_SELECT) {
|
||||
if (glstate.render_mode == GL_SELECT) {
|
||||
pointer_state_t vtx;
|
||||
vtx.pointer = list->vert;
|
||||
vtx.type = GL_FLOAT;
|
||||
@@ -868,7 +868,7 @@ void draw_renderlist(renderlist_t *list) {
|
||||
vtx.buffer = NULL;
|
||||
select_glDrawElements(&vtx, list->mode, list->ilen, GL_UNSIGNED_SHORT, indices);
|
||||
} else {
|
||||
if (state.polygon_mode == GL_LINE && list->mode_init>=GL_TRIANGLES) {
|
||||
if (glstate.polygon_mode == GL_LINE && list->mode_init>=GL_TRIANGLES) {
|
||||
int n, s;
|
||||
int ilen = list->ilen;
|
||||
GLushort ind_line[ilen*4+2];
|
||||
@@ -951,7 +951,7 @@ void draw_renderlist(renderlist_t *list) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (state.render_mode == GL_SELECT) {
|
||||
if (glstate.render_mode == GL_SELECT) {
|
||||
pointer_state_t vtx;
|
||||
vtx.pointer = list->vert;
|
||||
vtx.type = GL_FLOAT;
|
||||
@@ -961,7 +961,7 @@ void draw_renderlist(renderlist_t *list) {
|
||||
select_glDrawArrays(&vtx, list->mode, 0, list->len);
|
||||
} else {
|
||||
int len = list->len;
|
||||
if ((state.polygon_mode == GL_LINE) && (list->mode_init>=GL_TRIANGLES)) {
|
||||
if ((glstate.polygon_mode == GL_LINE) && (list->mode_init>=GL_TRIANGLES)) {
|
||||
int n, s;
|
||||
GLushort ind_line[len*4+2];
|
||||
int k=0;
|
||||
@@ -1054,22 +1054,22 @@ void draw_renderlist(renderlist_t *list) {
|
||||
}
|
||||
}
|
||||
for (int aa=0; aa<MAX_TEX; aa++) {
|
||||
if (!state.enable.texture_2d[aa] && (state.enable.texture_1d[aa] || state.enable.texture_3d[aa])) {
|
||||
glClientActiveTexture(aa+GL_TEXTURE0);
|
||||
if (!glstate.enable.texture_2d[aa] && (glstate.enable.texture_1d[aa] || glstate.enable.texture_3d[aa])) {
|
||||
glshim_glClientActiveTexture(aa+GL_TEXTURE0);
|
||||
gles_glDisable(GL_TEXTURE_2D);
|
||||
}
|
||||
}
|
||||
if (state.texture.client!=old_tex)
|
||||
glClientActiveTexture(old_tex+GL_TEXTURE0);
|
||||
if (glstate.texture.client!=old_tex)
|
||||
glshim_glClientActiveTexture(old_tex+GL_TEXTURE0);
|
||||
|
||||
if (final_colors)
|
||||
free(final_colors);
|
||||
if (stipple) {
|
||||
glPopAttrib();
|
||||
glshim_glPopAttrib();
|
||||
}
|
||||
#endif
|
||||
} while ((list = list->next));
|
||||
glPopClientAttrib();
|
||||
glshim_glPopClientAttrib();
|
||||
}
|
||||
|
||||
// gl function wrappers
|
||||
@@ -1088,18 +1088,18 @@ void rlVertex4f(renderlist_t *list, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
|
||||
|
||||
if (list->color) {
|
||||
GLfloat *color = list->color + (list->len * 4);
|
||||
memcpy(color, state.color, sizeof(GLfloat) * 4);
|
||||
memcpy(color, glstate.color, sizeof(GLfloat) * 4);
|
||||
}
|
||||
|
||||
if (list->secondary) {
|
||||
GLfloat *secondary = list->secondary + (list->len * 4);
|
||||
memcpy(secondary, state.secondary, sizeof(GLfloat) * 4);
|
||||
memcpy(secondary, glstate.secondary, sizeof(GLfloat) * 4);
|
||||
}
|
||||
|
||||
for (int a=0; a<MAX_TEX; a++) {
|
||||
if (list->tex[a]) {
|
||||
GLfloat *tex = list->tex[a] + (list->len * 4);
|
||||
memcpy(tex, state.texcoord[a], sizeof(GLfloat) * 4);
|
||||
memcpy(tex, glstate.texcoord[a], sizeof(GLfloat) * 4);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1129,14 +1129,14 @@ void rlColor4f(renderlist_t *list, GLfloat r, GLfloat g, GLfloat b, GLfloat a) {
|
||||
int i;
|
||||
if (list->len) for (i = 0; i < list->len-1; i++) {
|
||||
GLfloat *color = (list->color + (i * 4));
|
||||
memcpy(color, state.color, sizeof(GLfloat) * 4);
|
||||
memcpy(color, glstate.color, sizeof(GLfloat) * 4);
|
||||
}/* else {
|
||||
GLfloat *color = list->color;
|
||||
color[0] = r; color[1] = g; color[2] = b; color[3] = a;
|
||||
}*/
|
||||
}
|
||||
|
||||
GLfloat *color = state.color;
|
||||
GLfloat *color = glstate.color;
|
||||
color[0] = r; color[1] = g; color[2] = b; color[3] = a;
|
||||
}
|
||||
|
||||
@@ -1147,11 +1147,11 @@ void rlSecondary3f(renderlist_t *list, GLfloat r, GLfloat g, GLfloat b) {
|
||||
int i;
|
||||
if (list->len) for (i = 0; i < list->len-1; i++) {
|
||||
GLfloat *secondary = (list->secondary + (i * 4));
|
||||
memcpy(secondary, state.secondary, sizeof(GLfloat) * 4);
|
||||
memcpy(secondary, glstate.secondary, sizeof(GLfloat) * 4);
|
||||
}
|
||||
}
|
||||
|
||||
GLfloat *color = state.secondary;
|
||||
GLfloat *color = glstate.secondary;
|
||||
color[0] = r; color[1] = g; color[2] = b; color[3] = 0.0f;
|
||||
}
|
||||
|
||||
@@ -1251,12 +1251,12 @@ void rlTexCoord4f(renderlist_t *list, GLfloat s, GLfloat t, GLfloat r, GLfloat q
|
||||
// catch up
|
||||
GLfloat *tex = list->tex[0];
|
||||
if (list->len) for (int i = 0; i < list->len-1; i++) {
|
||||
memcpy(tex, state.texcoord[0], sizeof(GLfloat) * 4);
|
||||
memcpy(tex, glstate.texcoord[0], sizeof(GLfloat) * 4);
|
||||
tex += 4;
|
||||
}
|
||||
}
|
||||
|
||||
GLfloat *tex = state.texcoord[0];
|
||||
GLfloat *tex = glstate.texcoord[0];
|
||||
tex[0] = s; tex[1] = t;
|
||||
tex[2] = r; tex[3] = q;
|
||||
}
|
||||
@@ -1268,11 +1268,11 @@ void rlMultiTexCoord4f(renderlist_t *list, GLenum target, GLfloat s, GLfloat t,
|
||||
// catch up
|
||||
GLfloat *tex = list->tex[tmu];
|
||||
if (list->len) for (int i = 0; i < list->len-1; i++) {
|
||||
memcpy(tex, state.texcoord[tmu], sizeof(GLfloat) * 4);
|
||||
memcpy(tex, glstate.texcoord[tmu], sizeof(GLfloat) * 4);
|
||||
tex += 4;
|
||||
}
|
||||
}
|
||||
GLfloat *tex = state.texcoord[tmu];
|
||||
GLfloat *tex = glstate.texcoord[tmu];
|
||||
tex[0] = s; tex[1] = t;
|
||||
tex[2] = r; tex[3] = q;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "raster.h"
|
||||
#include "debug.h"
|
||||
|
||||
rasterpos_t rPos = {0, 0, 0};
|
||||
viewport_t viewport = {0, 0, 0, 0};
|
||||
@@ -18,20 +19,20 @@ GLfloat raster_bias[4] = {0.0f, 0.0f, 0.0f, 0.0f};
|
||||
extern void matrix_column_row(const GLfloat *a, GLfloat *b);
|
||||
extern void matrix_vector(const GLfloat *a, const GLfloat *b, GLfloat *c);
|
||||
|
||||
void glRasterPos3f(GLfloat x, GLfloat y, GLfloat z) {
|
||||
if ((state.list.compiling || state.gl_batch) && state.list.active) {
|
||||
NewStage(state.list.active, STAGE_RASTER);
|
||||
rlRasterOp(state.list.active, 1, x, y, z);
|
||||
void glshim_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 1
|
||||
// Transform xyz coordinates with currzent modelview and projection matrix...
|
||||
// Transform xyz coordinates with current modelview and projection matrix...
|
||||
GLfloat glmatrix[16], projection[16], modelview[16];
|
||||
GLfloat t[3], transl[3] = {x, y, z};
|
||||
glGetFloatv(GL_PROJECTION_MATRIX, glmatrix);
|
||||
GLfloat t[4], transl[4] = {x, y, z, 1.0f};
|
||||
glshim_glGetFloatv(GL_PROJECTION_MATRIX, glmatrix);
|
||||
matrix_column_row(glmatrix, projection);
|
||||
glGetFloatv(GL_MODELVIEW_MATRIX, glmatrix);
|
||||
glshim_glGetFloatv(GL_MODELVIEW_MATRIX, glmatrix);
|
||||
matrix_column_row(glmatrix, modelview);
|
||||
matrix_vector(modelview, transl, t);
|
||||
matrix_vector(projection, t, transl);
|
||||
@@ -49,10 +50,10 @@ void glRasterPos3f(GLfloat x, GLfloat y, GLfloat z) {
|
||||
#endif
|
||||
}
|
||||
|
||||
void glWindowPos3f(GLfloat x, GLfloat y, GLfloat z) {
|
||||
if ((state.list.compiling || state.gl_batch) && state.list.active) {
|
||||
NewStage(state.list.active, STAGE_RASTER);
|
||||
rlRasterOp(state.list.active, 2, x, y, z);
|
||||
void glshim_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;
|
||||
}
|
||||
@@ -61,7 +62,7 @@ void glWindowPos3f(GLfloat x, GLfloat y, GLfloat z) {
|
||||
rPos.z = z;
|
||||
}
|
||||
|
||||
void glViewport(GLint x, GLint y, GLsizei width, GLsizei height) {
|
||||
void glshim_glViewport(GLint x, GLint y, GLsizei width, GLsizei height) {
|
||||
PUSH_IF_COMPILING(glViewport);
|
||||
LOAD_GLES(glViewport);
|
||||
gles_glViewport(x, y, width, height);
|
||||
@@ -71,10 +72,10 @@ void glViewport(GLint x, GLint y, GLsizei width, GLsizei height) {
|
||||
viewport.height = height;
|
||||
}
|
||||
|
||||
void glPixelZoom(GLfloat xfactor, GLfloat yfactor) {
|
||||
if ((state.list.compiling || state.gl_batch) && state.list.active) {
|
||||
NewStage(state.list.active, STAGE_RASTER);
|
||||
rlRasterOp(state.list.active, 3, xfactor, yfactor, 0.0f);
|
||||
void glshim_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;
|
||||
}
|
||||
@@ -83,10 +84,10 @@ void glPixelZoom(GLfloat xfactor, GLfloat yfactor) {
|
||||
//printf("LIBGL: glPixelZoom(%f, %f)\n", xfactor, yfactor);
|
||||
}
|
||||
|
||||
void glPixelTransferf(GLenum pname, GLfloat param) {
|
||||
if ((state.list.compiling || state.gl_batch) && state.list.active) {
|
||||
NewStage(state.list.active, STAGE_RASTER);
|
||||
rlRasterOp(state.list.active, pname|0x10000, param, 0.0f, 0.0f);
|
||||
void glshim_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;
|
||||
}
|
||||
@@ -161,49 +162,51 @@ GLuint raster_to_texture()
|
||||
LOAD_GLES(glTexEnvf);
|
||||
LOAD_GLES(glTexImage2D);
|
||||
LOAD_GLES(glActiveTexture);
|
||||
LOAD_GLES(glTexParameteri);
|
||||
LOAD_GLES(glTexParameterf);
|
||||
|
||||
renderlist_t *old_list = state.list.active;
|
||||
if (old_list) state.list.active = NULL; // deactivate list...
|
||||
GLboolean compiling = state.list.compiling;
|
||||
GLuint state_batch = state.gl_batch;
|
||||
state.list.compiling = false;
|
||||
state.gl_batch = 0;
|
||||
glPushAttrib(GL_TEXTURE_BIT | GL_ENABLE_BIT );
|
||||
renderlist_t *old_list = glstate.list.active;
|
||||
if (old_list) glstate.list.active = NULL; // deactivate list...
|
||||
GLboolean compiling = glstate.list.compiling;
|
||||
GLuint state_batch = glstate.gl_batch;
|
||||
glstate.list.compiling = false;
|
||||
glstate.gl_batch = 0;
|
||||
glshim_glPushAttrib(GL_TEXTURE_BIT | GL_ENABLE_BIT );
|
||||
GLuint old_tex_unit, old_tex;
|
||||
glGetIntegerv(GL_ACTIVE_TEXTURE, &old_tex_unit);
|
||||
if (old_tex_unit!=GL_TEXTURE0) glActiveTexture(GL_TEXTURE0);
|
||||
glshim_glGetIntegerv(GL_ACTIVE_TEXTURE, &old_tex_unit);
|
||||
if (old_tex_unit!=GL_TEXTURE0) glshim_glActiveTexture(GL_TEXTURE0);
|
||||
old_tex = 0;
|
||||
if (state.texture.bound[0])
|
||||
old_tex = state.texture.bound[0]->texture;
|
||||
if (glstate.texture.bound[0])
|
||||
old_tex = glstate.texture.bound[0]->texture;
|
||||
GLuint raster_texture;
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glshim_glEnable(GL_TEXTURE_2D);
|
||||
gles_glGenTextures(1, &raster_texture);
|
||||
gles_glBindTexture(GL_TEXTURE_2D, raster_texture);
|
||||
|
||||
glPixelStorei(GL_PACK_ALIGNMENT, 1);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
|
||||
glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
|
||||
glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
glshim_glPixelStorei(GL_PACK_ALIGNMENT, 1);
|
||||
glshim_glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
glshim_glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
|
||||
glshim_glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
|
||||
glshim_glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
|
||||
glshim_glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
gles_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
gles_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
gles_glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
gles_glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
gles_glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, raster_width, raster_height,
|
||||
0, GL_RGBA, GL_UNSIGNED_BYTE, raster);
|
||||
|
||||
gles_glBindTexture(GL_TEXTURE_2D, old_tex);
|
||||
if (old_tex_unit!=GL_TEXTURE0)
|
||||
glActiveTexture(old_tex_unit);
|
||||
glPopAttrib();
|
||||
if (old_list) state.list.active = old_list;
|
||||
state.list.compiling = compiling;
|
||||
state.gl_batch = state_batch;
|
||||
glshim_glActiveTexture(old_tex_unit);
|
||||
glshim_glPopAttrib();
|
||||
if (old_list) glstate.list.active = old_list;
|
||||
glstate.list.compiling = compiling;
|
||||
glstate.gl_batch = state_batch;
|
||||
return raster_texture;
|
||||
}
|
||||
|
||||
void glBitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig,
|
||||
void glshim_glBitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig,
|
||||
GLfloat xmove, GLfloat ymove, const GLubyte *bitmap) {
|
||||
/*printf("glBitmap, xy={%f, %f}, xyorig={%f, %f}, size={%u, %u}, zoom={%f, %f}, viewport={%i, %i, %i, %i}\n",
|
||||
rPos.x, rPos.y, xorig, yorig, width, height, zoomx, zoomy, viewport.x, viewport.y, viewport.width, viewport.height);*/
|
||||
@@ -211,10 +214,10 @@ void glBitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig,
|
||||
// TODO: negative width/height mirrors bitmap?
|
||||
noerrorShim();
|
||||
if ((!width && !height) || (bitmap==0)) {
|
||||
if (state.list.compiling || state.gl_batch) {
|
||||
if (state.list.active->raster)
|
||||
state.list.active = extend_renderlist(state.list.active); // already a raster in the list, create a new one
|
||||
rasterlist_t *r = state.list.active->raster = (rasterlist_t*)malloc(sizeof(rasterlist_t));
|
||||
if (glstate.list.compiling || glstate.gl_batch) {
|
||||
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));
|
||||
r->texture = 0;
|
||||
r->xorig = 0;
|
||||
r->yorig = 0;
|
||||
@@ -237,21 +240,27 @@ void glBitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig,
|
||||
int pixtrans=raster_need_transform();
|
||||
|
||||
// copy to pixel data
|
||||
for (y = 0; y < height; y++) {
|
||||
to = raster + 4 * (GLint)(y * raster_width);
|
||||
from = bitmap + (y * ((width+7)/8));
|
||||
for (x = 0; x < width; x++) {
|
||||
// TODO: wasteful, unroll this?
|
||||
GLubyte b = from[(x / 8)];
|
||||
int p = (b & (1 << (7 - (x % 8)))) ? 255 : 0;
|
||||
// r, g, b, a
|
||||
//p = (p ? 255 : 0);
|
||||
if (pixtrans) {
|
||||
if (pixtrans) {
|
||||
for (y = 0; y < height; y++) {
|
||||
to = raster + 4 * (GLint)(y * raster_width);
|
||||
from = bitmap + (y * ((width+7)/8));
|
||||
for (x = 0; x < width; x++) {
|
||||
GLubyte b = from[(x / 8)];
|
||||
int p = (b & (1 << (7 - (x % 8)))) ? 255 : 0;
|
||||
// r, g, b, a
|
||||
*to++ = raster_transform(p, 0);
|
||||
*to++ = raster_transform(p, 1);
|
||||
*to++ = raster_transform(p, 2);
|
||||
*to++ = raster_transform(p, 3);
|
||||
} else {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (y = 0; y < height; y++) {
|
||||
to = raster + 4 * (GLint)(y * raster_width);
|
||||
from = bitmap + (y * ((width+7)/8));
|
||||
for (x = 0; x < width; x++) {
|
||||
GLubyte b = from[(x / 8)];
|
||||
int p = (b & (1 << (7 - (x % 8)))) ? 255 : 0;
|
||||
*to++ = p;
|
||||
*to++ = p;
|
||||
*to++ = p;
|
||||
@@ -262,11 +271,9 @@ void glBitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig,
|
||||
|
||||
rasterlist_t rast;
|
||||
rasterlist_t *r;
|
||||
if (state.list.compiling || state.gl_batch) {
|
||||
NewStage(state.list.active, STAGE_RASTER);
|
||||
/* if (state.list.active->raster)
|
||||
state.list.active = extend_renderlist(state.list.active);*/ // already a raster in the list, create a new one
|
||||
r = state.list.active->raster = (rasterlist_t*)malloc(sizeof(rasterlist_t));
|
||||
if (glstate.list.compiling || glstate.gl_batch) {
|
||||
NewStage(glstate.list.active, STAGE_RASTER);
|
||||
r = glstate.list.active->raster = (rasterlist_t*)malloc(sizeof(rasterlist_t));
|
||||
} else {
|
||||
r = &rast;
|
||||
}
|
||||
@@ -281,20 +288,23 @@ void glBitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig,
|
||||
r->zoomx = zoomx;
|
||||
r->zoomy = zoomy;
|
||||
LOAD_GLES(glDeleteTextures);
|
||||
if (!(state.list.compiling || state.gl_batch)) {
|
||||
if (!(glstate.list.compiling || glstate.gl_batch)) {
|
||||
render_raster_list(r);
|
||||
gles_glDeleteTextures(1, &r->texture);
|
||||
r->texture = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void glDrawPixels(GLsizei width, GLsizei height, GLenum format,
|
||||
void glshim_glDrawPixels(GLsizei width, GLsizei height, GLenum format,
|
||||
GLenum type, const GLvoid *data) {
|
||||
GLubyte *pixels, *from, *to;
|
||||
GLvoid *dst = NULL;
|
||||
LOAD_GLES(glDeleteTextures);
|
||||
|
||||
noerrorShim();
|
||||
/*printf("glDrawPixels, xy={%f, %f}, size={%i, %i}, format=%04x, type=%04x, zoom={%f, %f}, viewport={%i, %i, %i, %i}\n",
|
||||
rPos.x, rPos.y, width, height, format, type, zoomx, (zoominversey)?-zoomy:zoomy, viewport.x, viewport.y, viewport.width, viewport.height);*/
|
||||
|
||||
/*printf("glDrawPixels, xy={%f, %f}, size={%i, %i}, format=%s, type=%s, zoom={%f, %f}, viewport={%i, %i, %i, %i}\n",
|
||||
rPos.x, rPos.y, width, height, PrintEnum(format), PrintEnum(type), zoomx, zoomy, viewport.x, viewport.y, viewport.width, viewport.height);*/
|
||||
// check of unsuported format...
|
||||
if ((format == GL_STENCIL_INDEX) || (format == GL_DEPTH_COMPONENT)) {
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
@@ -303,7 +313,7 @@ void glDrawPixels(GLsizei width, GLsizei height, GLenum format,
|
||||
|
||||
init_raster(width, height);
|
||||
|
||||
GLsizei bmp_width = (state.texture.unpack_row_length)?state.texture.unpack_row_length:width;
|
||||
GLsizei bmp_width = (glstate.texture.unpack_row_length)?glstate.texture.unpack_row_length:width;
|
||||
|
||||
if (! pixel_convert(data, &dst, bmp_width, height,
|
||||
format, type, GL_RGBA, GL_UNSIGNED_BYTE, 0)) {
|
||||
@@ -314,16 +324,22 @@ void glDrawPixels(GLsizei width, GLsizei height, GLenum format,
|
||||
GLint vx, vy;
|
||||
int pixtrans=raster_need_transform();
|
||||
|
||||
for (int y = 0; y < height; y++) {
|
||||
to = raster + 4 * (GLint)(y * raster_width);
|
||||
from = pixels + 4 * (state.texture.unpack_skip_pixels + (y + state.texture.unpack_skip_rows) * bmp_width);
|
||||
for (int x = 0; x < width; x++) {
|
||||
if (pixtrans) {
|
||||
if (pixtrans) {
|
||||
for (int y = 0; y < height; y++) {
|
||||
to = raster + 4 * (GLint)(y * raster_width);
|
||||
from = pixels + 4 * (glstate.texture.unpack_skip_pixels + (y + glstate.texture.unpack_skip_rows) * bmp_width);
|
||||
for (int x = 0; x < width; x++) {
|
||||
*to++ = raster_transform(*from++, 0);
|
||||
*to++ = raster_transform(*from++, 1);
|
||||
*to++ = raster_transform(*from++, 2);
|
||||
*to++ = raster_transform(*from++, 3);
|
||||
} else {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (int y = 0; y < height; y++) {
|
||||
to = raster + 4 * (GLint)(y * raster_width);
|
||||
from = pixels + 4 * (glstate.texture.unpack_skip_pixels + (y + glstate.texture.unpack_skip_rows) * bmp_width);
|
||||
for (int x = 0; x < width; x++) {
|
||||
*to++ = *from++;
|
||||
*to++ = *from++;
|
||||
*to++ = *from++;
|
||||
@@ -334,15 +350,15 @@ void glDrawPixels(GLsizei width, GLsizei height, GLenum format,
|
||||
if (pixels != data)
|
||||
free(pixels);
|
||||
|
||||
rasterlist_t rast;
|
||||
static rasterlist_t rast = {.texture=0};
|
||||
rasterlist_t *r;
|
||||
if (state.list.compiling || gl_batch) {
|
||||
NewStage(state.list.active, STAGE_RASTER);
|
||||
/* if (state.list.active->raster)
|
||||
state.list.active = extend_renderlist(state.list.active);*/ // already a raster in the list, create a new one
|
||||
rasterlist_t *r = state.list.active->raster = (rasterlist_t*)malloc(sizeof(rasterlist_t));
|
||||
if (glstate.list.compiling || gl_batch) {
|
||||
NewStage(glstate.list.active, STAGE_RASTER);
|
||||
rasterlist_t *r = glstate.list.active->raster = (rasterlist_t*)malloc(sizeof(rasterlist_t));
|
||||
} else {
|
||||
r = &rast;
|
||||
if(r->texture)
|
||||
gles_glDeleteTextures(1, &r->texture);
|
||||
}
|
||||
r->texture = raster_to_texture(width, height);
|
||||
r->xmove = 0;
|
||||
@@ -354,100 +370,104 @@ void glDrawPixels(GLsizei width, GLsizei height, GLenum format,
|
||||
r->bitmap = false;
|
||||
r->zoomx = zoomx;
|
||||
r->zoomy = zoomy;
|
||||
LOAD_GLES(glDeleteTextures);
|
||||
if (!(state.list.compiling || state.gl_batch)) {
|
||||
if (!(glstate.list.compiling || glstate.gl_batch)) {
|
||||
render_raster_list(r);
|
||||
gles_glDeleteTextures(1, &r->texture);
|
||||
r->texture = 0;
|
||||
/* gles_glDeleteTextures(1, &r->texture);
|
||||
r->texture = 0;*/
|
||||
}
|
||||
}
|
||||
|
||||
void render_raster_list(rasterlist_t* rast) {
|
||||
//printf("render_raster_list, rast->width=%i, rast->height=%i, rPos.x=%f, rPos.y=%f, raster->texture=%u\n", rast->width, rast->height, rPos.x, rPos.y, rast->texture);
|
||||
//printf("render_raster_list, rast->width=%i, rast->height=%i, rPos.x=%f, rPos.y=%f, rast->zoomxy=%f/%f raster->texture=%u\n", rast->width, rast->height, rPos.x, rPos.y, rast->zoomx, rast->zoomy, rast->texture);
|
||||
LOAD_GLES(glEnableClientState);
|
||||
LOAD_GLES(glDisableClientState);
|
||||
LOAD_GLES(glBindTexture);
|
||||
LOAD_GLES(glVertexPointer);
|
||||
LOAD_GLES(glTexCoordPointer);
|
||||
LOAD_GLES(glDrawArrays);
|
||||
LOAD_GLES(glActiveTexture);
|
||||
LOAD_GLES(glClientActiveTexture);
|
||||
|
||||
if (rast->texture) {
|
||||
glPushAttrib(GL_TEXTURE_BIT | GL_ENABLE_BIT | GL_TRANSFORM_BIT | GL_COLOR_BUFFER_BIT | GL_CURRENT_BIT);
|
||||
glshim_glPushAttrib(GL_TEXTURE_BIT | GL_ENABLE_BIT | GL_TRANSFORM_BIT | GL_COLOR_BUFFER_BIT | GL_CURRENT_BIT);
|
||||
GLfloat old_projection[16], old_modelview[16], old_texture[16];
|
||||
|
||||
GLuint old_tex = state.texture.active;
|
||||
if (old_tex!=0) glActiveTexture(GL_TEXTURE0);
|
||||
GLuint old_cli = state.texture.client;
|
||||
if (old_cli!=0) glClientActiveTexture(GL_TEXTURE0);
|
||||
glMatrixMode(GL_TEXTURE);
|
||||
glGetFloatv(GL_TEXTURE_MATRIX, old_texture);
|
||||
glLoadIdentity();
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glGetFloatv(GL_PROJECTION_MATRIX, old_projection);
|
||||
glLoadIdentity();
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glGetFloatv(GL_MODELVIEW_MATRIX, old_modelview);
|
||||
glLoadIdentity();
|
||||
float w2 = viewport.width / 2.0f;
|
||||
float h2 = viewport.height / 2.0f;
|
||||
GLuint old_tex = glstate.texture.active;
|
||||
if (old_tex!=0) gles_glActiveTexture(GL_TEXTURE0);
|
||||
GLuint old_cli = glstate.texture.client;
|
||||
if (old_cli!=0) gles_glClientActiveTexture(GL_TEXTURE0);
|
||||
glshim_glGetFloatv(GL_TEXTURE_MATRIX, old_texture);
|
||||
glshim_glGetFloatv(GL_PROJECTION_MATRIX, old_projection);
|
||||
glshim_glGetFloatv(GL_MODELVIEW_MATRIX, old_modelview);
|
||||
glshim_glMatrixMode(GL_TEXTURE);
|
||||
glshim_glLoadIdentity();
|
||||
glshim_glMatrixMode(GL_PROJECTION);
|
||||
glshim_glLoadIdentity();
|
||||
glshim_glMatrixMode(GL_MODELVIEW);
|
||||
glshim_glLoadIdentity();
|
||||
float w2 = 2.0f / viewport.width;
|
||||
float h2 = 2.0f / viewport.height;
|
||||
float raster_x1=rPos.x-rast->xorig;
|
||||
float raster_x2=rPos.x-rast->xorig + rast->width * rast->zoomx ;
|
||||
float raster_y1=rPos.y-rast->yorig;
|
||||
float raster_y2=rPos.y-rast->yorig + rast->height * rast->zoomy ;
|
||||
GLfloat vert[] = {
|
||||
(raster_x1-w2)/w2, (raster_y1-h2)/h2, 0,
|
||||
(raster_x2-w2)/w2, (raster_y1-h2)/h2, 0,
|
||||
(raster_x2-w2)/w2, (raster_y2-h2)/h2, 0,
|
||||
(raster_x1-w2)/w2, (raster_y2-h2)/h2, 0,
|
||||
GLfloat rast_vert[] = {
|
||||
raster_x1*w2-1.0f, raster_y1*h2-1.0f,
|
||||
raster_x2*w2-1.0f, raster_y1*h2-1.0f,
|
||||
raster_x2*w2-1.0f, raster_y2*h2-1.0f,
|
||||
raster_x1*w2-1.0f, raster_y2*h2-1.0f
|
||||
};
|
||||
float sw = rast->width / (GLfloat)npot(rast->width);
|
||||
float sh = rast->height / (GLfloat)npot(rast->height);
|
||||
GLfloat tex[] = {
|
||||
GLfloat rast_tex[] = {
|
||||
0, 0,
|
||||
sw, 0,
|
||||
sw, sh,
|
||||
0, sh
|
||||
};
|
||||
|
||||
glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT | GL_CLIENT_PIXEL_STORE_BIT);
|
||||
glshim_glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT | GL_CLIENT_PIXEL_STORE_BIT);
|
||||
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
glDisable(GL_LIGHTING);
|
||||
glDisable(GL_CULL_FACE);
|
||||
glshim_glDisable(GL_DEPTH_TEST);
|
||||
glshim_glDisable(GL_LIGHTING);
|
||||
glshim_glDisable(GL_CULL_FACE);
|
||||
if (rast->bitmap) {
|
||||
glEnable(GL_ALPHA_TEST);
|
||||
glAlphaFunc(GL_GREATER, 0.0f);
|
||||
glshim_glEnable(GL_ALPHA_TEST);
|
||||
glshim_glAlphaFunc(GL_GREATER, 0.0f);
|
||||
} else {
|
||||
glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
glshim_glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
}
|
||||
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glshim_glEnable(GL_TEXTURE_2D);
|
||||
gles_glBindTexture(GL_TEXTURE_2D, rast->texture);
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
glshim_glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
|
||||
if(!state.clientstate.vertex_array) {
|
||||
if(!glstate.clientstate.vertex_array)
|
||||
{
|
||||
gles_glEnableClientState(GL_VERTEX_ARRAY);
|
||||
state.clientstate.vertex_array = 1;
|
||||
glstate.clientstate.vertex_array = 1;
|
||||
}
|
||||
gles_glVertexPointer(3, GL_FLOAT, 0, vert);
|
||||
if(!state.clientstate.tex_coord_array[0]) {
|
||||
gles_glVertexPointer(2, GL_FLOAT, 0, rast_vert);
|
||||
if(!glstate.clientstate.tex_coord_array[0])
|
||||
{
|
||||
gles_glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
state.clientstate.tex_coord_array[0] = 1;
|
||||
glstate.clientstate.tex_coord_array[0] = 1;
|
||||
}
|
||||
gles_glTexCoordPointer(2, GL_FLOAT, 0, tex);
|
||||
gles_glTexCoordPointer(2, GL_FLOAT, 0, rast_tex);
|
||||
for (int a=1; a <MAX_TEX; a++)
|
||||
if(state.clientstate.tex_coord_array[a]) {
|
||||
glClientActiveTexture(GL_TEXTURE0 + a);
|
||||
if(glstate.clientstate.tex_coord_array[a]) {
|
||||
gles_glClientActiveTexture(GL_TEXTURE0 + a);
|
||||
gles_glDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
state.clientstate.tex_coord_array[a] = 0;
|
||||
glstate.clientstate.tex_coord_array[a] = 0;
|
||||
gles_glClientActiveTexture(GL_TEXTURE0);
|
||||
}
|
||||
if(state.clientstate.color_array) {
|
||||
if(glstate.clientstate.color_array) {
|
||||
gles_glDisableClientState(GL_COLOR_ARRAY);
|
||||
state.clientstate.color_array = 0;
|
||||
glstate.clientstate.color_array = 0;
|
||||
}
|
||||
if(state.clientstate.normal_array) {
|
||||
if(glstate.clientstate.normal_array) {
|
||||
gles_glDisableClientState(GL_NORMAL_ARRAY);
|
||||
state.clientstate.normal_array = 0;
|
||||
glstate.clientstate.normal_array = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -455,17 +475,26 @@ void render_raster_list(rasterlist_t* rast) {
|
||||
|
||||
gles_glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
|
||||
// All the previous states are Pushed / Poped anyway...
|
||||
if (old_tex!=0) glActiveTexture(GL_TEXTURE0+old_tex);
|
||||
if (old_cli!=0) glClientActiveTexture(GL_TEXTURE0+old_cli);
|
||||
glPopClientAttrib();
|
||||
glMatrixMode(GL_TEXTURE);
|
||||
glLoadMatrixf(old_texture);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadMatrixf(old_modelview);
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadMatrixf(old_projection);
|
||||
glPopAttrib();
|
||||
if (old_tex!=0) gles_glActiveTexture(GL_TEXTURE0+old_tex);
|
||||
if (old_cli!=0) gles_glClientActiveTexture(GL_TEXTURE0+old_cli);
|
||||
glshim_glPopClientAttrib();
|
||||
glshim_glMatrixMode(GL_TEXTURE);
|
||||
glshim_glLoadMatrixf(old_texture);
|
||||
glshim_glMatrixMode(GL_MODELVIEW);
|
||||
glshim_glLoadMatrixf(old_modelview);
|
||||
glshim_glMatrixMode(GL_PROJECTION);
|
||||
glshim_glLoadMatrixf(old_projection);
|
||||
glshim_glPopAttrib();
|
||||
}
|
||||
rPos.x += rast->xmove;
|
||||
rPos.y += rast->ymove;
|
||||
}
|
||||
|
||||
//Direct wrapper
|
||||
void glBitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap) __attribute__((alias("glshim_glBitmap")));
|
||||
void glDrawPixels(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *data) __attribute__((alias("glshim_glDrawPixels")));
|
||||
void glRasterPos3f(GLfloat x, GLfloat y, GLfloat z) __attribute__((alias("glshim_glRasterPos3f")));
|
||||
void glWindowPos3f(GLfloat x, GLfloat y, GLfloat z) __attribute__((alias("glshim_glWindowPos3f")));
|
||||
void glViewport(GLint x, GLint y, GLsizei width, GLsizei height) __attribute__((alias("glshim_glViewport")));
|
||||
void glPixelZoom(GLfloat xfactor, GLfloat yfactor) __attribute__((alias("glshim_glPixelZoom")));
|
||||
void glPixelTransferf(GLenum pname, GLfloat param) __attribute__((alias("glshim_glPixelTransferf")));
|
||||
|
||||
@@ -29,18 +29,18 @@ extern GLfloat raster_bias[4];
|
||||
|
||||
int raster_need_transform();
|
||||
|
||||
extern void glBitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig,
|
||||
void glshim_glBitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig,
|
||||
GLfloat xmove, GLfloat ymove, const GLubyte *bitmap);
|
||||
extern void glDrawPixels(GLsizei width, GLsizei height, GLenum format,
|
||||
void glshim_glDrawPixels(GLsizei width, GLsizei height, GLenum format,
|
||||
GLenum type, const GLvoid *data);
|
||||
extern void glRasterPos3f(GLfloat x, GLfloat y, GLfloat z);
|
||||
extern void glWindowPos3f(GLfloat x, GLfloat y, GLfloat z);
|
||||
extern void glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
extern void render_raster();
|
||||
void glshim_glRasterPos3f(GLfloat x, GLfloat y, GLfloat z);
|
||||
void glshim_glWindowPos3f(GLfloat x, GLfloat y, GLfloat z);
|
||||
void glshim_glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
void render_raster();
|
||||
|
||||
extern void glPixelZoom(GLfloat xfactor, GLfloat yfactor);
|
||||
void glshim_glPixelZoom(GLfloat xfactor, GLfloat yfactor);
|
||||
|
||||
extern void glPixelTransferf(GLenum pname, GLfloat param);
|
||||
void glshim_glPixelTransferf(GLenum pname, GLfloat param);
|
||||
|
||||
void render_raster_list(rasterlist_t* raster);
|
||||
|
||||
|
||||
@@ -2,35 +2,35 @@
|
||||
|
||||
void push_hit() {
|
||||
// push current hit to hit list, and re-init current hit
|
||||
if (state.selectbuf.hit) {
|
||||
if (!state.selectbuf.overflow) {
|
||||
if (state.selectbuf.zmin<0.0f) state.selectbuf.zmin=0.0f; // not really normalized...
|
||||
if (state.selectbuf.zmax>1.0f) state.selectbuf.zmax=1.0f; // TODO, normalize for good?
|
||||
int tocopy = state.namestack.top + 3;
|
||||
if (tocopy+state.selectbuf.pos > state.selectbuf.size) {
|
||||
state.selectbuf.overflow = 1;
|
||||
tocopy = state.selectbuf.size - state.selectbuf.pos;
|
||||
if (glstate.selectbuf.hit) {
|
||||
if (!glstate.selectbuf.overflow) {
|
||||
if (glstate.selectbuf.zmin<0.0f) glstate.selectbuf.zmin=0.0f; // not really normalized...
|
||||
if (glstate.selectbuf.zmax>1.0f) glstate.selectbuf.zmax=1.0f; // TODO, normalize for good?
|
||||
int tocopy = glstate.namestack.top + 3;
|
||||
if (tocopy+glstate.selectbuf.pos > glstate.selectbuf.size) {
|
||||
glstate.selectbuf.overflow = 1;
|
||||
tocopy = glstate.selectbuf.size - glstate.selectbuf.pos;
|
||||
}
|
||||
if(tocopy>0)
|
||||
state.selectbuf.buffer[state.selectbuf.pos+0] = state.namestack.top;
|
||||
glstate.selectbuf.buffer[glstate.selectbuf.pos+0] = glstate.namestack.top;
|
||||
if(tocopy>1)
|
||||
state.selectbuf.buffer[state.selectbuf.pos+1] = (unsigned int)(state.selectbuf.zmin * INT_MAX );
|
||||
glstate.selectbuf.buffer[glstate.selectbuf.pos+1] = (unsigned int)(glstate.selectbuf.zmin * INT_MAX );
|
||||
if(tocopy>2)
|
||||
state.selectbuf.buffer[state.selectbuf.pos+2] = (unsigned int)(state.selectbuf.zmax * INT_MAX );
|
||||
glstate.selectbuf.buffer[glstate.selectbuf.pos+2] = (unsigned int)(glstate.selectbuf.zmax * INT_MAX );
|
||||
if(tocopy>3)
|
||||
memcpy(state.selectbuf.buffer + state.selectbuf.pos + 3, state.namestack.names, (tocopy-3) * sizeof(GLuint));
|
||||
memcpy(glstate.selectbuf.buffer + glstate.selectbuf.pos + 3, glstate.namestack.names, (tocopy-3) * sizeof(GLuint));
|
||||
|
||||
state.selectbuf.count++;
|
||||
state.selectbuf.pos += tocopy;
|
||||
glstate.selectbuf.count++;
|
||||
glstate.selectbuf.pos += tocopy;
|
||||
}
|
||||
state.selectbuf.hit = 0;
|
||||
glstate.selectbuf.hit = 0;
|
||||
}
|
||||
state.selectbuf.zmin = 1.0f;
|
||||
state.selectbuf.zmax = 0.0f;
|
||||
glstate.selectbuf.zmin = 1.0f;
|
||||
glstate.selectbuf.zmax = 0.0f;
|
||||
}
|
||||
|
||||
|
||||
GLint glRenderMode(GLenum mode) {
|
||||
GLint glshim_glRenderMode(GLenum mode) {
|
||||
int ret = 0;
|
||||
if ((mode==GL_SELECT) || (mode==GL_RENDER)) { // missing GL_FEEDBACK
|
||||
noerrorShim();
|
||||
@@ -38,83 +38,83 @@ GLint glRenderMode(GLenum mode) {
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
return 0;
|
||||
}
|
||||
if (state.render_mode == GL_SELECT) {
|
||||
if (glstate.render_mode == GL_SELECT) {
|
||||
push_hit();
|
||||
ret = state.selectbuf.count;
|
||||
ret = glstate.selectbuf.count;
|
||||
}
|
||||
if (mode == GL_SELECT) {
|
||||
if (state.selectbuf.buffer == NULL) {// error, cannot use Select Mode without select buffer
|
||||
if (glstate.selectbuf.buffer == NULL) {// error, cannot use Select Mode without select buffer
|
||||
errorShim(GL_INVALID_OPERATION);
|
||||
return 0;
|
||||
}
|
||||
state.selectbuf.count = 0;
|
||||
state.selectbuf.pos = 0;
|
||||
state.selectbuf.overflow = 0;
|
||||
state.selectbuf.zmin = 1.0f;
|
||||
state.selectbuf.zmax = 0.0f;
|
||||
state.selectbuf.hit = 0;
|
||||
glstate.selectbuf.count = 0;
|
||||
glstate.selectbuf.pos = 0;
|
||||
glstate.selectbuf.overflow = 0;
|
||||
glstate.selectbuf.zmin = 1.0f;
|
||||
glstate.selectbuf.zmax = 0.0f;
|
||||
glstate.selectbuf.hit = 0;
|
||||
}
|
||||
|
||||
if((mode==GL_SELECT) && (state.gl_batch)) {
|
||||
state.gl_batch = 0;
|
||||
if((mode==GL_SELECT) && (glstate.gl_batch)) {
|
||||
glstate.gl_batch = 0;
|
||||
flush();
|
||||
}
|
||||
if((mode==GL_RENDER) && (state.gl_batch==0) && (gl_batch==1)) {
|
||||
state.gl_batch = 1;
|
||||
if((mode==GL_RENDER) && (glstate.gl_batch==0) && (gl_batch==1)) {
|
||||
glstate.gl_batch = 1;
|
||||
flush();
|
||||
}
|
||||
|
||||
state.render_mode = mode;
|
||||
glstate.render_mode = mode;
|
||||
return ret;
|
||||
}
|
||||
|
||||
void glInitNames() {
|
||||
if (state.namestack.names == 0) {
|
||||
state.namestack.names = (GLuint*)malloc(1024*sizeof(GLuint));
|
||||
void glshim_glInitNames() {
|
||||
if (glstate.namestack.names == 0) {
|
||||
glstate.namestack.names = (GLuint*)malloc(1024*sizeof(GLuint));
|
||||
}
|
||||
state.namestack.top = 0;
|
||||
glstate.namestack.top = 0;
|
||||
noerrorShim();
|
||||
}
|
||||
|
||||
void glPopName() {
|
||||
void glshim_glPopName() {
|
||||
noerrorShim();
|
||||
if (state.render_mode != GL_SELECT)
|
||||
if (glstate.render_mode != GL_SELECT)
|
||||
return;
|
||||
push_hit();
|
||||
if (state.namestack.top>0)
|
||||
state.namestack.top--;
|
||||
if (glstate.namestack.top>0)
|
||||
glstate.namestack.top--;
|
||||
else
|
||||
errorShim(GL_STACK_UNDERFLOW);
|
||||
}
|
||||
|
||||
void glPushName(GLuint name) {
|
||||
void glshim_glPushName(GLuint name) {
|
||||
noerrorShim();
|
||||
if (state.render_mode != GL_SELECT)
|
||||
if (glstate.render_mode != GL_SELECT)
|
||||
return;
|
||||
if (state.namestack.names==0)
|
||||
if (glstate.namestack.names==0)
|
||||
return;
|
||||
push_hit();
|
||||
if (state.namestack.top < 1024) {
|
||||
state.namestack.names[state.namestack.top++] = name;
|
||||
if (glstate.namestack.top < 1024) {
|
||||
glstate.namestack.names[glstate.namestack.top++] = name;
|
||||
}
|
||||
}
|
||||
|
||||
void glLoadName(GLuint name) {
|
||||
void glshim_glLoadName(GLuint name) {
|
||||
noerrorShim();
|
||||
if (state.render_mode != GL_SELECT)
|
||||
if (glstate.render_mode != GL_SELECT)
|
||||
return;
|
||||
if (state.namestack.names == 0)
|
||||
if (glstate.namestack.names == 0)
|
||||
return;
|
||||
push_hit();
|
||||
if (state.namestack.top == 0)
|
||||
if (glstate.namestack.top == 0)
|
||||
return;
|
||||
state.namestack.names[state.namestack.top-1] = name;
|
||||
glstate.namestack.names[glstate.namestack.top-1] = name;
|
||||
}
|
||||
|
||||
void glSelectBuffer(GLsizei size, GLuint *buffer) {
|
||||
void glshim_glSelectBuffer(GLsizei size, GLuint *buffer) {
|
||||
noerrorShim();
|
||||
state.selectbuf.buffer = buffer;
|
||||
state.selectbuf.size = size;
|
||||
glstate.selectbuf.buffer = buffer;
|
||||
glstate.selectbuf.size = size;
|
||||
}
|
||||
|
||||
GLfloat projection[16], modelview[16];
|
||||
@@ -123,9 +123,9 @@ void init_select() {
|
||||
Initialize matrix and array vector for a select_Draw*
|
||||
*/
|
||||
GLfloat tmp[16];
|
||||
glGetFloatv(GL_PROJECTION_MATRIX, tmp);
|
||||
glshim_glGetFloatv(GL_PROJECTION_MATRIX, tmp);
|
||||
matrix_column_row(tmp, projection);
|
||||
glGetFloatv(GL_MODELVIEW_MATRIX, tmp);
|
||||
glshim_glGetFloatv(GL_MODELVIEW_MATRIX, tmp);
|
||||
matrix_column_row(tmp, modelview);
|
||||
}
|
||||
|
||||
@@ -221,7 +221,7 @@ GLboolean select_triangle_in_viewscreen(const GLfloat *a, const GLfloat *b, cons
|
||||
void select_glDrawArrays(const pointer_state_t* vtx, GLenum mode, GLuint first, GLuint count) {
|
||||
if (count == 0) return;
|
||||
if (vtx->pointer == NULL) return;
|
||||
if (state.selectbuf.buffer == NULL) return;
|
||||
if (glstate.selectbuf.buffer == NULL) return;
|
||||
GLfloat *vert = copy_gl_array(vtx->pointer, vtx->type,
|
||||
vtx->size, vtx->stride,
|
||||
GL_FLOAT, 3, 0, count+first);
|
||||
@@ -230,9 +230,9 @@ void select_glDrawArrays(const pointer_state_t* vtx, GLenum mode, GLuint first,
|
||||
init_select();
|
||||
|
||||
#define FOUND() { \
|
||||
if (zmin<state.selectbuf.zmin) state.selectbuf.zmin=zmin; \
|
||||
if (zmax>state.selectbuf.zmax) state.selectbuf.zmax=zmax; \
|
||||
state.selectbuf.hit = 1; \
|
||||
if (zmin<glstate.selectbuf.zmin) glstate.selectbuf.zmin=zmin; \
|
||||
if (zmax>glstate.selectbuf.zmax) glstate.selectbuf.zmax=zmax; \
|
||||
glstate.selectbuf.hit = 1; \
|
||||
free(vert); \
|
||||
return; \
|
||||
}
|
||||
@@ -313,9 +313,9 @@ void select_glDrawElements(const pointer_state_t* vtx, GLenum mode, GLuint count
|
||||
if (zmax>1.0f) zmax = 1.0f;
|
||||
|
||||
#define FOUND() { \
|
||||
if (zmin<state.selectbuf.zmin) state.selectbuf.zmin=zmin; \
|
||||
if (zmax>state.selectbuf.zmax) state.selectbuf.zmax=zmax; \
|
||||
state.selectbuf.hit = 1; \
|
||||
if (zmin<glstate.selectbuf.zmin) glstate.selectbuf.zmin=zmin; \
|
||||
if (zmax>glstate.selectbuf.zmax) glstate.selectbuf.zmax=zmax; \
|
||||
glstate.selectbuf.hit = 1; \
|
||||
free(vert); \
|
||||
return; \
|
||||
}
|
||||
@@ -364,3 +364,11 @@ void select_glDrawElements(const pointer_state_t* vtx, GLenum mode, GLuint count
|
||||
free(vert);
|
||||
#undef FOUND
|
||||
}
|
||||
|
||||
//Direct wrapper
|
||||
GLint glRenderMode(GLenum mode) __attribute__((alias("glshim_glRenderMode")));
|
||||
void glInitNames() __attribute__((alias("glshim_glInitNames")));
|
||||
void glPopName() __attribute__((alias("glshim_glPopName")));
|
||||
void glPushName(GLuint name) __attribute__((alias("glshim_glPushName")));
|
||||
void glLoadName(GLuint name) __attribute__((alias("glshim_glLoadName")));
|
||||
void glSelectBuffer(GLsizei size, GLuint *buffer) __attribute__((alias("glshim_glSelectBuffer")));
|
||||
@@ -2,12 +2,12 @@
|
||||
#define RENDER_H
|
||||
#include "gl.h"
|
||||
|
||||
GLint glRenderMode(GLenum mode);
|
||||
void glInitNames();
|
||||
void glPopName();
|
||||
void glPushName(GLuint name);
|
||||
void glLoadName(GLuint name);
|
||||
void glSelectBuffer(GLsizei size, GLuint *buffer);
|
||||
GLint glshim_glRenderMode(GLenum mode);
|
||||
void glshim_glInitNames();
|
||||
void glshim_glPopName();
|
||||
void glshim_glPushName(GLuint name);
|
||||
void glshim_glLoadName(GLuint name);
|
||||
void glshim_glSelectBuffer(GLsizei size, GLuint *buffer);
|
||||
|
||||
void select_glDrawElements(const pointer_state_t* vtx, GLenum mode, GLuint count, GLenum type, GLvoid * indices);
|
||||
void select_glDrawArrays(const pointer_state_t* vtx, GLenum mode, GLuint first, GLuint count);
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
glstack_t *stack = NULL;
|
||||
glclientstack_t *clientStack = NULL;
|
||||
|
||||
void glPushAttrib(GLbitfield mask) {
|
||||
void glshim_glPushAttrib(GLbitfield mask) {
|
||||
//printf("glPushAttrib(0x%04X)\n", mask);
|
||||
noerrorShim();
|
||||
if ((state.list.compiling || state.gl_batch) && state.list.active) {
|
||||
NewStage(state.list.active, STAGE_PUSH);
|
||||
state.list.active->pushattribute = mask;
|
||||
if ((glstate.list.compiling || glstate.gl_batch) && glstate.list.active) {
|
||||
NewStage(glstate.list.active, STAGE_PUSH);
|
||||
glstate.list.active->pushattribute = mask;
|
||||
return;
|
||||
}
|
||||
if (stack == NULL) {
|
||||
@@ -31,90 +31,90 @@ void glPushAttrib(GLbitfield mask) {
|
||||
|
||||
// TODO: will tracking these myself be much faster than glGet?
|
||||
if (mask & GL_COLOR_BUFFER_BIT) {
|
||||
cur->alpha_test = glIsEnabled(GL_ALPHA_TEST);
|
||||
glGetIntegerv(GL_ALPHA_TEST_FUNC, &cur->alpha_test_func);
|
||||
glGetFloatv(GL_ALPHA_TEST_REF, &cur->alpha_test_ref);
|
||||
cur->alpha_test = glshim_glIsEnabled(GL_ALPHA_TEST);
|
||||
glshim_glGetIntegerv(GL_ALPHA_TEST_FUNC, &cur->alpha_test_func);
|
||||
glshim_glGetFloatv(GL_ALPHA_TEST_REF, &cur->alpha_test_ref);
|
||||
|
||||
cur->blend = glIsEnabled(GL_BLEND);
|
||||
glGetIntegerv(GL_BLEND_SRC, &cur->blend_src_func);
|
||||
glGetIntegerv(GL_BLEND_DST, &cur->blend_dst_func);
|
||||
cur->blend = glshim_glIsEnabled(GL_BLEND);
|
||||
glshim_glGetIntegerv(GL_BLEND_SRC, &cur->blend_src_func);
|
||||
glshim_glGetIntegerv(GL_BLEND_DST, &cur->blend_dst_func);
|
||||
|
||||
cur->dither = glIsEnabled(GL_DITHER);
|
||||
cur->color_logic_op = glIsEnabled(GL_COLOR_LOGIC_OP);
|
||||
glGetIntegerv(GL_LOGIC_OP_MODE, &cur->logic_op);
|
||||
cur->dither = glshim_glIsEnabled(GL_DITHER);
|
||||
cur->color_logic_op = glshim_glIsEnabled(GL_COLOR_LOGIC_OP);
|
||||
glshim_glGetIntegerv(GL_LOGIC_OP_MODE, &cur->logic_op);
|
||||
|
||||
glGetFloatv(GL_COLOR_CLEAR_VALUE, cur->clear_color);
|
||||
glGetFloatv(GL_COLOR_WRITEMASK, cur->color_mask);
|
||||
glshim_glGetFloatv(GL_COLOR_CLEAR_VALUE, cur->clear_color);
|
||||
glshim_glGetFloatv(GL_COLOR_WRITEMASK, cur->color_mask);
|
||||
}
|
||||
|
||||
if (mask & GL_CURRENT_BIT) {
|
||||
glGetFloatv(GL_CURRENT_COLOR, cur->color);
|
||||
glGetFloatv(GL_CURRENT_NORMAL, cur->normal);
|
||||
glGetFloatv(GL_CURRENT_TEXTURE_COORDS, cur->tex);
|
||||
glshim_glGetFloatv(GL_CURRENT_COLOR, cur->color);
|
||||
glshim_glGetFloatv(GL_CURRENT_NORMAL, cur->normal);
|
||||
glshim_glGetFloatv(GL_CURRENT_TEXTURE_COORDS, cur->tex);
|
||||
}
|
||||
|
||||
if (mask & GL_DEPTH_BUFFER_BIT) {
|
||||
cur->depth_test = glIsEnabled(GL_DEPTH_TEST);
|
||||
glGetIntegerv(GL_DEPTH_FUNC, &cur->depth_func);
|
||||
glGetFloatv(GL_DEPTH_CLEAR_VALUE, &cur->clear_depth);
|
||||
glGetIntegerv(GL_DEPTH_WRITEMASK, &cur->depth_mask);
|
||||
cur->depth_test = glshim_glIsEnabled(GL_DEPTH_TEST);
|
||||
glshim_glGetIntegerv(GL_DEPTH_FUNC, &cur->depth_func);
|
||||
glshim_glGetFloatv(GL_DEPTH_CLEAR_VALUE, &cur->clear_depth);
|
||||
glshim_glGetIntegerv(GL_DEPTH_WRITEMASK, &cur->depth_mask);
|
||||
}
|
||||
|
||||
if (mask & GL_ENABLE_BIT) {
|
||||
int i;
|
||||
GLint max_clip_planes;
|
||||
|
||||
cur->alpha_test = glIsEnabled(GL_ALPHA_TEST);
|
||||
cur->autonormal = glIsEnabled(GL_AUTO_NORMAL);
|
||||
cur->blend = glIsEnabled(GL_BLEND);
|
||||
cur->alpha_test = glshim_glIsEnabled(GL_ALPHA_TEST);
|
||||
cur->autonormal = glshim_glIsEnabled(GL_AUTO_NORMAL);
|
||||
cur->blend = glshim_glIsEnabled(GL_BLEND);
|
||||
|
||||
glGetIntegerv(GL_MAX_CLIP_PLANES, &max_clip_planes);
|
||||
glshim_glGetIntegerv(GL_MAX_CLIP_PLANES, &max_clip_planes);
|
||||
cur->clip_planes_enabled = (GLboolean *)malloc(max_clip_planes * sizeof(GLboolean));
|
||||
for (i = 0; i < max_clip_planes; i++) {
|
||||
*(cur->clip_planes_enabled + i) = glIsEnabled(GL_CLIP_PLANE0 + i);
|
||||
*(cur->clip_planes_enabled + i) = glshim_glIsEnabled(GL_CLIP_PLANE0 + i);
|
||||
}
|
||||
|
||||
cur->colormaterial = glIsEnabled(GL_COLOR_MATERIAL);
|
||||
cur->cull_face = glIsEnabled(GL_CULL_FACE);
|
||||
cur->depth_test = glIsEnabled(GL_DEPTH_TEST);
|
||||
cur->dither = glIsEnabled(GL_DITHER);
|
||||
cur->fog = glIsEnabled(GL_FOG);
|
||||
cur->colormaterial = glshim_glIsEnabled(GL_COLOR_MATERIAL);
|
||||
cur->cull_face = glshim_glIsEnabled(GL_CULL_FACE);
|
||||
cur->depth_test = glshim_glIsEnabled(GL_DEPTH_TEST);
|
||||
cur->dither = glshim_glIsEnabled(GL_DITHER);
|
||||
cur->fog = glshim_glIsEnabled(GL_FOG);
|
||||
|
||||
GLint max_lights;
|
||||
glGetIntegerv(GL_MAX_LIGHTS, &max_lights);
|
||||
glshim_glGetIntegerv(GL_MAX_LIGHTS, &max_lights);
|
||||
cur->lights_enabled = (GLboolean *)malloc(max_lights * sizeof(GLboolean));
|
||||
for (i = 0; i < max_lights; i++) {
|
||||
*(cur->lights_enabled + i) = glIsEnabled(GL_LIGHT0 + i);
|
||||
*(cur->lights_enabled + i) = glshim_glIsEnabled(GL_LIGHT0 + i);
|
||||
}
|
||||
|
||||
cur->lighting = glIsEnabled(GL_LIGHTING);
|
||||
cur->line_smooth = glIsEnabled(GL_LINE_SMOOTH);
|
||||
cur->line_stipple = glIsEnabled(GL_LINE_STIPPLE);
|
||||
cur->color_logic_op = glIsEnabled(GL_COLOR_LOGIC_OP);
|
||||
cur->lighting = glshim_glIsEnabled(GL_LIGHTING);
|
||||
cur->line_smooth = glshim_glIsEnabled(GL_LINE_SMOOTH);
|
||||
cur->line_stipple = glshim_glIsEnabled(GL_LINE_STIPPLE);
|
||||
cur->color_logic_op = glshim_glIsEnabled(GL_COLOR_LOGIC_OP);
|
||||
//TODO: GL_INDEX_LOGIC_OP
|
||||
//TODO: GL_MAP1_x
|
||||
//TODO: GL_MAP2_x
|
||||
cur->multisample = glIsEnabled(GL_MULTISAMPLE);
|
||||
cur->normalize = glIsEnabled(GL_NORMALIZE);
|
||||
cur->point_smooth = glIsEnabled(GL_POINT_SMOOTH);
|
||||
cur->multisample = glshim_glIsEnabled(GL_MULTISAMPLE);
|
||||
cur->normalize = glshim_glIsEnabled(GL_NORMALIZE);
|
||||
cur->point_smooth = glshim_glIsEnabled(GL_POINT_SMOOTH);
|
||||
//TODO: GL_POLYGON_OFFSET_LINE
|
||||
cur->polygon_offset_fill = glIsEnabled(GL_POLYGON_OFFSET_FILL);
|
||||
cur->polygon_offset_fill = glshim_glIsEnabled(GL_POLYGON_OFFSET_FILL);
|
||||
//TODO: GL_POLYGON_OFFSET_POINT
|
||||
//TODO: GL_POLYGON_SMOOTH
|
||||
//TODO: GL_POLYGON_STIPPLE
|
||||
cur->sample_alpha_to_coverage = glIsEnabled(GL_SAMPLE_ALPHA_TO_COVERAGE);
|
||||
cur->sample_alpha_to_one = glIsEnabled(GL_SAMPLE_ALPHA_TO_ONE);
|
||||
cur->sample_coverage = glIsEnabled(GL_SAMPLE_COVERAGE);
|
||||
cur->scissor_test = glIsEnabled(GL_SCISSOR_TEST);
|
||||
cur->stencil_test = glIsEnabled(GL_STENCIL_TEST);
|
||||
cur->sample_alpha_to_coverage = glshim_glIsEnabled(GL_SAMPLE_ALPHA_TO_COVERAGE);
|
||||
cur->sample_alpha_to_one = glshim_glIsEnabled(GL_SAMPLE_ALPHA_TO_ONE);
|
||||
cur->sample_coverage = glshim_glIsEnabled(GL_SAMPLE_COVERAGE);
|
||||
cur->scissor_test = glshim_glIsEnabled(GL_SCISSOR_TEST);
|
||||
cur->stencil_test = glshim_glIsEnabled(GL_STENCIL_TEST);
|
||||
int a;
|
||||
for (a=0; a<MAX_TEX; a++) {
|
||||
cur->texture_1d[a] = state.enable.texture_1d[a];
|
||||
cur->texture_2d[a] = state.enable.texture_2d[a];
|
||||
cur->texture_3d[a] = state.enable.texture_3d[a];
|
||||
cur->texgen_s[a] = state.enable.texgen_s[a];
|
||||
cur->texgen_r[a] = state.enable.texgen_r[a];
|
||||
cur->texgen_t[a] = state.enable.texgen_t[a];
|
||||
cur->texture_1d[a] = glstate.enable.texture_1d[a];
|
||||
cur->texture_2d[a] = glstate.enable.texture_2d[a];
|
||||
cur->texture_3d[a] = glstate.enable.texture_3d[a];
|
||||
cur->texgen_s[a] = glstate.enable.texgen_s[a];
|
||||
cur->texgen_r[a] = glstate.enable.texgen_r[a];
|
||||
cur->texgen_t[a] = glstate.enable.texgen_t[a];
|
||||
}
|
||||
|
||||
}
|
||||
@@ -122,57 +122,57 @@ void glPushAttrib(GLbitfield mask) {
|
||||
// TODO: GL_EVAL_BIT
|
||||
|
||||
if (mask & GL_FOG_BIT) {
|
||||
cur->fog = glIsEnabled(GL_FOG);
|
||||
glGetFloatv(GL_FOG_COLOR, cur->fog_color);
|
||||
glGetFloatv(GL_FOG_DENSITY, &cur->fog_density);
|
||||
glGetFloatv(GL_FOG_START, &cur->fog_start);
|
||||
glGetFloatv(GL_FOG_END, &cur->fog_end);
|
||||
glGetIntegerv(GL_FOG_MODE, &cur->fog_mode);
|
||||
cur->fog = glshim_glIsEnabled(GL_FOG);
|
||||
glshim_glGetFloatv(GL_FOG_COLOR, cur->fog_color);
|
||||
glshim_glGetFloatv(GL_FOG_DENSITY, &cur->fog_density);
|
||||
glshim_glGetFloatv(GL_FOG_START, &cur->fog_start);
|
||||
glshim_glGetFloatv(GL_FOG_END, &cur->fog_end);
|
||||
glshim_glGetIntegerv(GL_FOG_MODE, &cur->fog_mode);
|
||||
}
|
||||
|
||||
if (mask & GL_HINT_BIT) {
|
||||
glGetIntegerv(GL_PERSPECTIVE_CORRECTION_HINT, &cur->perspective_hint);
|
||||
glGetIntegerv(GL_POINT_SMOOTH_HINT, &cur->point_smooth_hint);
|
||||
glGetIntegerv(GL_LINE_SMOOTH_HINT, &cur->line_smooth_hint);
|
||||
glGetIntegerv(GL_FOG_HINT, &cur->fog_hint);
|
||||
glGetIntegerv(GL_GENERATE_MIPMAP_HINT, &cur->mipmap_hint);
|
||||
glshim_glGetIntegerv(GL_PERSPECTIVE_CORRECTION_HINT, &cur->perspective_hint);
|
||||
glshim_glGetIntegerv(GL_POINT_SMOOTH_HINT, &cur->point_smooth_hint);
|
||||
glshim_glGetIntegerv(GL_LINE_SMOOTH_HINT, &cur->line_smooth_hint);
|
||||
glshim_glGetIntegerv(GL_FOG_HINT, &cur->fog_hint);
|
||||
glshim_glGetIntegerv(GL_GENERATE_MIPMAP_HINT, &cur->mipmap_hint);
|
||||
}
|
||||
|
||||
if (mask & GL_LIGHTING_BIT) {
|
||||
cur->lighting = glIsEnabled(GL_LIGHTING);
|
||||
glGetIntegerv(GL_LIGHT_MODEL_AMBIENT, cur->light_model_ambient);
|
||||
glGetIntegerv(GL_LIGHT_MODEL_TWO_SIDE, &cur->light_model_two_side);
|
||||
cur->lighting = glshim_glIsEnabled(GL_LIGHTING);
|
||||
glshim_glGetIntegerv(GL_LIGHT_MODEL_AMBIENT, cur->light_model_ambient);
|
||||
glshim_glGetIntegerv(GL_LIGHT_MODEL_TWO_SIDE, &cur->light_model_two_side);
|
||||
|
||||
int i;
|
||||
GLint max_lights;
|
||||
glGetIntegerv(GL_MAX_LIGHTS, &max_lights);
|
||||
glshim_glGetIntegerv(GL_MAX_LIGHTS, &max_lights);
|
||||
cur->lights_enabled = (GLboolean *)malloc(max_lights * sizeof(GLboolean));
|
||||
cur->lights = (GLfloat *)malloc(max_lights * sizeof(GLfloat));
|
||||
for (i = 0; i < max_lights; i++) {
|
||||
*(cur->lights_enabled + i) = glIsEnabled(GL_LIGHT0 + i);
|
||||
*(cur->lights_enabled + i) = glshim_glIsEnabled(GL_LIGHT0 + i);
|
||||
/* TODO: record all data about the lights
|
||||
glGetFloatv(GL_LIGHT0 + i, cur->lights + i);
|
||||
*/
|
||||
}
|
||||
glGetIntegerv(GL_SHADE_MODEL, &cur->shade_model);
|
||||
glshim_glGetIntegerv(GL_SHADE_MODEL, &cur->shade_model);
|
||||
}
|
||||
|
||||
if (mask & GL_LINE_BIT) {
|
||||
cur->line_smooth = glIsEnabled(GL_LINE_SMOOTH);
|
||||
cur->line_smooth = glshim_glIsEnabled(GL_LINE_SMOOTH);
|
||||
// TODO: stipple stuff here
|
||||
glGetFloatv(GL_LINE_WIDTH, &cur->line_width);
|
||||
glshim_glGetFloatv(GL_LINE_WIDTH, &cur->line_width);
|
||||
}
|
||||
|
||||
// GL_LIST_BIT
|
||||
if (mask & GL_LIST_BIT) {
|
||||
cur->list_base = state.list.base;
|
||||
cur->list_base = glstate.list.base;
|
||||
}
|
||||
|
||||
if (mask & GL_MULTISAMPLE_BIT) {
|
||||
cur->multisample = glIsEnabled(GL_MULTISAMPLE);
|
||||
cur->sample_alpha_to_coverage = glIsEnabled(GL_SAMPLE_ALPHA_TO_COVERAGE);
|
||||
cur->sample_alpha_to_one = glIsEnabled(GL_SAMPLE_ALPHA_TO_ONE);
|
||||
cur->sample_coverage = glIsEnabled(GL_SAMPLE_COVERAGE);
|
||||
cur->multisample = glshim_glIsEnabled(GL_MULTISAMPLE);
|
||||
cur->sample_alpha_to_coverage = glshim_glIsEnabled(GL_SAMPLE_ALPHA_TO_COVERAGE);
|
||||
cur->sample_alpha_to_one = glshim_glIsEnabled(GL_SAMPLE_ALPHA_TO_ONE);
|
||||
cur->sample_coverage = glshim_glIsEnabled(GL_SAMPLE_COVERAGE);
|
||||
}
|
||||
|
||||
// GL_PIXEL_MODE_BIT
|
||||
@@ -180,54 +180,54 @@ void glPushAttrib(GLbitfield mask) {
|
||||
GLenum pixel_name[] = {GL_RED_BIAS, GL_RED_SCALE, GL_GREEN_BIAS, GL_GREEN_SCALE, GL_BLUE_BIAS, GL_BLUE_SCALE, GL_ALPHA_BIAS, GL_ALPHA_SCALE};
|
||||
int i;
|
||||
for (i=0; i<8; i++)
|
||||
glGetFloatv(pixel_name[i], &cur->pixel_scale_bias[i]);
|
||||
glshim_glGetFloatv(pixel_name[i], &cur->pixel_scale_bias[i]);
|
||||
//TODO: GL_DEPTH_BIAS & GL_DEPTH_SCALE (probably difficult)
|
||||
//TODO: GL_INDEX_OFFEST & GL_INDEX_SHIFT
|
||||
//TODO: GL_MAP_COLOR & GL_MAP_STENCIL (probably difficult too)
|
||||
glGetFloatv(GL_ZOOM_X, &cur->pixel_zoomx);
|
||||
glGetFloatv(GL_ZOOM_Y, &cur->pixel_zoomy);
|
||||
glshim_glGetFloatv(GL_ZOOM_X, &cur->pixel_zoomx);
|
||||
glshim_glGetFloatv(GL_ZOOM_Y, &cur->pixel_zoomy);
|
||||
}
|
||||
|
||||
if (mask & GL_POINT_BIT) {
|
||||
cur->point_smooth = glIsEnabled(GL_POINT_SMOOTH);
|
||||
glGetFloatv(GL_POINT_SIZE, &cur->point_size);
|
||||
cur->point_smooth = glshim_glIsEnabled(GL_POINT_SMOOTH);
|
||||
glshim_glGetFloatv(GL_POINT_SIZE, &cur->point_size);
|
||||
}
|
||||
|
||||
// TODO: GL_POLYGON_BIT
|
||||
// TODO: GL_POLYGON_STIPPLE_BIT
|
||||
|
||||
if (mask & GL_SCISSOR_BIT) {
|
||||
cur->scissor_test = glIsEnabled(GL_SCISSOR_TEST);
|
||||
glGetFloatv(GL_SCISSOR_BOX, cur->scissor_box);
|
||||
cur->scissor_test = glshim_glIsEnabled(GL_SCISSOR_TEST);
|
||||
glshim_glGetFloatv(GL_SCISSOR_BOX, cur->scissor_box);
|
||||
}
|
||||
|
||||
// TODO: GL_STENCIL_BUFFER_BIT
|
||||
if (mask & GL_STENCIL_BUFFER_BIT) {
|
||||
cur->stencil_test = glIsEnabled(GL_STENCIL_TEST);
|
||||
glGetIntegerv(GL_STENCIL_FUNC, &cur->stencil_func);
|
||||
glGetIntegerv(GL_STENCIL_VALUE_MASK, &cur->stencil_mask);
|
||||
glGetIntegerv(GL_STENCIL_REF, &cur->stencil_ref);
|
||||
cur->stencil_test = glshim_glIsEnabled(GL_STENCIL_TEST);
|
||||
glshim_glGetIntegerv(GL_STENCIL_FUNC, &cur->stencil_func);
|
||||
glshim_glGetIntegerv(GL_STENCIL_VALUE_MASK, &cur->stencil_mask);
|
||||
glshim_glGetIntegerv(GL_STENCIL_REF, &cur->stencil_ref);
|
||||
//TODO: glStencilFuncSeperate
|
||||
|
||||
//TODO: Stencil value mask
|
||||
glGetIntegerv(GL_STENCIL_FAIL, &cur->stencil_sfail);
|
||||
glGetIntegerv(GL_STENCIL_PASS_DEPTH_FAIL, &cur->stencil_dpfail);
|
||||
glGetIntegerv(GL_STENCIL_PASS_DEPTH_PASS, &cur->stencil_dppass);
|
||||
glshim_glGetIntegerv(GL_STENCIL_FAIL, &cur->stencil_sfail);
|
||||
glshim_glGetIntegerv(GL_STENCIL_PASS_DEPTH_FAIL, &cur->stencil_dpfail);
|
||||
glshim_glGetIntegerv(GL_STENCIL_PASS_DEPTH_PASS, &cur->stencil_dppass);
|
||||
//TODO: glStencilOpSeparate
|
||||
|
||||
glGetIntegerv(GL_STENCIL_CLEAR_VALUE, &cur->stencil_clearvalue);
|
||||
glshim_glGetIntegerv(GL_STENCIL_CLEAR_VALUE, &cur->stencil_clearvalue);
|
||||
//TODO: Stencil buffer writemask
|
||||
}
|
||||
// GL_TEXTURE_BIT - TODO: incomplete
|
||||
if (mask & GL_TEXTURE_BIT) {
|
||||
cur->active=state.texture.active;
|
||||
cur->active=glstate.texture.active;
|
||||
int a;
|
||||
for (a=0; a<MAX_TEX; a++) {
|
||||
cur->texgen_r[a] = state.enable.texgen_r[a];
|
||||
cur->texgen_s[a] = state.enable.texgen_s[a];
|
||||
cur->texgen_t[a] = state.enable.texgen_t[a];
|
||||
cur->texgen[a] = state.texgen[a]; // all mode and planes per texture in 1 line
|
||||
cur->texture[a] = (state.texture.bound[a])?state.texture.bound[a]->texture:0;
|
||||
cur->texgen_r[a] = glstate.enable.texgen_r[a];
|
||||
cur->texgen_s[a] = glstate.enable.texgen_s[a];
|
||||
cur->texgen_t[a] = glstate.enable.texgen_t[a];
|
||||
cur->texgen[a] = glstate.texgen[a]; // all mode and planes per texture in 1 line
|
||||
cur->texture[a] = (glstate.texture.bound[a])?glstate.texture.bound[a]->texture:0;
|
||||
}
|
||||
//glActiveTexture(GL_TEXTURE0+cur->active);
|
||||
}
|
||||
@@ -237,26 +237,26 @@ void glPushAttrib(GLbitfield mask) {
|
||||
if (!(mask & GL_ENABLE_BIT)) {
|
||||
int i;
|
||||
GLint max_clip_planes;
|
||||
glGetIntegerv(GL_MAX_CLIP_PLANES, &max_clip_planes);
|
||||
glshim_glGetIntegerv(GL_MAX_CLIP_PLANES, &max_clip_planes);
|
||||
cur->clip_planes_enabled = (GLboolean *)malloc(max_clip_planes * sizeof(GLboolean));
|
||||
for (i = 0; i < max_clip_planes; i++) {
|
||||
*(cur->clip_planes_enabled + i) = glIsEnabled(GL_CLIP_PLANE0 + i);
|
||||
*(cur->clip_planes_enabled + i) = glshim_glIsEnabled(GL_CLIP_PLANE0 + i);
|
||||
}
|
||||
}
|
||||
glGetIntegerv(GL_MATRIX_MODE, &cur->matrix_mode);
|
||||
cur->rescale_normal_flag = glIsEnabled(GL_RESCALE_NORMAL);
|
||||
cur->normalize_flag = glIsEnabled(GL_NORMALIZE);
|
||||
glshim_glGetIntegerv(GL_MATRIX_MODE, &cur->matrix_mode);
|
||||
cur->rescale_normal_flag = glshim_glIsEnabled(GL_RESCALE_NORMAL);
|
||||
cur->normalize_flag = glshim_glIsEnabled(GL_NORMALIZE);
|
||||
}
|
||||
// GL_VIEWPORT_BIT
|
||||
if (mask & GL_VIEWPORT_BIT) {
|
||||
glGetIntegerv(GL_VIEWPORT, cur->viewport_size);
|
||||
glGetFloatv(GL_DEPTH_RANGE, cur->depth_range);
|
||||
glshim_glGetIntegerv(GL_VIEWPORT, cur->viewport_size);
|
||||
glshim_glGetFloatv(GL_DEPTH_RANGE, cur->depth_range);
|
||||
}
|
||||
|
||||
stack->len++;
|
||||
}
|
||||
|
||||
void glPushClientAttrib(GLbitfield mask) {
|
||||
void glshim_glPushClientAttrib(GLbitfield mask) {
|
||||
noerrorShim();
|
||||
if (clientStack == NULL) {
|
||||
clientStack = (glclientstack_t *)malloc(STACK_SIZE * sizeof(glclientstack_t));
|
||||
@@ -271,27 +271,27 @@ void glPushClientAttrib(GLbitfield mask) {
|
||||
cur->mask = mask;
|
||||
|
||||
if (mask & GL_CLIENT_PIXEL_STORE_BIT) {
|
||||
glGetIntegerv(GL_PACK_ALIGNMENT, &cur->pack_align);
|
||||
glGetIntegerv(GL_UNPACK_ALIGNMENT, &cur->unpack_align);
|
||||
cur->unpack_row_length = state.texture.unpack_row_length;
|
||||
cur->unpack_skip_pixels = state.texture.unpack_skip_pixels;
|
||||
cur->unpack_skip_rows = state.texture.unpack_skip_rows;
|
||||
cur->pack_row_length = state.texture.pack_row_length;
|
||||
cur->pack_skip_pixels = state.texture.pack_skip_pixels;
|
||||
cur->pack_skip_rows = state.texture.pack_skip_rows;
|
||||
glshim_glGetIntegerv(GL_PACK_ALIGNMENT, &cur->pack_align);
|
||||
glshim_glGetIntegerv(GL_UNPACK_ALIGNMENT, &cur->unpack_align);
|
||||
cur->unpack_row_length = glstate.texture.unpack_row_length;
|
||||
cur->unpack_skip_pixels = glstate.texture.unpack_skip_pixels;
|
||||
cur->unpack_skip_rows = glstate.texture.unpack_skip_rows;
|
||||
cur->pack_row_length = glstate.texture.pack_row_length;
|
||||
cur->pack_skip_pixels = glstate.texture.pack_skip_pixels;
|
||||
cur->pack_skip_rows = glstate.texture.pack_skip_rows;
|
||||
}
|
||||
|
||||
if (mask & GL_CLIENT_VERTEX_ARRAY_BIT) {
|
||||
cur->vert_enable = state.vao->vertex_array;
|
||||
cur->color_enable = state.vao->color_array;
|
||||
cur->secondary_enable = state.vao->secondary_array;
|
||||
cur->normal_enable = state.vao->normal_array;
|
||||
cur->vert_enable = glstate.vao->vertex_array;
|
||||
cur->color_enable = glstate.vao->color_array;
|
||||
cur->secondary_enable = glstate.vao->secondary_array;
|
||||
cur->normal_enable = glstate.vao->normal_array;
|
||||
int a;
|
||||
for (a=0; a<MAX_TEX; a++) {
|
||||
cur->tex_enable[a] = state.vao->tex_coord_array[a];
|
||||
cur->tex_enable[a] = glstate.vao->tex_coord_array[a];
|
||||
}
|
||||
memcpy(&(cur->pointers), &state.vao->pointers, sizeof(pointer_states_t));
|
||||
cur->client = state.texture.client;
|
||||
memcpy(&(cur->pointers), &glstate.vao->pointers, sizeof(pointer_states_t));
|
||||
cur->client = glstate.texture.client;
|
||||
}
|
||||
|
||||
clientStack->len++;
|
||||
@@ -301,19 +301,19 @@ void glPushClientAttrib(GLbitfield mask) {
|
||||
if (x) free(x)
|
||||
|
||||
#define enable_disable(pname, enabled) \
|
||||
if (enabled) glEnable(pname); \
|
||||
else glDisable(pname)
|
||||
if (enabled) glshim_glEnable(pname); \
|
||||
else glshim_glDisable(pname)
|
||||
|
||||
#define v2(c) c[0], c[1]
|
||||
#define v3(c) v2(c), c[2]
|
||||
#define v4(c) v3(c), c[3]
|
||||
|
||||
void glPopAttrib() {
|
||||
void glshim_glPopAttrib() {
|
||||
//printf("glPopAttrib()\n");
|
||||
noerrorShim();
|
||||
if ((state.list.compiling || state.gl_batch) && state.list.active) {
|
||||
NewStage(state.list.active, STAGE_POP);
|
||||
state.list.active->popattribute = true;
|
||||
if ((glstate.list.compiling || glstate.gl_batch) && glstate.list.active) {
|
||||
NewStage(glstate.list.active, STAGE_POP);
|
||||
glstate.list.active->popattribute = true;
|
||||
return;
|
||||
}
|
||||
if (stack == NULL || stack->len == 0) {
|
||||
@@ -325,31 +325,31 @@ void glPopAttrib() {
|
||||
|
||||
if (cur->mask & GL_COLOR_BUFFER_BIT) {
|
||||
enable_disable(GL_ALPHA_TEST, cur->alpha_test);
|
||||
glAlphaFunc(cur->alpha_test_func, cur->alpha_test_ref);
|
||||
glshim_glAlphaFunc(cur->alpha_test_func, cur->alpha_test_ref);
|
||||
|
||||
enable_disable(GL_BLEND, cur->blend);
|
||||
glBlendFunc(cur->blend_src_func, cur->blend_dst_func);
|
||||
glshim_glBlendFunc(cur->blend_src_func, cur->blend_dst_func);
|
||||
|
||||
enable_disable(GL_DITHER, cur->dither);
|
||||
enable_disable(GL_COLOR_LOGIC_OP, cur->color_logic_op);
|
||||
glLogicOp(cur->logic_op);
|
||||
glshim_glLogicOp(cur->logic_op);
|
||||
|
||||
GLfloat *c;
|
||||
glClearColor(v4(cur->clear_color));
|
||||
glColorMask(v4(cur->color_mask));
|
||||
glshim_glClearColor(v4(cur->clear_color));
|
||||
glshim_glColorMask(v4(cur->color_mask));
|
||||
}
|
||||
|
||||
if (cur->mask & GL_CURRENT_BIT) {
|
||||
glColor4f(v4(cur->color));
|
||||
glNormal3f(v3(cur->normal));
|
||||
glTexCoord4f(v4(cur->tex));
|
||||
glshim_glColor4f(v4(cur->color));
|
||||
glshim_glNormal3f(v3(cur->normal));
|
||||
glshim_glTexCoord4f(v4(cur->tex));
|
||||
}
|
||||
|
||||
if (cur->mask & GL_DEPTH_BUFFER_BIT) {
|
||||
enable_disable(GL_DEPTH_TEST, cur->depth_test);
|
||||
glDepthFunc(cur->depth_func);
|
||||
glClearDepth(cur->clear_depth);
|
||||
glDepthMask(cur->depth_mask);
|
||||
glshim_glDepthFunc(cur->depth_func);
|
||||
glshim_glClearDepth(cur->clear_depth);
|
||||
glshim_glDepthMask(cur->depth_mask);
|
||||
}
|
||||
|
||||
if (cur->mask & GL_ENABLE_BIT) {
|
||||
@@ -360,7 +360,7 @@ void glPopAttrib() {
|
||||
enable_disable(GL_BLEND, cur->blend);
|
||||
|
||||
GLint max_clip_planes;
|
||||
glGetIntegerv(GL_MAX_CLIP_PLANES, &max_clip_planes);
|
||||
glshim_glGetIntegerv(GL_MAX_CLIP_PLANES, &max_clip_planes);
|
||||
for (i = 0; i < max_clip_planes; i++) {
|
||||
enable_disable(GL_CLIP_PLANE0 + i, *(cur->clip_planes_enabled + i));
|
||||
}
|
||||
@@ -372,7 +372,7 @@ void glPopAttrib() {
|
||||
enable_disable(GL_FOG, cur->fog);
|
||||
|
||||
GLint max_lights;
|
||||
glGetIntegerv(GL_MAX_LIGHTS, &max_lights);
|
||||
glshim_glGetIntegerv(GL_MAX_LIGHTS, &max_lights);
|
||||
for (i = 0; i < max_lights; i++) {
|
||||
enable_disable(GL_LIGHT0 + i, *(cur->lights_enabled + i));
|
||||
}
|
||||
@@ -398,34 +398,34 @@ void glPopAttrib() {
|
||||
enable_disable(GL_SCISSOR_TEST, cur->scissor_test);
|
||||
enable_disable(GL_STENCIL_TEST, cur->stencil_test);
|
||||
int a;
|
||||
int old_tex = state.texture.active;
|
||||
int old_tex = glstate.texture.active;
|
||||
for (a=0; a<MAX_TEX; a++) {
|
||||
if (state.enable.texture_1d[a] != cur->texture_1d[a]) {
|
||||
glActiveTexture(GL_TEXTURE0+a);
|
||||
if (glstate.enable.texture_1d[a] != cur->texture_1d[a]) {
|
||||
glshim_glActiveTexture(GL_TEXTURE0+a);
|
||||
enable_disable(GL_TEXTURE_1D, cur->texture_1d[a]);
|
||||
}
|
||||
if (state.enable.texture_2d[a] != cur->texture_2d[a]) {
|
||||
glActiveTexture(GL_TEXTURE0+a);
|
||||
if (glstate.enable.texture_2d[a] != cur->texture_2d[a]) {
|
||||
glshim_glActiveTexture(GL_TEXTURE0+a);
|
||||
enable_disable(GL_TEXTURE_2D, cur->texture_2d[a]);
|
||||
}
|
||||
if (state.enable.texture_3d[a] != cur->texture_3d[a]) {
|
||||
glActiveTexture(GL_TEXTURE0+a);
|
||||
if (glstate.enable.texture_3d[a] != cur->texture_3d[a]) {
|
||||
glshim_glActiveTexture(GL_TEXTURE0+a);
|
||||
enable_disable(GL_TEXTURE_3D, cur->texture_3d[a]);
|
||||
}
|
||||
state.enable.texgen_r[a] = cur->texgen_r[a];
|
||||
state.enable.texgen_s[a] = cur->texgen_s[a];
|
||||
state.enable.texgen_t[a] = cur->texgen_t[a];
|
||||
glstate.enable.texgen_r[a] = cur->texgen_r[a];
|
||||
glstate.enable.texgen_s[a] = cur->texgen_s[a];
|
||||
glstate.enable.texgen_t[a] = cur->texgen_t[a];
|
||||
}
|
||||
if (state.texture.active != old_tex) glActiveTexture(GL_TEXTURE0+old_tex);
|
||||
if (glstate.texture.active != old_tex) glshim_glActiveTexture(GL_TEXTURE0+old_tex);
|
||||
}
|
||||
|
||||
if (cur->mask & GL_FOG_BIT) {
|
||||
enable_disable(GL_FOG, cur->fog);
|
||||
glFogfv(GL_FOG_COLOR, cur->fog_color);
|
||||
glFogf(GL_FOG_DENSITY, cur->fog_density);
|
||||
glFogf(GL_FOG_START, cur->fog_start);
|
||||
glFogf(GL_FOG_END, cur->fog_end);
|
||||
glFogf(GL_FOG_MODE, cur->fog_mode);
|
||||
glshim_glFogfv(GL_FOG_COLOR, cur->fog_color);
|
||||
glshim_glFogf(GL_FOG_DENSITY, cur->fog_density);
|
||||
glshim_glFogf(GL_FOG_START, cur->fog_start);
|
||||
glshim_glFogf(GL_FOG_END, cur->fog_end);
|
||||
glshim_glFogf(GL_FOG_MODE, cur->fog_mode);
|
||||
}
|
||||
|
||||
if (cur->mask & GL_HINT_BIT) {
|
||||
@@ -437,13 +437,13 @@ void glPopAttrib() {
|
||||
}
|
||||
// GL_LIST_BIT
|
||||
if (cur->mask & GL_LIST_BIT) {
|
||||
glListBase(cur->list_base);
|
||||
glshim_glListBase(cur->list_base);
|
||||
}
|
||||
|
||||
if (cur->mask & GL_LINE_BIT) {
|
||||
enable_disable(GL_LINE_SMOOTH, cur->line_smooth);
|
||||
// TODO: stipple stuff here
|
||||
glLineWidth(cur->line_width);
|
||||
glshim_glLineWidth(cur->line_width);
|
||||
}
|
||||
|
||||
if (cur->mask & GL_MULTISAMPLE_BIT) {
|
||||
@@ -455,20 +455,20 @@ void glPopAttrib() {
|
||||
|
||||
if (cur->mask & GL_POINT_BIT) {
|
||||
enable_disable(GL_POINT_SMOOTH, cur->point_smooth);
|
||||
glPointSize(cur->point_size);
|
||||
glshim_glPointSize(cur->point_size);
|
||||
}
|
||||
|
||||
if (cur->mask & GL_SCISSOR_BIT) {
|
||||
enable_disable(GL_SCISSOR_TEST, cur->scissor_test);
|
||||
glScissor(v4(cur->scissor_box));
|
||||
glshim_glScissor(v4(cur->scissor_box));
|
||||
}
|
||||
|
||||
if (cur->mask & GL_STENCIL_BUFFER_BIT) {
|
||||
enable_disable(GL_STENCIL_TEST, cur->stencil_test);
|
||||
glStencilFunc(cur->stencil_func, cur->stencil_ref, cur->stencil_mask);
|
||||
glshim_glStencilFunc(cur->stencil_func, cur->stencil_ref, cur->stencil_mask);
|
||||
//TODO: Stencil value mask
|
||||
glStencilOp(cur->stencil_sfail, cur->stencil_dpfail, cur->stencil_dppass);
|
||||
glClearStencil(cur->stencil_clearvalue);
|
||||
glshim_glStencilOp(cur->stencil_sfail, cur->stencil_dpfail, cur->stencil_dppass);
|
||||
glshim_glClearStencil(cur->stencil_clearvalue);
|
||||
//TODO: Stencil buffer writemask
|
||||
}
|
||||
|
||||
@@ -476,46 +476,46 @@ void glPopAttrib() {
|
||||
int a;
|
||||
//TODO: Enable bit for the 4 texture coordinates
|
||||
for (a=0; a<MAX_TEX; a++) {
|
||||
state.enable.texgen_r[a] = cur->texgen_r[a];
|
||||
state.enable.texgen_s[a] = cur->texgen_s[a];
|
||||
state.enable.texgen_t[a] = cur->texgen_t[a];
|
||||
state.texgen[a] = cur->texgen[a]; // all mode and planes per texture in 1 line
|
||||
if ((cur->texture[a]==0 && state.texture.bound[a] != 0) || (cur->texture[a]!=0 && state.texture.bound[a]==0)) {
|
||||
glActiveTexture(GL_TEXTURE0+a);
|
||||
glBindTexture(GL_TEXTURE_2D, cur->texture[a]);
|
||||
glstate.enable.texgen_r[a] = cur->texgen_r[a];
|
||||
glstate.enable.texgen_s[a] = cur->texgen_s[a];
|
||||
glstate.enable.texgen_t[a] = cur->texgen_t[a];
|
||||
glstate.texgen[a] = cur->texgen[a]; // all mode and planes per texture in 1 line
|
||||
if ((cur->texture[a]==0 && glstate.texture.bound[a] != 0) || (cur->texture[a]!=0 && glstate.texture.bound[a]==0)) {
|
||||
glshim_glActiveTexture(GL_TEXTURE0+a);
|
||||
glshim_glBindTexture(GL_TEXTURE_2D, cur->texture[a]);
|
||||
}
|
||||
}
|
||||
if (state.texture.active!= cur->active) glActiveTexture(GL_TEXTURE0+cur->active);
|
||||
if (glstate.texture.active!= cur->active) glshim_glActiveTexture(GL_TEXTURE0+cur->active);
|
||||
}
|
||||
|
||||
if (cur->mask & GL_PIXEL_MODE_BIT) {
|
||||
GLenum pixel_name[] = {GL_RED_BIAS, GL_RED_SCALE, GL_GREEN_BIAS, GL_GREEN_SCALE, GL_BLUE_BIAS, GL_BLUE_SCALE, GL_ALPHA_BIAS, GL_ALPHA_SCALE};
|
||||
int i;
|
||||
for (i=0; i<8; i++)
|
||||
glPixelTransferf(pixel_name[i], cur->pixel_scale_bias[i]);
|
||||
glshim_glPixelTransferf(pixel_name[i], cur->pixel_scale_bias[i]);
|
||||
//TODO: GL_DEPTH_BIAS & GL_DEPTH_SCALE (probably difficult)
|
||||
//TODO: GL_INDEX_OFFEST & GL_INDEX_SHIFT
|
||||
//TODO: GL_MAP_COLOR & GL_MAP_STENCIL (probably difficult too)
|
||||
glPixelZoom(cur->pixel_zoomx, cur->pixel_zoomy);
|
||||
glshim_glPixelZoom(cur->pixel_zoomx, cur->pixel_zoomy);
|
||||
}
|
||||
|
||||
if (cur->mask & GL_TRANSFORM_BIT) {
|
||||
if (!(cur->mask & GL_ENABLE_BIT)) {
|
||||
int i;
|
||||
GLint max_clip_planes;
|
||||
glGetIntegerv(GL_MAX_CLIP_PLANES, &max_clip_planes);
|
||||
glshim_glGetIntegerv(GL_MAX_CLIP_PLANES, &max_clip_planes);
|
||||
for (i = 0; i < max_clip_planes; i++) {
|
||||
enable_disable(GL_CLIP_PLANE0 + i, *(cur->clip_planes_enabled + i));
|
||||
}
|
||||
}
|
||||
glMatrixMode(cur->matrix_mode);
|
||||
glshim_glMatrixMode(cur->matrix_mode);
|
||||
enable_disable(GL_NORMALIZE, cur->normalize_flag);
|
||||
enable_disable(GL_RESCALE_NORMAL, cur->rescale_normal_flag);
|
||||
}
|
||||
|
||||
if (cur->mask & GL_VIEWPORT_BIT) {
|
||||
glViewport(cur->viewport_size[0], cur->viewport_size[1], cur->viewport_size[2], cur->viewport_size[3]);
|
||||
glDepthRangef(cur->depth_range[0], cur->depth_range[1]);
|
||||
glshim_glViewport(cur->viewport_size[0], cur->viewport_size[1], cur->viewport_size[2], cur->viewport_size[3]);
|
||||
glshim_glDepthRangef(cur->depth_range[0], cur->depth_range[1]);
|
||||
}
|
||||
|
||||
maybe_free(cur->clip_planes_enabled);
|
||||
@@ -527,10 +527,10 @@ void glPopAttrib() {
|
||||
|
||||
#undef enable_disable
|
||||
#define enable_disable(pname, enabled) \
|
||||
if (enabled) glEnableClientState(pname); \
|
||||
else glDisableClientState(pname)
|
||||
if (enabled) glshim_glEnableClientState(pname); \
|
||||
else glshim_glDisableClientState(pname)
|
||||
|
||||
void glPopClientAttrib() {
|
||||
void glshim_glPopClientAttrib() {
|
||||
noerrorShim();
|
||||
//LOAD_GLES(glVertexPointer);
|
||||
//LOAD_GLES(glColorPointer);
|
||||
@@ -544,34 +544,34 @@ void glPopClientAttrib() {
|
||||
|
||||
glclientstack_t *cur = clientStack + clientStack->len-1;
|
||||
if (cur->mask & GL_CLIENT_PIXEL_STORE_BIT) {
|
||||
glPixelStorei(GL_PACK_ALIGNMENT, cur->pack_align);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, cur->unpack_align);
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, cur->unpack_row_length);
|
||||
glPixelStorei(GL_UNPACK_SKIP_PIXELS, cur->unpack_skip_pixels);
|
||||
glPixelStorei(GL_UNPACK_SKIP_ROWS, cur->unpack_skip_rows);
|
||||
glPixelStorei(GL_PACK_ROW_LENGTH, cur->pack_row_length);
|
||||
glPixelStorei(GL_PACK_SKIP_PIXELS, cur->pack_skip_pixels);
|
||||
glPixelStorei(GL_PACK_SKIP_ROWS, cur->pack_skip_rows);
|
||||
glshim_glPixelStorei(GL_PACK_ALIGNMENT, cur->pack_align);
|
||||
glshim_glPixelStorei(GL_UNPACK_ALIGNMENT, cur->unpack_align);
|
||||
glshim_glPixelStorei(GL_UNPACK_ROW_LENGTH, cur->unpack_row_length);
|
||||
glshim_glPixelStorei(GL_UNPACK_SKIP_PIXELS, cur->unpack_skip_pixels);
|
||||
glshim_glPixelStorei(GL_UNPACK_SKIP_ROWS, cur->unpack_skip_rows);
|
||||
glshim_glPixelStorei(GL_PACK_ROW_LENGTH, cur->pack_row_length);
|
||||
glshim_glPixelStorei(GL_PACK_SKIP_PIXELS, cur->pack_skip_pixels);
|
||||
glshim_glPixelStorei(GL_PACK_SKIP_ROWS, cur->pack_skip_rows);
|
||||
}
|
||||
|
||||
if (cur->mask & GL_CLIENT_VERTEX_ARRAY_BIT) {
|
||||
if (state.vao->vertex_array != cur->vert_enable)
|
||||
if (glstate.vao->vertex_array != cur->vert_enable)
|
||||
enable_disable(GL_VERTEX_ARRAY, cur->vert_enable);
|
||||
if (state.vao->normal_array != cur->normal_enable)
|
||||
if (glstate.vao->normal_array != cur->normal_enable)
|
||||
enable_disable(GL_NORMAL_ARRAY, cur->normal_enable);
|
||||
if (state.vao->color_array != cur->color_enable)
|
||||
if (glstate.vao->color_array != cur->color_enable)
|
||||
enable_disable(GL_COLOR_ARRAY, cur->color_enable);
|
||||
if (state.vao->secondary_array != cur->secondary_enable)
|
||||
if (glstate.vao->secondary_array != cur->secondary_enable)
|
||||
enable_disable(GL_SECONDARY_COLOR_ARRAY, cur->secondary_enable);
|
||||
for (int a=0; a<MAX_TEX; a++) {
|
||||
if (state.vao->tex_coord_array[a] != cur->tex_enable[a]) {
|
||||
glClientActiveTexture(GL_TEXTURE0+a);
|
||||
if (glstate.vao->tex_coord_array[a] != cur->tex_enable[a]) {
|
||||
glshim_glClientActiveTexture(GL_TEXTURE0+a);
|
||||
enable_disable(GL_TEXTURE_COORD_ARRAY, cur->tex_enable[a]);
|
||||
}
|
||||
}
|
||||
|
||||
memcpy(&state.vao->pointers, &(cur->pointers), sizeof(pointer_states_t));
|
||||
if (state.texture.client != cur->client) glClientActiveTexture(GL_TEXTURE0+cur->client);
|
||||
memcpy(&glstate.vao->pointers, &(cur->pointers), sizeof(pointer_states_t));
|
||||
if (glstate.texture.client != cur->client) glshim_glClientActiveTexture(GL_TEXTURE0+cur->client);
|
||||
}
|
||||
|
||||
clientStack->len--;
|
||||
@@ -582,3 +582,9 @@ void glPopClientAttrib() {
|
||||
#undef v2
|
||||
#undef v3
|
||||
#undef v4
|
||||
|
||||
//Direct wrapper
|
||||
void glPushClientAttrib(GLbitfield mask) __attribute__((alias("glshim_glPushClientAttrib")));
|
||||
void glPopClientAttrib() __attribute__((alias("glshim_glPopClientAttrib")));
|
||||
void glPushAttrib(GLbitfield mask) __attribute__((alias("glshim_glPushAttrib")));
|
||||
void glPopAttrib() __attribute__((alias("glshim_glPopAttrib")));
|
||||
@@ -164,9 +164,9 @@ typedef struct {
|
||||
unsigned int cap;
|
||||
} glclientstack_t;
|
||||
|
||||
void glPushClientAttrib(GLbitfield mask);
|
||||
void glPopClientAttrib();
|
||||
void glPushAttrib(GLbitfield mask);
|
||||
void glPopAttrib();
|
||||
void glshim_glPushClientAttrib(GLbitfield mask);
|
||||
void glshim_glPopClientAttrib();
|
||||
void glshim_glPushAttrib(GLbitfield mask);
|
||||
void glshim_glPopAttrib();
|
||||
|
||||
#endif
|
||||
|
||||
@@ -125,6 +125,7 @@ typedef struct {
|
||||
} clientstate_t;
|
||||
|
||||
typedef struct {
|
||||
int dummy[16]; // dummy zone, test for memory overwriting...
|
||||
displaylist_state_t list;
|
||||
enable_state_t enable;
|
||||
map_state_t *map_grid;
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
|
||||
//extern void* eglGetProcAddress(const char*);
|
||||
|
||||
void glTexGeni(GLenum coord, GLenum pname, GLint param) {
|
||||
void glshim_glTexGeni(GLenum coord, GLenum pname, GLint param) {
|
||||
GLfloat params[4] = {0,0,0,0};
|
||||
params[0]=param;
|
||||
glTexGenfv(coord, pname, params);
|
||||
glshim_glTexGenfv(coord, pname, params);
|
||||
}
|
||||
|
||||
void glTexGenfv(GLenum coord, GLenum pname, const GLfloat *param) {
|
||||
void glshim_glTexGenfv(GLenum coord, GLenum pname, const GLfloat *param) {
|
||||
|
||||
/*
|
||||
If pname is GL_TEXTURE_GEN_MODE, then the array must contain
|
||||
@@ -19,10 +19,10 @@ void glTexGenfv(GLenum coord, GLenum pname, const GLfloat *param) {
|
||||
generation function specified by pname.
|
||||
*/
|
||||
|
||||
//printf("glTexGenfv(0x%04X, 0x%04X, [%.02f, ...]), texture=%i\n", coord, pname, param[0], state.texture.active);
|
||||
if ((state.list.compiling || state.gl_batch) && state.list.active) {
|
||||
NewStage(state.list.active, STAGE_TEXGEN);
|
||||
rlTexGenfv(state.list.active, coord, pname, param);
|
||||
//printf("glTexGenfv(0x%04X, 0x%04X, [%.02f, ...]), texture=%i\n", coord, pname, 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;
|
||||
}
|
||||
@@ -32,9 +32,9 @@ void glTexGenfv(GLenum coord, GLenum pname, const GLfloat *param) {
|
||||
switch(pname) {
|
||||
case GL_TEXTURE_GEN_MODE:
|
||||
switch (coord) {
|
||||
case GL_S: state.texgen[state.texture.active].S = param[0]; break;
|
||||
case GL_T: state.texgen[state.texture.active].T = param[0]; break;
|
||||
case GL_R: state.texgen[state.texture.active].R = param[0]; break;
|
||||
case GL_S: glstate.texgen[glstate.texture.active].S = param[0]; break;
|
||||
case GL_T: glstate.texgen[glstate.texture.active].T = param[0]; break;
|
||||
case GL_R: glstate.texgen[glstate.texture.active].R = param[0]; break;
|
||||
default:
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
return;
|
||||
@@ -42,13 +42,13 @@ void glTexGenfv(GLenum coord, GLenum pname, const GLfloat *param) {
|
||||
case GL_OBJECT_PLANE:
|
||||
switch (coord) {
|
||||
case GL_S:
|
||||
memcpy(state.texgen[state.texture.active].S_O, param, 4 * sizeof(GLfloat));
|
||||
memcpy(glstate.texgen[glstate.texture.active].S_O, param, 4 * sizeof(GLfloat));
|
||||
break;
|
||||
case GL_T:
|
||||
memcpy(state.texgen[state.texture.active].T_O, param, 4 * sizeof(GLfloat));
|
||||
memcpy(glstate.texgen[glstate.texture.active].T_O, param, 4 * sizeof(GLfloat));
|
||||
break;
|
||||
case GL_R:
|
||||
memcpy(state.texgen[state.texture.active].R_O, param, 4 * sizeof(GLfloat));
|
||||
memcpy(glstate.texgen[glstate.texture.active].R_O, param, 4 * sizeof(GLfloat));
|
||||
break;
|
||||
default:
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
@@ -57,13 +57,13 @@ void glTexGenfv(GLenum coord, GLenum pname, const GLfloat *param) {
|
||||
case GL_EYE_PLANE:
|
||||
switch (coord) {
|
||||
case GL_S:
|
||||
memcpy(state.texgen[state.texture.active].S_E, param, 4 * sizeof(GLfloat));
|
||||
memcpy(glstate.texgen[glstate.texture.active].S_E, param, 4 * sizeof(GLfloat));
|
||||
break;
|
||||
case GL_T:
|
||||
memcpy(state.texgen[state.texture.active].T_E, param, 4 * sizeof(GLfloat));
|
||||
memcpy(glstate.texgen[glstate.texture.active].T_E, param, 4 * sizeof(GLfloat));
|
||||
break;
|
||||
case GL_R:
|
||||
memcpy(state.texgen[state.texture.active].R_E, param, 4 * sizeof(GLfloat));
|
||||
memcpy(glstate.texgen[glstate.texture.active].R_E, param, 4 * sizeof(GLfloat));
|
||||
break;
|
||||
default:
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
@@ -73,28 +73,28 @@ void glTexGenfv(GLenum coord, GLenum pname, const GLfloat *param) {
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
}
|
||||
}
|
||||
void glGetTexGenfv(GLenum coord,GLenum pname,GLfloat *params) {
|
||||
void glshim_glGetTexGenfv(GLenum coord,GLenum pname,GLfloat *params) {
|
||||
if (gl_batch) flush();
|
||||
noerrorShim();
|
||||
switch(pname) {
|
||||
case GL_TEXTURE_GEN_MODE:
|
||||
switch (coord) {
|
||||
case GL_S: *params = state.texgen[state.texture.active].S; break;
|
||||
case GL_T: *params = state.texgen[state.texture.active].T; break;
|
||||
case GL_R: *params = state.texgen[state.texture.active].R; break;
|
||||
case GL_S: *params = glstate.texgen[glstate.texture.active].S; break;
|
||||
case GL_T: *params = glstate.texgen[glstate.texture.active].T; break;
|
||||
case GL_R: *params = glstate.texgen[glstate.texture.active].R; break;
|
||||
default: *params = GL_EYE_LINEAR;
|
||||
}
|
||||
break;
|
||||
case GL_OBJECT_PLANE:
|
||||
switch (coord) {
|
||||
case GL_S:
|
||||
memcpy(params, state.texgen[state.texture.active].S_O, 4 * sizeof(GLfloat));
|
||||
memcpy(params, glstate.texgen[glstate.texture.active].S_O, 4 * sizeof(GLfloat));
|
||||
break;
|
||||
case GL_T:
|
||||
memcpy(params, state.texgen[state.texture.active].T_O, 4 * sizeof(GLfloat));
|
||||
memcpy(params, glstate.texgen[glstate.texture.active].T_O, 4 * sizeof(GLfloat));
|
||||
break;
|
||||
case GL_R:
|
||||
memcpy(params, state.texgen[state.texture.active].R_O, 4 * sizeof(GLfloat));
|
||||
memcpy(params, glstate.texgen[glstate.texture.active].R_O, 4 * sizeof(GLfloat));
|
||||
break;
|
||||
default:
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
@@ -102,13 +102,13 @@ void glGetTexGenfv(GLenum coord,GLenum pname,GLfloat *params) {
|
||||
case GL_EYE_PLANE:
|
||||
switch (coord) {
|
||||
case GL_S:
|
||||
memcpy(params, state.texgen[state.texture.active].S_E, 4 * sizeof(GLfloat));
|
||||
memcpy(params, glstate.texgen[glstate.texture.active].S_E, 4 * sizeof(GLfloat));
|
||||
break;
|
||||
case GL_T:
|
||||
memcpy(params, state.texgen[state.texture.active].T_E, 4 * sizeof(GLfloat));
|
||||
memcpy(params, glstate.texgen[glstate.texture.active].T_E, 4 * sizeof(GLfloat));
|
||||
break;
|
||||
case GL_R:
|
||||
memcpy(params, state.texgen[state.texture.active].R_E, 4 * sizeof(GLfloat));
|
||||
memcpy(params, glstate.texgen[glstate.texture.active].R_E, 4 * sizeof(GLfloat));
|
||||
break;
|
||||
default:
|
||||
errorShim(GL_INVALID_ENUM);
|
||||
@@ -251,7 +251,7 @@ void sphere_loop(const GLfloat *verts, const GLfloat *norm, GLfloat *out, GLint
|
||||
}*/
|
||||
// First get the ModelviewMatrix
|
||||
GLfloat ModelviewMatrix[16], InvModelview[16];
|
||||
glGetFloatv(GL_MODELVIEW_MATRIX, InvModelview);
|
||||
glshim_glGetFloatv(GL_MODELVIEW_MATRIX, InvModelview);
|
||||
// column major -> row major
|
||||
for (int i=0; i<4; i++)
|
||||
for (int j=0; j<4; j++)
|
||||
@@ -264,7 +264,7 @@ void sphere_loop(const GLfloat *verts, const GLfloat *norm, GLfloat *out, GLint
|
||||
GLushort k = indices?indices[i]:i;
|
||||
matrix_vector(ModelviewMatrix, verts+k*4, eye);
|
||||
vector_normalize(eye);
|
||||
vector3_matrix((norm)?(norm+k*3):state.normal, InvModelview, eye_norm);
|
||||
vector3_matrix((norm)?(norm+k*3):glstate.normal, InvModelview, eye_norm);
|
||||
vector_normalize(eye_norm);
|
||||
a=dot(eye, eye_norm)*2.0f;
|
||||
for (int j=0; j<4; j++)
|
||||
@@ -293,7 +293,7 @@ void eye_loop(const GLfloat *verts, const GLfloat *param, GLfloat *out, GLint co
|
||||
for (int i=0; i<count; i++) {
|
||||
GLushort k = indices?indices[i]:i;
|
||||
matrix_vector(ModelviewMatrix, verts+k*4, tmp);
|
||||
out[k*4]=dot(plane, tmp);
|
||||
out[k*4]=dot4(plane, tmp);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -316,23 +316,23 @@ void gen_tex_coords(GLfloat *verts, GLfloat *norm, GLfloat **coords, GLint count
|
||||
// TODO: do less work when called from glDrawElements?
|
||||
(*needclean) = 0;
|
||||
// special case : no texgen but texture activated, create a simple 1 repeated element
|
||||
if (!state.enable.texgen_s[texture] && !state.enable.texgen_t[texture] && !state.enable.texgen_r[texture]) {
|
||||
if (!glstate.enable.texgen_s[texture] && !glstate.enable.texgen_t[texture] && !glstate.enable.texgen_r[texture]) {
|
||||
if ((*coords)==NULL)
|
||||
*coords = (GLfloat *)malloc(count * 4 * sizeof(GLfloat));
|
||||
if (indices)
|
||||
for (int i=0; i<ilen; i++) {
|
||||
memcpy((*coords)+indices[i]*4, state.texcoord[texture], sizeof(GLfloat)*4);
|
||||
memcpy((*coords)+indices[i]*4, glstate.texcoord[texture], sizeof(GLfloat)*4);
|
||||
}
|
||||
else
|
||||
for (int i=0; i<count*4; i+=4) {
|
||||
memcpy((*coords)+i, state.texcoord[texture], sizeof(GLfloat)*4);
|
||||
memcpy((*coords)+i, glstate.texcoord[texture], sizeof(GLfloat)*4);
|
||||
}
|
||||
return;
|
||||
}
|
||||
// special case: SPHERE_MAP needs both texgen to make sense
|
||||
if ((state.enable.texgen_s[texture] && (state.texgen[texture].S==GL_SPHERE_MAP)) && (state.enable.texgen_t[texture] && (state.texgen[texture].T==GL_SPHERE_MAP)))
|
||||
if ((glstate.enable.texgen_s[texture] && (glstate.texgen[texture].S==GL_SPHERE_MAP)) && (glstate.enable.texgen_t[texture] && (glstate.texgen[texture].T==GL_SPHERE_MAP)))
|
||||
{
|
||||
if (!state.enable.texture_2d[texture])
|
||||
if (!glstate.enable.texture_2d[texture])
|
||||
return;
|
||||
if ((*coords)==NULL)
|
||||
*coords = (GLfloat *)malloc(count * 4 * sizeof(GLfloat));
|
||||
@@ -340,14 +340,14 @@ void gen_tex_coords(GLfloat *verts, GLfloat *norm, GLfloat **coords, GLint count
|
||||
return;
|
||||
}
|
||||
// special case: REFLECTION_MAP needs the 3 texgen to make sense
|
||||
if ((state.enable.texgen_s[texture] && (state.texgen[texture].S==GL_REFLECTION_MAP))
|
||||
&& (state.enable.texgen_t[texture] && (state.texgen[texture].T==GL_REFLECTION_MAP))
|
||||
&& (state.enable.texgen_r[texture] && (state.texgen[texture].R==GL_REFLECTION_MAP)))
|
||||
if ((glstate.enable.texgen_s[texture] && (glstate.texgen[texture].S==GL_REFLECTION_MAP))
|
||||
&& (glstate.enable.texgen_t[texture] && (glstate.texgen[texture].T==GL_REFLECTION_MAP))
|
||||
&& (glstate.enable.texgen_r[texture] && (glstate.texgen[texture].R==GL_REFLECTION_MAP)))
|
||||
{
|
||||
*needclean=1;
|
||||
// setup reflection map!
|
||||
GLuint old_tex=state.texture.active;
|
||||
if (old_tex!=texture) glActiveTexture(GL_TEXTURE0 + texture);
|
||||
GLuint old_tex=glstate.texture.active;
|
||||
if (old_tex!=texture) glshim_glActiveTexture(GL_TEXTURE0 + texture);
|
||||
LOAD_GLES_OES(glTexGeni);
|
||||
LOAD_GLES_OES(glTexGenfv);
|
||||
LOAD_GLES(glEnable);
|
||||
@@ -358,19 +358,19 @@ void gen_tex_coords(GLfloat *verts, GLfloat *norm, GLfloat **coords, GLint count
|
||||
// enable texgen
|
||||
gles_glEnable(GL_TEXTURE_GEN_STR); //GLES only support the 3 gen at the same time!
|
||||
|
||||
if (old_tex!=texture) glActiveTexture(GL_TEXTURE0 + old_tex);
|
||||
if (old_tex!=texture) glshim_glActiveTexture(GL_TEXTURE0 + old_tex);
|
||||
|
||||
return;
|
||||
}
|
||||
// special case: NORMAL_MAP needs the 3 texgen to make sense
|
||||
if ((state.enable.texgen_s[texture] && (state.texgen[texture].S==GL_NORMAL_MAP))
|
||||
&& (state.enable.texgen_t[texture] && (state.texgen[texture].T==GL_NORMAL_MAP))
|
||||
&& (state.enable.texgen_r[texture] && (state.texgen[texture].R==GL_NORMAL_MAP)))
|
||||
if ((glstate.enable.texgen_s[texture] && (glstate.texgen[texture].S==GL_NORMAL_MAP))
|
||||
&& (glstate.enable.texgen_t[texture] && (glstate.texgen[texture].T==GL_NORMAL_MAP))
|
||||
&& (glstate.enable.texgen_r[texture] && (glstate.texgen[texture].R==GL_NORMAL_MAP)))
|
||||
{
|
||||
*needclean=1;
|
||||
// setup reflection map!
|
||||
GLuint old_tex=state.texture.active;
|
||||
if (old_tex!=texture) glActiveTexture(GL_TEXTURE0 + texture);
|
||||
GLuint old_tex=glstate.texture.active;
|
||||
if (old_tex!=texture) glshim_glActiveTexture(GL_TEXTURE0 + texture);
|
||||
LOAD_GLES_OES(glTexGeni);
|
||||
LOAD_GLES_OES(glTexGenfv);
|
||||
LOAD_GLES(glEnable);
|
||||
@@ -381,18 +381,18 @@ void gen_tex_coords(GLfloat *verts, GLfloat *norm, GLfloat **coords, GLint count
|
||||
// enable texgen
|
||||
gles_glEnable(GL_TEXTURE_GEN_STR);
|
||||
|
||||
if (old_tex!=texture) glActiveTexture(GL_TEXTURE0 + old_tex);
|
||||
if (old_tex!=texture) glshim_glActiveTexture(GL_TEXTURE0 + old_tex);
|
||||
|
||||
return;
|
||||
}
|
||||
if (!state.enable.texture_2d[texture])
|
||||
if (!glstate.enable.texture_2d[texture])
|
||||
return;
|
||||
if ((*coords)==NULL)
|
||||
*coords = (GLfloat *)malloc(count * 4 * sizeof(GLfloat));
|
||||
if (state.enable.texgen_s[texture])
|
||||
tex_coord_loop(verts, norm, *coords, (indices)?ilen:count, state.texgen[texture].S, state.texgen[texture].S_O, state.texgen[texture].S_E, indices);
|
||||
if (state.enable.texgen_t[texture])
|
||||
tex_coord_loop(verts, norm, *coords+1, (indices)?ilen:count, state.texgen[texture].T, state.texgen[texture].T_O, state.texgen[texture].T_E, indices);
|
||||
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);
|
||||
for (int i=0; i<count; i++) {
|
||||
GLushort k = indices?indices[i]:i;
|
||||
(*coords)[k*4+2] = 0.0f;
|
||||
@@ -404,38 +404,47 @@ void gen_tex_clean(GLint cleancode, int texture) {
|
||||
if (cleancode == 0)
|
||||
return;
|
||||
if (cleancode == 1) {
|
||||
GLuint old_tex=state.texture.active;
|
||||
if (old_tex!=texture) glActiveTexture(GL_TEXTURE0 + texture);
|
||||
GLuint old_tex=glstate.texture.active;
|
||||
if (old_tex!=texture) glshim_glActiveTexture(GL_TEXTURE0 + texture);
|
||||
LOAD_GLES(glDisable);
|
||||
gles_glDisable(GL_TEXTURE_GEN_STR);
|
||||
if (old_tex!=texture) glActiveTexture(GL_TEXTURE0 + old_tex);
|
||||
if (old_tex!=texture) glshim_glActiveTexture(GL_TEXTURE0 + old_tex);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void glLoadTransposeMatrixf(const GLfloat *m) {
|
||||
void glshim_glLoadTransposeMatrixf(const GLfloat *m) {
|
||||
GLfloat mf[16];
|
||||
matrix_row_column(m, mf);
|
||||
glLoadMatrixf(mf);
|
||||
glshim_glLoadMatrixf(mf);
|
||||
errorGL();
|
||||
}
|
||||
|
||||
void glLoadTransposeMatrixd(const GLdouble *m) {
|
||||
void glshim_glLoadTransposeMatrixd(const GLdouble *m) {
|
||||
GLfloat mf[16];
|
||||
for (int i=0; i<16; i++)
|
||||
mf[i] = m[i];
|
||||
glLoadTransposeMatrixf(mf);
|
||||
glshim_glLoadTransposeMatrixf(mf);
|
||||
}
|
||||
|
||||
void glMultTransposeMatrixd(const GLdouble *m) {
|
||||
void glshim_glMultTransposeMatrixd(const GLdouble *m) {
|
||||
GLfloat mf[16];
|
||||
for (int i=0; i<16; i++)
|
||||
mf[i] = m[i];
|
||||
glMultTransposeMatrixf(mf);
|
||||
glshim_glMultTransposeMatrixf(mf);
|
||||
}
|
||||
void glMultTransposeMatrixf(const GLfloat *m) {
|
||||
void glshim_glMultTransposeMatrixf(const GLfloat *m) {
|
||||
GLfloat mf[16];
|
||||
matrix_row_column(m, mf);
|
||||
glMultMatrixf(mf);
|
||||
glshim_glMultMatrixf(mf);
|
||||
errorGL();
|
||||
}
|
||||
|
||||
void glTexGenfv(GLenum coord, GLenum pname, const GLfloat *params) __attribute__((alias("glshim_glTexGenfv")));
|
||||
void glTexGeni(GLenum coord, GLenum pname, GLint param) __attribute__((alias("glshim_glTexGeni")));
|
||||
void glGetTexGenfv(GLenum coord,GLenum pname,GLfloat *params) __attribute__((alias("glshim_glGetTexGenfv")));
|
||||
|
||||
void glLoadTransposeMatrixf(const GLfloat *m) __attribute__((alias("glshim_glLoadTransposeMatrixf")));
|
||||
void glLoadTransposeMatrixd(const GLdouble *m) __attribute__((alias("glshim_glLoadTransposeMatrixd")));
|
||||
void glMultTransposeMatrixd(const GLdouble *m) __attribute__((alias("glshim_glMultTransposeMatrixd")));
|
||||
void glMultTransposeMatrixf(const GLfloat *m) __attribute__((alias("glshim_glMultTransposeMatrixf")));
|
||||
@@ -1,22 +1,22 @@
|
||||
#include "gl.h"
|
||||
#include <math.h>
|
||||
|
||||
extern void glTexGenfv(GLenum coord, GLenum pname, const GLfloat *params);
|
||||
extern void glTexGeni(GLenum coord, GLenum pname, GLint param);
|
||||
extern void gen_tex_coords(GLfloat *verts, GLfloat *norm, GLfloat **coords, GLint count, GLint *needclean, int texture, GLushort* indices, GLuint ilen);
|
||||
extern void gen_tex_clean(GLint cleancode, int texture);
|
||||
extern void glGetTexGenfv(GLenum coord,GLenum pname,GLfloat *params);
|
||||
void glshim_glTexGenfv(GLenum coord, GLenum pname, const GLfloat *params);
|
||||
void glshim_glTexGeni(GLenum coord, GLenum pname, GLint param);
|
||||
void gen_tex_coords(GLfloat *verts, GLfloat *norm, GLfloat **coords, GLint count, GLint *needclean, int texture, GLushort* indices, GLuint ilen);
|
||||
void gen_tex_clean(GLint cleancode, int texture);
|
||||
void glshim_glGetTexGenfv(GLenum coord,GLenum pname,GLfloat *params);
|
||||
|
||||
extern GLfloat dot(const GLfloat *a, const GLfloat *b);
|
||||
extern void matrix_vector(const GLfloat *a, const GLfloat *b, GLfloat *c);
|
||||
extern void vector_matrix(const GLfloat *a, const GLfloat *b, GLfloat *c);
|
||||
extern void vector_normalize(GLfloat *a);
|
||||
extern void matrix_column_row(const GLfloat *a, GLfloat *b);
|
||||
extern void matrix_row_column(const GLfloat *a, GLfloat *b);
|
||||
extern void matrix_inverse(const GLfloat *m, GLfloat *r);
|
||||
extern void matrix_mul(const GLfloat *a, const GLfloat *b, GLfloat *c);
|
||||
GLfloat dot(const GLfloat *a, const GLfloat *b);
|
||||
void matrix_vector(const GLfloat *a, const GLfloat *b, GLfloat *c);
|
||||
void vector_matrix(const GLfloat *a, const GLfloat *b, GLfloat *c);
|
||||
void vector_normalize(GLfloat *a);
|
||||
void matrix_column_row(const GLfloat *a, GLfloat *b);
|
||||
void matrix_row_column(const GLfloat *a, GLfloat *b);
|
||||
void matrix_inverse(const GLfloat *m, GLfloat *r);
|
||||
void matrix_mul(const GLfloat *a, const GLfloat *b, GLfloat *c);
|
||||
|
||||
extern void glLoadTransposeMatrixf(const GLfloat *m);
|
||||
extern void glLoadTransposeMatrixd(const GLdouble *m);
|
||||
extern void glMultTransposeMatrixd(const GLdouble *m);
|
||||
extern void glMultTransposeMatrixf(const GLfloat *m);
|
||||
void glshim_glLoadTransposeMatrixf(const GLfloat *m);
|
||||
void glshim_glLoadTransposeMatrixd(const GLdouble *m);
|
||||
void glshim_glMultTransposeMatrixd(const GLdouble *m);
|
||||
void glshim_glMultTransposeMatrixf(const GLfloat *m);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -3,76 +3,76 @@
|
||||
#ifndef GL_TEXTURE_H
|
||||
#define GL_TEXTURE_H
|
||||
|
||||
void glTexImage2D(GLenum target, GLint level, GLint internalFormat,
|
||||
void glshim_glTexImage2D(GLenum target, GLint level, GLint internalFormat,
|
||||
GLsizei width, GLsizei height, GLint border,
|
||||
GLenum format, GLenum type, const GLvoid *data);
|
||||
|
||||
void glTexImage1D(GLenum target, GLint level, GLint internalFormat,
|
||||
void glshim_glTexImage1D(GLenum target, GLint level, GLint internalFormat,
|
||||
GLsizei width, GLint border,
|
||||
GLenum format, GLenum type, const GLvoid *data);
|
||||
|
||||
void glTexImage3D(GLenum target, GLint level, GLint internalFormat,
|
||||
void glshim_glTexImage3D(GLenum target, GLint level, GLint internalFormat,
|
||||
GLsizei width, GLsizei height, GLsizei depth,
|
||||
GLint border, GLenum format, GLenum type, const GLvoid *data);
|
||||
|
||||
void glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
||||
void glshim_glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
||||
GLsizei width, GLsizei height, GLenum format, GLenum type,
|
||||
const GLvoid *data);
|
||||
|
||||
void glTexSubImage1D(GLenum target, GLint level, GLint xoffset,
|
||||
void glshim_glTexSubImage1D(GLenum target, GLint level, GLint xoffset,
|
||||
GLsizei width, GLenum format, GLenum type,
|
||||
const GLvoid *data);
|
||||
|
||||
void glTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
|
||||
void glshim_glTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
|
||||
GLsizei width, GLsizei height, GLsizei depth, GLenum format,
|
||||
GLenum type, const GLvoid *data);
|
||||
|
||||
void glBindTexture(GLenum target, GLuint texture);
|
||||
void glGenTextures(GLsizei n, GLuint * textures);
|
||||
void glDeleteTextures(GLsizei n, const GLuint * textures);
|
||||
void glTexParameteri(GLenum target, GLenum pname, GLint param);
|
||||
void glTexParameterf(GLenum target, GLenum pname, GLfloat param);
|
||||
GLboolean glAreTexturesResident(GLsizei n, const GLuint *textures, GLboolean *residences);
|
||||
void glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint *params);
|
||||
void glGetTexImage(GLenum target, GLint level, GLenum format, GLenum type, GLvoid * img);
|
||||
void glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid * data);
|
||||
void glshim_glBindTexture(GLenum target, GLuint texture);
|
||||
void glshim_glGenTextures(GLsizei n, GLuint * textures);
|
||||
void glshim_glDeleteTextures(GLsizei n, const GLuint * textures);
|
||||
void glshim_glTexParameteri(GLenum target, GLenum pname, GLint param);
|
||||
void glshim_glTexParameterf(GLenum target, GLenum pname, GLfloat param);
|
||||
GLboolean glshim_glAreTexturesResident(GLsizei n, const GLuint *textures, GLboolean *residences);
|
||||
void glshim_glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint *params);
|
||||
void glshim_glGetTexImage(GLenum target, GLint level, GLenum format, GLenum type, GLvoid * img);
|
||||
void glshim_glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid * data);
|
||||
|
||||
void glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat,
|
||||
void glshim_glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat,
|
||||
GLsizei width, GLsizei height, GLint border,
|
||||
GLsizei imageSize, const GLvoid *data);
|
||||
void glCompressedTexImage1D(GLenum target, GLint level, GLenum internalformat,
|
||||
void glshim_glCompressedTexImage1D(GLenum target, GLint level, GLenum internalformat,
|
||||
GLsizei width, GLint border,
|
||||
GLsizei imageSize, const GLvoid *data);
|
||||
void glCompressedTexImage3D(GLenum target, GLint level, GLenum internalformat,
|
||||
void glshim_glCompressedTexImage3D(GLenum target, GLint level, GLenum internalformat,
|
||||
GLsizei width, GLsizei height, GLsizei depth, GLint border,
|
||||
GLsizei imageSize, const GLvoid *data);
|
||||
|
||||
void glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
||||
void glshim_glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
||||
GLsizei width, GLsizei height, GLenum format,
|
||||
GLsizei imageSize, const GLvoid *data);
|
||||
void glCompressedTexSubImage1D(GLenum target, GLint level, GLint xoffset,
|
||||
void glshim_glCompressedTexSubImage1D(GLenum target, GLint level, GLint xoffset,
|
||||
GLsizei width, GLenum format,
|
||||
GLsizei imageSize, const GLvoid *data);
|
||||
void glCompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
|
||||
void glshim_glCompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
|
||||
GLsizei width, GLsizei height, GLsizei depth, GLenum format,
|
||||
GLsizei imageSize, const GLvoid *data);
|
||||
|
||||
void glGetCompressedTexImage(GLenum target, GLint lod, GLvoid *img);
|
||||
void glshim_glGetCompressedTexImage(GLenum target, GLint lod, GLvoid *img);
|
||||
|
||||
|
||||
void glCopyTexImage1D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y,
|
||||
void glshim_glCopyTexImage1D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y,
|
||||
GLsizei width, GLint border);
|
||||
|
||||
void glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y,
|
||||
void glshim_glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y,
|
||||
GLsizei width, GLsizei height, GLint border);
|
||||
|
||||
void glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
||||
void glshim_glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
|
||||
GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
|
||||
void glCopyTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLint x, GLint y,
|
||||
void glshim_glCopyTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLint x, GLint y,
|
||||
GLsizei width);
|
||||
|
||||
void glCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
|
||||
void glshim_glCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
|
||||
GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
|
||||
|
||||
@@ -124,12 +124,12 @@ static inline GLenum map_tex_target(GLenum target) {
|
||||
}
|
||||
return target;
|
||||
}
|
||||
gltexture_t* getTexture(GLenum target, GLuint texture);
|
||||
gltexture_t* glshim_getTexture(GLenum target, GLuint texture);
|
||||
|
||||
void glActiveTexture( GLenum texture );
|
||||
void glClientActiveTexture( GLenum texture );
|
||||
void glMultiTexCoord2f( GLenum target, GLfloat s, GLfloat t );
|
||||
GLboolean glIsTexture( GLuint texture );
|
||||
void glshim_glActiveTexture( GLenum texture );
|
||||
void glshim_glClientActiveTexture( GLenum texture );
|
||||
void glshim_glMultiTexCoord2f( GLenum target, GLfloat s, GLfloat t );
|
||||
GLboolean glshim_glIsTexture( GLuint texture );
|
||||
|
||||
void tex_setup_texcoord(GLuint texunit, GLuint len);
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,88 +1,84 @@
|
||||
#include "../gl.h"
|
||||
#include <GLES/glext.h>
|
||||
|
||||
#ifndef GL_WRAP_H
|
||||
#define GL_WRAP_H
|
||||
|
||||
#include "../gl.h"
|
||||
//#include <GLES/glext.h>
|
||||
|
||||
|
||||
// misc naive wrappers
|
||||
#ifdef USE_ES2
|
||||
void glCompileShaderARB(GLuint shader);
|
||||
GLuint glCreateShaderObjectARB(GLenum shaderType);
|
||||
void glGetObjectParameterivARB(GLuint shader, GLenum pname, GLint *params);
|
||||
void glShaderSourceARB(GLuint shader, GLsizei count, const GLchar **string, const GLint *length);
|
||||
void glshim_glCompileShaderARB(GLuint shader);
|
||||
GLuint glshim_glCreateShaderObjectARB(GLenum shaderType);
|
||||
void glshim_glGetObjectParameterivARB(GLuint shader, GLenum pname, GLint *params);
|
||||
void glshim_glShaderSourceARB(GLuint shader, GLsizei count, const GLchar **string, const GLint *length);
|
||||
#endif
|
||||
|
||||
void glActiveTextureARB(GLenum texture);
|
||||
void glClearDepth(GLdouble depth);
|
||||
void glClientActiveTextureARB(GLenum texture);
|
||||
void glClipPlane(GLenum plane, const GLdouble *equation);
|
||||
void glDepthRange(GLdouble nearVal, GLdouble farVal);
|
||||
void glFogi(GLenum pname, GLint param);
|
||||
void glFogiv(GLenum pname, GLint *params);
|
||||
void glFrustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near, GLdouble far);
|
||||
void glGetDoublev(GLenum pname, GLdouble *params);
|
||||
void glLighti(GLenum light, GLenum pname, GLint param);
|
||||
void glLightiv(GLenum light, GLenum pname, GLint *iparams);
|
||||
void glLightModeli(GLenum pname, GLint param);
|
||||
void glLightModeliv(GLenum pname, GLint *iparams);
|
||||
void glMateriali(GLenum face, GLenum pname, GLint param);
|
||||
void glMaterialiv(GLenum face, GLenum pname, GLint *param);
|
||||
void glMultiTexCoord2f(GLenum target, GLfloat s, GLfloat t);
|
||||
void glOrtho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near, GLdouble far);
|
||||
void glGetMaterialiv(GLenum face, GLenum pname, GLint * params);
|
||||
void glGetLightiv(GLenum light, GLenum pname, GLint * params);
|
||||
void glGetClipPlane(GLenum plane, GLdouble *equation);
|
||||
void glshim_glClearDepth(GLdouble depth);
|
||||
void glshim_glClipPlane(GLenum plane, const GLdouble *equation);
|
||||
void glshim_glDepthRange(GLdouble nearVal, GLdouble farVal);
|
||||
void glshim_glFogi(GLenum pname, GLint param);
|
||||
void glshim_glFogiv(GLenum pname, GLint *params);
|
||||
void glshim_glFrustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near, GLdouble far);
|
||||
void glshim_glGetDoublev(GLenum pname, GLdouble *params);
|
||||
void glshim_glLighti(GLenum light, GLenum pname, GLint param);
|
||||
void glshim_glLightiv(GLenum light, GLenum pname, GLint *iparams);
|
||||
void glshim_glLightModeli(GLenum pname, GLint param);
|
||||
void glshim_glLightModeliv(GLenum pname, GLint *iparams);
|
||||
void glshim_glMateriali(GLenum face, GLenum pname, GLint param);
|
||||
void glshim_glMaterialiv(GLenum face, GLenum pname, GLint *param);
|
||||
void glshim_glMultiTexCoord2f(GLenum target, GLfloat s, GLfloat t);
|
||||
void glshim_glOrtho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near, GLdouble far);
|
||||
void glshim_glGetMaterialiv(GLenum face, GLenum pname, GLint * params);
|
||||
void glshim_glGetLightiv(GLenum light, GLenum pname, GLint * params);
|
||||
void glshim_glGetClipPlane(GLenum plane, GLdouble *equation);
|
||||
|
||||
void glBlendFuncSeparateEXT (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
|
||||
|
||||
void glDrawRangeElementsEXT(GLenum mode,GLuint start,GLuint end,GLsizei count,GLenum type,const void *indices);
|
||||
void glDrawRangeElements(GLenum mode,GLuint start,GLuint end,GLsizei count,GLenum type,const void *indices);
|
||||
void glshim_glDrawRangeElements(GLenum mode,GLuint start,GLuint end,GLsizei count,GLenum type,const void *indices);
|
||||
// color
|
||||
void glColor3f(GLfloat r, GLfloat g, GLfloat b);
|
||||
void glColor3fv(GLfloat *c);
|
||||
void glColor4fv(GLfloat *c);
|
||||
void glIndexfv(const GLfloat *c);
|
||||
void glSecondaryColor3fv(const GLfloat *v);
|
||||
void glshim_glColor3f(GLfloat r, GLfloat g, GLfloat b);
|
||||
void glshim_glColor3fv(GLfloat *c);
|
||||
void glshim_glColor4fv(GLfloat *c);
|
||||
void glshim_glIndexfv(const GLfloat *c);
|
||||
void glshim_glSecondaryColor3fv(const GLfloat *v);
|
||||
|
||||
// raster
|
||||
void glRasterPos2f(GLfloat x, GLfloat y);
|
||||
void glRasterPos2fv(const GLfloat *v);
|
||||
void glRasterPos3f(GLfloat x, GLfloat y, GLfloat z);
|
||||
void glRasterPos3fv(const GLfloat *v);
|
||||
void glRasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
||||
void glRasterPos4fv(const GLfloat *v);
|
||||
void glWindowPos2f(GLfloat x, GLfloat y);
|
||||
void glWindowPos2fv(const GLfloat *v);
|
||||
void glWindowPos3f(GLfloat x, GLfloat y, GLfloat z);
|
||||
void glWindowPos3fv(const GLfloat *v);
|
||||
void glshim_glRasterPos2f(GLfloat x, GLfloat y);
|
||||
void glshim_glRasterPos2fv(const GLfloat *v);
|
||||
void glshim_glRasterPos3f(GLfloat x, GLfloat y, GLfloat z);
|
||||
void glshim_glRasterPos3fv(const GLfloat *v);
|
||||
void glshim_glRasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
||||
void glshim_glRasterPos4fv(const GLfloat *v);
|
||||
void glshim_glWindowPos2f(GLfloat x, GLfloat y);
|
||||
void glshim_glWindowPos2fv(const GLfloat *v);
|
||||
void glshim_glWindowPos3f(GLfloat x, GLfloat y, GLfloat z);
|
||||
void glshim_glWindowPos3fv(const GLfloat *v);
|
||||
|
||||
void glPixelStoref(GLenum pname, GLfloat param);
|
||||
void glGetTexGendv(GLenum coord,GLenum pname,GLdouble *params);
|
||||
void glGetTexGeniv(GLenum coord,GLenum pname,GLint *params);
|
||||
void glPixelTransferi(GLenum pname, GLint param);
|
||||
void glPixelTransferf(GLenum pname, GLfloat param);
|
||||
void glshim_glPixelStoref(GLenum pname, GLfloat param);
|
||||
void glshim_glGetTexGendv(GLenum coord,GLenum pname,GLdouble *params);
|
||||
void glshim_glGetTexGeniv(GLenum coord,GLenum pname,GLint *params);
|
||||
void glshim_glPixelTransferi(GLenum pname, GLint param);
|
||||
void glshim_glPixelTransferf(GLenum pname, GLfloat param);
|
||||
|
||||
// eval
|
||||
void glEvalCoord1d(GLdouble u);
|
||||
void glEvalCoord1dv(GLdouble *v);
|
||||
void glEvalCoord1fv(GLfloat *v);
|
||||
void glEvalCoord2d(GLdouble u, GLdouble v);
|
||||
void glEvalCoord2dv(GLdouble *v);
|
||||
void glEvalCoord2fv(GLfloat *v);
|
||||
void glMapGrid1d(GLint un, GLdouble u1, GLdouble u2);
|
||||
void glMapGrid2d(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2);
|
||||
void glshim_glEvalCoord1d(GLdouble u);
|
||||
void glshim_glEvalCoord1dv(GLdouble *v);
|
||||
void glshim_glEvalCoord1fv(GLfloat *v);
|
||||
void glshim_glEvalCoord2d(GLdouble u, GLdouble v);
|
||||
void glshim_glEvalCoord2dv(GLdouble *v);
|
||||
void glshim_glEvalCoord2fv(GLfloat *v);
|
||||
void glshim_glMapGrid1d(GLint un, GLdouble u1, GLdouble u2);
|
||||
void glshim_glMapGrid2d(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2);
|
||||
|
||||
// matrix
|
||||
void glLoadMatrixd(const GLdouble *m);
|
||||
void glMultMatrixd(const GLdouble *m);
|
||||
void glshim_glLoadMatrixd(const GLdouble *m);
|
||||
void glshim_glMultMatrixd(const GLdouble *m);
|
||||
|
||||
// normal
|
||||
void glNormal3fv(GLfloat *v);
|
||||
void glshim_glNormal3fv(GLfloat *v);
|
||||
|
||||
// rect
|
||||
#define GL_RECT(suffix, type) \
|
||||
void glRect##suffix(type x1, type y1, type x2, type y2); \
|
||||
void glRect##suffix##v(const type *v);
|
||||
void glshim_glRect##suffix(type x1, type y1, type x2, type y2); \
|
||||
void glshim_glRect##suffix##v(const type *v);
|
||||
|
||||
GL_RECT(d, GLdouble)
|
||||
GL_RECT(f, GLfloat)
|
||||
@@ -92,51 +88,45 @@ GL_RECT(s, GLshort)
|
||||
|
||||
// textures
|
||||
|
||||
void glTexCoord1f(GLfloat s);
|
||||
void glTexCoord1fv(GLfloat *t);
|
||||
void glTexCoord2fv(GLfloat *t);
|
||||
void glTexCoord3f(GLfloat s, GLfloat t, GLfloat r);
|
||||
void glTexCoord3fv(GLfloat *t);
|
||||
void glTexCoord4f(GLfloat s, GLfloat t, GLfloat r, GLfloat q);
|
||||
void glTexCoord4fv(GLfloat *t);
|
||||
void glshim_glTexCoord1f(GLfloat s);
|
||||
void glshim_glTexCoord1fv(GLfloat *t);
|
||||
void glshim_glTexCoord2f(GLfloat s, GLfloat t);
|
||||
void glshim_glTexCoord2fv(GLfloat *t);
|
||||
void glshim_glTexCoord3f(GLfloat s, GLfloat t, GLfloat r);
|
||||
void glshim_glTexCoord3fv(GLfloat *t);
|
||||
void glshim_glTexCoord4fv(GLfloat *t);
|
||||
|
||||
void glMultiTexCoord1f(GLenum target, GLfloat s);
|
||||
void glMultiTexCoord1fv(GLenum target, GLfloat *t);
|
||||
void glMultiTexCoord2fv(GLenum target, GLfloat *t);
|
||||
void glMultiTexCoord3f(GLenum target, GLfloat s, GLfloat t, GLfloat r);
|
||||
void glMultiTexCoord3fv(GLenum target, GLfloat *t);
|
||||
void glMultiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
|
||||
void glMultiTexCoord4fv(GLenum target, GLfloat *t);
|
||||
void glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t);
|
||||
void glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r);
|
||||
void glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
|
||||
void glMultiTexCoord2fvARB(GLenum target, GLfloat *t);
|
||||
void glMultiTexCoord3fvARB(GLenum target, GLfloat *t);
|
||||
void glMultiTexCoord4fvARB(GLenum target, GLfloat *t);
|
||||
void glshim_glMultiTexCoord1f(GLenum target, GLfloat s);
|
||||
void glshim_glMultiTexCoord1fv(GLenum target, GLfloat *t);
|
||||
void glshim_glMultiTexCoord2f(GLenum target, GLfloat s, GLfloat t);
|
||||
void glshim_glMultiTexCoord2fv(GLenum target, GLfloat *t);
|
||||
void glshim_glMultiTexCoord3f(GLenum target, GLfloat s, GLfloat t, GLfloat r);
|
||||
void glshim_glMultiTexCoord3fv(GLenum target, GLfloat *t);
|
||||
void glshim_glMultiTexCoord4fv(GLenum target, GLfloat *t);
|
||||
|
||||
void glGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat *params);
|
||||
void glshim_glGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat *params);
|
||||
|
||||
void glPolygonMode(GLenum face, GLenum mode);
|
||||
void glshim_glPolygonMode(GLenum face, GLenum mode);
|
||||
|
||||
// texgen
|
||||
void glTexGend(GLenum coord, GLenum pname, GLdouble param);
|
||||
void glTexGeni(GLenum coord, GLenum pname, GLint param);
|
||||
void glTexGenf(GLenum coord, GLenum pname, GLfloat param);
|
||||
void glTexGendv(GLenum coord, GLenum pname, const GLdouble *params);
|
||||
void glTexGenfv(GLenum coord, GLenum pname, const GLfloat *params);
|
||||
void glTexGeniv(GLenum coord, GLenum pname, const GLint *params);
|
||||
void glshim_glTexGend(GLenum coord, GLenum pname, GLdouble param);
|
||||
void glshim_glTexGeni(GLenum coord, GLenum pname, GLint param);
|
||||
void glshim_glTexGenf(GLenum coord, GLenum pname, GLfloat param);
|
||||
void glshim_glTexGendv(GLenum coord, GLenum pname, const GLdouble *params);
|
||||
void glshim_glTexGenfv(GLenum coord, GLenum pname, const GLfloat *params);
|
||||
void glshim_glTexGeniv(GLenum coord, GLenum pname, const GLint *params);
|
||||
|
||||
// transforms
|
||||
void glRotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
|
||||
void glScaled(GLdouble x, GLdouble y, GLdouble z);
|
||||
void glTranslated(GLdouble x, GLdouble y, GLdouble z);
|
||||
void glshim_glRotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
|
||||
void glshim_glScaled(GLdouble x, GLdouble y, GLdouble z);
|
||||
void glshim_glTranslated(GLdouble x, GLdouble y, GLdouble z);
|
||||
|
||||
// vertex
|
||||
void glVertex2f(GLfloat x, GLfloat y);
|
||||
void glVertex2fv(GLfloat *v);
|
||||
void glVertex3fv(GLfloat *v);
|
||||
void glVertex4f(GLfloat r, GLfloat g, GLfloat b, GLfloat w);
|
||||
void glVertex4fv(GLfloat *v);
|
||||
void glshim_glVertex2f(GLfloat x, GLfloat y);
|
||||
void glshim_glVertex2fv(GLfloat *v);
|
||||
void glshim_glVertex3fv(GLfloat *v);
|
||||
void glshim_glVertex3f(GLfloat r, GLfloat g, GLfloat b);
|
||||
void glshim_glVertex4fv(GLfloat *v);
|
||||
|
||||
// OES wrappers
|
||||
|
||||
@@ -150,56 +140,56 @@ void glOrthofOES(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLflo
|
||||
// basic thunking
|
||||
|
||||
#define THUNK(suffix, type) \
|
||||
void glColor3##suffix##v(const type *v); \
|
||||
void glColor3##suffix(type r, type g, type b); \
|
||||
void glColor4##suffix##v(const type *v); \
|
||||
void glColor4##suffix(type r, type g, type b, type a); \
|
||||
void glSecondaryColor3##suffix##v(const type *v); \
|
||||
void glSecondaryColor3##suffix(type r, type g, type b); \
|
||||
void glIndex##suffix##v(const type *c); \
|
||||
void glIndex##suffix(type c); \
|
||||
void glNormal3##suffix##v(const type *v); \
|
||||
void glNormal3##suffix(type x, type y, type z); \
|
||||
void glRasterPos2##suffix##v(type *v); \
|
||||
void glRasterPos2##suffix(type x, type y); \
|
||||
void glRasterPos3##suffix##v(type *v); \
|
||||
void glRasterPos3##suffix(type x, type y, type z); \
|
||||
void glRasterPos4##suffix##v(type *v); \
|
||||
void glRasterPos4##suffix(type x, type y, type z, type w); \
|
||||
void glWindowPos2##suffix##v(type *v); \
|
||||
void glWindowPos2##suffix(type x, type y); \
|
||||
void glWindowPos3##suffix##v(type *v); \
|
||||
void glWindowPos3##suffix(type x, type y, type z); \
|
||||
void glVertex2##suffix##v(type *v); \
|
||||
void glVertex2##suffix(type x, type y); \
|
||||
void glVertex3##suffix##v(type *v); \
|
||||
void glVertex3##suffix(type x, type y, type z); \
|
||||
void glVertex4##suffix(type x, type y, type z, type w); \
|
||||
void glVertex4##suffix##v(type *v); \
|
||||
void glTexCoord1##suffix(type s); \
|
||||
void glTexCoord1##suffix##v(type *t); \
|
||||
void glTexCoord2##suffix(type s, type t); \
|
||||
void glTexCoord2##suffix##v(type *t); \
|
||||
void glTexCoord3##suffix(type s, type t, type r); \
|
||||
void glTexCoord3##suffix##v(type *t); \
|
||||
void glTexCoord4##suffix(type s, type t, type r, type q); \
|
||||
void glTexCoord4##suffix##v(type *t); \
|
||||
void glMultiTexCoord1##suffix(GLenum target, type s); \
|
||||
void glMultiTexCoord1##suffix##v(GLenum target, type *t); \
|
||||
void glMultiTexCoord2##suffix(GLenum target, type s, type t); \
|
||||
void glMultiTexCoord2##suffix##v(GLenum target, type *t); \
|
||||
void glMultiTexCoord3##suffix(GLenum target, type s, type t, type r); \
|
||||
void glMultiTexCoord3##suffix##v(GLenum target, type *t); \
|
||||
void glMultiTexCoord4##suffix(GLenum target, type s, type t, type r, type q); \
|
||||
void glMultiTexCoord4##suffix##v(GLenum target, type *t); \
|
||||
void glMultiTexCoord1##suffix##ARB(GLenum target, type s); \
|
||||
void glMultiTexCoord1##suffix##vARB(GLenum target, type *t); \
|
||||
void glMultiTexCoord2##suffix##ARB(GLenum target, type s, type t); \
|
||||
void glMultiTexCoord2##suffix##vARB(GLenum target, type *t); \
|
||||
void glMultiTexCoord3##suffix##ARB(GLenum target, type s, type t, type r); \
|
||||
void glMultiTexCoord3##suffix##vARB(GLenum target, type *t); \
|
||||
void glMultiTexCoord4##suffix##ARB(GLenum target, type s, type t, type r, type q); \
|
||||
void glMultiTexCoord4##suffix##vARB(GLenum target, type *t);
|
||||
void glshim_glColor3##suffix##v(const type *v); \
|
||||
void glshim_glColor3##suffix(type r, type g, type b); \
|
||||
void glshim_glColor4##suffix##v(const type *v); \
|
||||
void glshim_glColor4##suffix(type r, type g, type b, type a); \
|
||||
void glshim_glSecondaryColor3##suffix##v(const type *v); \
|
||||
void glshim_glSecondaryColor3##suffix(type r, type g, type b); \
|
||||
void glshim_glIndex##suffix##v(const type *c); \
|
||||
void glshim_glIndex##suffix(type c); \
|
||||
void glshim_glNormal3##suffix##v(const type *v); \
|
||||
void glshim_glNormal3##suffix(type x, type y, type z); \
|
||||
void glshim_glRasterPos2##suffix##v(type *v); \
|
||||
void glshim_glRasterPos2##suffix(type x, type y); \
|
||||
void glshim_glRasterPos3##suffix##v(type *v); \
|
||||
void glshim_glRasterPos3##suffix(type x, type y, type z); \
|
||||
void glshim_glRasterPos4##suffix##v(type *v); \
|
||||
void glshim_glRasterPos4##suffix(type x, type y, type z, type w); \
|
||||
void glshim_glWindowPos2##suffix##v(type *v); \
|
||||
void glshim_glWindowPos2##suffix(type x, type y); \
|
||||
void glshim_glWindowPos3##suffix##v(type *v); \
|
||||
void glshim_glWindowPos3##suffix(type x, type y, type z); \
|
||||
void glshim_glVertex2##suffix##v(type *v); \
|
||||
void glshim_glVertex2##suffix(type x, type y); \
|
||||
void glshim_glVertex3##suffix##v(type *v); \
|
||||
void glshim_glVertex3##suffix(type x, type y, type z); \
|
||||
void glshim_glVertex4##suffix(type x, type y, type z, type w); \
|
||||
void glshim_glVertex4##suffix##v(type *v); \
|
||||
void glshim_glTexCoord1##suffix(type s); \
|
||||
void glshim_glTexCoord1##suffix##v(type *t); \
|
||||
void glshim_glTexCoord2##suffix(type s, type t); \
|
||||
void glshim_glTexCoord2##suffix##v(type *t); \
|
||||
void glshim_glTexCoord3##suffix(type s, type t, type r); \
|
||||
void glshim_glTexCoord3##suffix##v(type *t); \
|
||||
void glshim_glTexCoord4##suffix(type s, type t, type r, type q); \
|
||||
void glshim_glTexCoord4##suffix##v(type *t); \
|
||||
void glshim_glMultiTexCoord1##suffix(GLenum target, type s); \
|
||||
void glshim_glMultiTexCoord1##suffix##v(GLenum target, type *t); \
|
||||
void glshim_glMultiTexCoord2##suffix(GLenum target, type s, type t); \
|
||||
void glshim_glMultiTexCoord2##suffix##v(GLenum target, type *t); \
|
||||
void glshim_glMultiTexCoord3##suffix(GLenum target, type s, type t, type r); \
|
||||
void glshim_glMultiTexCoord3##suffix##v(GLenum target, type *t); \
|
||||
void glshim_glMultiTexCoord4##suffix(GLenum target, type s, type t, type r, type q); \
|
||||
void glshim_glMultiTexCoord4##suffix##v(GLenum target, type *t); \
|
||||
void glshim_glMultiTexCoord1##suffix##ARB(GLenum target, type s); \
|
||||
void glshim_glMultiTexCoord1##suffix##vARB(GLenum target, type *t); \
|
||||
void glshim_glMultiTexCoord2##suffix##ARB(GLenum target, type s, type t); \
|
||||
void glshim_glMultiTexCoord2##suffix##vARB(GLenum target, type *t); \
|
||||
void glshim_glMultiTexCoord3##suffix##ARB(GLenum target, type s, type t, type r); \
|
||||
void glshim_glMultiTexCoord3##suffix##vARB(GLenum target, type *t); \
|
||||
void glshim_glMultiTexCoord4##suffix##ARB(GLenum target, type s, type t, type r, type q); \
|
||||
void glshim_glMultiTexCoord4##suffix##vARB(GLenum target, type *t);
|
||||
|
||||
THUNK(b, GLbyte)
|
||||
THUNK(d, GLdouble)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
4773
project/jni/glshim/src/gl/wrap/gles2.h
Normal file → Executable file
4773
project/jni/glshim/src/gl/wrap/gles2.h
Normal file → Executable file
File diff suppressed because it is too large
Load Diff
@@ -1,210 +1,233 @@
|
||||
#ifndef USE_ES2
|
||||
#include "gles.h"
|
||||
#ifndef skip_glBindFramebuffer
|
||||
void glBindFramebuffer(GLenum target, GLuint framebuffer) {
|
||||
void glshim_glBindFramebuffer(GLenum target, GLuint framebuffer) {
|
||||
LOAD_GLES_OES(glBindFramebuffer);
|
||||
#ifndef direct_glBindFramebuffer
|
||||
PUSH_IF_COMPILING(glBindFramebuffer)
|
||||
#endif
|
||||
gles_glBindFramebuffer(target, framebuffer);
|
||||
}
|
||||
void glBindFramebuffer(GLenum target, GLuint framebuffer) __attribute__((alias("glshim_glBindFramebuffer")));
|
||||
#endif
|
||||
#ifndef skip_glBindRenderbuffer
|
||||
void glBindRenderbuffer(GLenum target, GLuint renderbuffer) {
|
||||
void glshim_glBindRenderbuffer(GLenum target, GLuint renderbuffer) {
|
||||
LOAD_GLES_OES(glBindRenderbuffer);
|
||||
#ifndef direct_glBindRenderbuffer
|
||||
PUSH_IF_COMPILING(glBindRenderbuffer)
|
||||
#endif
|
||||
gles_glBindRenderbuffer(target, renderbuffer);
|
||||
}
|
||||
void glBindRenderbuffer(GLenum target, GLuint renderbuffer) __attribute__((alias("glshim_glBindRenderbuffer")));
|
||||
#endif
|
||||
#ifndef skip_glBlendColor
|
||||
void glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) {
|
||||
void glshim_glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) {
|
||||
LOAD_GLES_OES(glBlendColor);
|
||||
#ifndef direct_glBlendColor
|
||||
PUSH_IF_COMPILING(glBlendColor)
|
||||
#endif
|
||||
gles_glBlendColor(red, green, blue, alpha);
|
||||
}
|
||||
void glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) __attribute__((alias("glshim_glBlendColor")));
|
||||
#endif
|
||||
#ifndef skip_glBlendEquation
|
||||
void glBlendEquation(GLenum mode) {
|
||||
void glshim_glBlendEquation(GLenum mode) {
|
||||
LOAD_GLES_OES(glBlendEquation);
|
||||
#ifndef direct_glBlendEquation
|
||||
PUSH_IF_COMPILING(glBlendEquation)
|
||||
#endif
|
||||
gles_glBlendEquation(mode);
|
||||
}
|
||||
void glBlendEquation(GLenum mode) __attribute__((alias("glshim_glBlendEquation")));
|
||||
#endif
|
||||
#ifndef skip_glBlendEquationSeparate
|
||||
void glBlendEquationSeparate(GLenum modeRGB, GLenum modeA) {
|
||||
void glshim_glBlendEquationSeparate(GLenum modeRGB, GLenum modeA) {
|
||||
LOAD_GLES_OES(glBlendEquationSeparate);
|
||||
#ifndef direct_glBlendEquationSeparate
|
||||
PUSH_IF_COMPILING(glBlendEquationSeparate)
|
||||
#endif
|
||||
gles_glBlendEquationSeparate(modeRGB, modeA);
|
||||
}
|
||||
void glBlendEquationSeparate(GLenum modeRGB, GLenum modeA) __attribute__((alias("glshim_glBlendEquationSeparate")));
|
||||
#endif
|
||||
#ifndef skip_glBlendFuncSeparate
|
||||
void glBlendFuncSeparate(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) {
|
||||
void glshim_glBlendFuncSeparate(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) {
|
||||
LOAD_GLES_OES(glBlendFuncSeparate);
|
||||
#ifndef direct_glBlendFuncSeparate
|
||||
PUSH_IF_COMPILING(glBlendFuncSeparate)
|
||||
#endif
|
||||
gles_glBlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha);
|
||||
}
|
||||
void glBlendFuncSeparate(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) __attribute__((alias("glshim_glBlendFuncSeparate")));
|
||||
#endif
|
||||
#ifndef skip_glCheckFramebufferStatus
|
||||
GLenum glCheckFramebufferStatus(GLenum target) {
|
||||
GLenum glshim_glCheckFramebufferStatus(GLenum target) {
|
||||
LOAD_GLES_OES(glCheckFramebufferStatus);
|
||||
#ifndef direct_glCheckFramebufferStatus
|
||||
PUSH_IF_COMPILING(glCheckFramebufferStatus)
|
||||
#endif
|
||||
return gles_glCheckFramebufferStatus(target);
|
||||
}
|
||||
GLenum glCheckFramebufferStatus(GLenum target) __attribute__((alias("glshim_glCheckFramebufferStatus")));
|
||||
#endif
|
||||
#ifndef skip_glDeleteFramebuffers
|
||||
void glDeleteFramebuffers(GLsizei n, GLuint * framebuffers) {
|
||||
void glshim_glDeleteFramebuffers(GLsizei n, GLuint * framebuffers) {
|
||||
LOAD_GLES_OES(glDeleteFramebuffers);
|
||||
#ifndef direct_glDeleteFramebuffers
|
||||
PUSH_IF_COMPILING(glDeleteFramebuffers)
|
||||
#endif
|
||||
gles_glDeleteFramebuffers(n, framebuffers);
|
||||
}
|
||||
void glDeleteFramebuffers(GLsizei n, GLuint * framebuffers) __attribute__((alias("glshim_glDeleteFramebuffers")));
|
||||
#endif
|
||||
#ifndef skip_glDeleteRenderbuffers
|
||||
void glDeleteRenderbuffers(GLsizei n, GLuint * renderbuffers) {
|
||||
void glshim_glDeleteRenderbuffers(GLsizei n, GLuint * renderbuffers) {
|
||||
LOAD_GLES_OES(glDeleteRenderbuffers);
|
||||
#ifndef direct_glDeleteRenderbuffers
|
||||
PUSH_IF_COMPILING(glDeleteRenderbuffers)
|
||||
#endif
|
||||
gles_glDeleteRenderbuffers(n, renderbuffers);
|
||||
}
|
||||
void glDeleteRenderbuffers(GLsizei n, GLuint * renderbuffers) __attribute__((alias("glshim_glDeleteRenderbuffers")));
|
||||
#endif
|
||||
#ifndef skip_glDrawTexf
|
||||
void glDrawTexf(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height) {
|
||||
void glshim_glDrawTexf(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height) {
|
||||
LOAD_GLES_OES(glDrawTexf);
|
||||
#ifndef direct_glDrawTexf
|
||||
PUSH_IF_COMPILING(glDrawTexf)
|
||||
#endif
|
||||
gles_glDrawTexf(x, y, z, width, height);
|
||||
}
|
||||
void glDrawTexf(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height) __attribute__((alias("glshim_glDrawTexf")));
|
||||
#endif
|
||||
#ifndef skip_glDrawTexi
|
||||
void glDrawTexi(GLint x, GLint y, GLint z, GLint width, GLint height) {
|
||||
void glshim_glDrawTexi(GLint x, GLint y, GLint z, GLint width, GLint height) {
|
||||
LOAD_GLES_OES(glDrawTexi);
|
||||
#ifndef direct_glDrawTexi
|
||||
PUSH_IF_COMPILING(glDrawTexi)
|
||||
#endif
|
||||
gles_glDrawTexi(x, y, z, width, height);
|
||||
}
|
||||
void glDrawTexi(GLint x, GLint y, GLint z, GLint width, GLint height) __attribute__((alias("glshim_glDrawTexi")));
|
||||
#endif
|
||||
#ifndef skip_glFramebufferRenderbuffer
|
||||
void glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) {
|
||||
void glshim_glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) {
|
||||
LOAD_GLES_OES(glFramebufferRenderbuffer);
|
||||
#ifndef direct_glFramebufferRenderbuffer
|
||||
PUSH_IF_COMPILING(glFramebufferRenderbuffer)
|
||||
#endif
|
||||
gles_glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
|
||||
}
|
||||
void glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) __attribute__((alias("glshim_glFramebufferRenderbuffer")));
|
||||
#endif
|
||||
#ifndef skip_glFramebufferTexture2D
|
||||
void glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {
|
||||
void glshim_glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) {
|
||||
LOAD_GLES_OES(glFramebufferTexture2D);
|
||||
#ifndef direct_glFramebufferTexture2D
|
||||
PUSH_IF_COMPILING(glFramebufferTexture2D)
|
||||
#endif
|
||||
gles_glFramebufferTexture2D(target, attachment, textarget, texture, level);
|
||||
}
|
||||
void glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) __attribute__((alias("glshim_glFramebufferTexture2D")));
|
||||
#endif
|
||||
#ifndef skip_glGenFramebuffers
|
||||
void glGenFramebuffers(GLsizei n, GLuint * ids) {
|
||||
void glshim_glGenFramebuffers(GLsizei n, GLuint * ids) {
|
||||
LOAD_GLES_OES(glGenFramebuffers);
|
||||
#ifndef direct_glGenFramebuffers
|
||||
PUSH_IF_COMPILING(glGenFramebuffers)
|
||||
#endif
|
||||
gles_glGenFramebuffers(n, ids);
|
||||
}
|
||||
void glGenFramebuffers(GLsizei n, GLuint * ids) __attribute__((alias("glshim_glGenFramebuffers")));
|
||||
#endif
|
||||
#ifndef skip_glGenRenderbuffers
|
||||
void glGenRenderbuffers(GLsizei n, GLuint * renderbuffers) {
|
||||
void glshim_glGenRenderbuffers(GLsizei n, GLuint * renderbuffers) {
|
||||
LOAD_GLES_OES(glGenRenderbuffers);
|
||||
#ifndef direct_glGenRenderbuffers
|
||||
PUSH_IF_COMPILING(glGenRenderbuffers)
|
||||
#endif
|
||||
gles_glGenRenderbuffers(n, renderbuffers);
|
||||
}
|
||||
void glGenRenderbuffers(GLsizei n, GLuint * renderbuffers) __attribute__((alias("glshim_glGenRenderbuffers")));
|
||||
#endif
|
||||
#ifndef skip_glGenerateMipmap
|
||||
void glGenerateMipmap(GLenum target) {
|
||||
void glshim_glGenerateMipmap(GLenum target) {
|
||||
LOAD_GLES_OES(glGenerateMipmap);
|
||||
#ifndef direct_glGenerateMipmap
|
||||
PUSH_IF_COMPILING(glGenerateMipmap)
|
||||
#endif
|
||||
gles_glGenerateMipmap(target);
|
||||
}
|
||||
void glGenerateMipmap(GLenum target) __attribute__((alias("glshim_glGenerateMipmap")));
|
||||
#endif
|
||||
#ifndef skip_glGetFramebufferAttachmentParameteriv
|
||||
void glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint * params) {
|
||||
void glshim_glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint * params) {
|
||||
LOAD_GLES_OES(glGetFramebufferAttachmentParameteriv);
|
||||
#ifndef direct_glGetFramebufferAttachmentParameteriv
|
||||
PUSH_IF_COMPILING(glGetFramebufferAttachmentParameteriv)
|
||||
#endif
|
||||
gles_glGetFramebufferAttachmentParameteriv(target, attachment, pname, params);
|
||||
}
|
||||
void glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint * params) __attribute__((alias("glshim_glGetFramebufferAttachmentParameteriv")));
|
||||
#endif
|
||||
#ifndef skip_glGetRenderbufferParameteriv
|
||||
void glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint * params) {
|
||||
void glshim_glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint * params) {
|
||||
LOAD_GLES_OES(glGetRenderbufferParameteriv);
|
||||
#ifndef direct_glGetRenderbufferParameteriv
|
||||
PUSH_IF_COMPILING(glGetRenderbufferParameteriv)
|
||||
#endif
|
||||
gles_glGetRenderbufferParameteriv(target, pname, params);
|
||||
}
|
||||
void glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint * params) __attribute__((alias("glshim_glGetRenderbufferParameteriv")));
|
||||
#endif
|
||||
#ifndef skip_glIsFramebuffer
|
||||
GLboolean glIsFramebuffer(GLuint framebuffer) {
|
||||
GLboolean glshim_glIsFramebuffer(GLuint framebuffer) {
|
||||
LOAD_GLES_OES(glIsFramebuffer);
|
||||
#ifndef direct_glIsFramebuffer
|
||||
PUSH_IF_COMPILING(glIsFramebuffer)
|
||||
#endif
|
||||
return gles_glIsFramebuffer(framebuffer);
|
||||
}
|
||||
GLboolean glIsFramebuffer(GLuint framebuffer) __attribute__((alias("glshim_glIsFramebuffer")));
|
||||
#endif
|
||||
#ifndef skip_glIsRenderbuffer
|
||||
GLboolean glIsRenderbuffer(GLuint renderbuffer) {
|
||||
GLboolean glshim_glIsRenderbuffer(GLuint renderbuffer) {
|
||||
LOAD_GLES_OES(glIsRenderbuffer);
|
||||
#ifndef direct_glIsRenderbuffer
|
||||
PUSH_IF_COMPILING(glIsRenderbuffer)
|
||||
#endif
|
||||
return gles_glIsRenderbuffer(renderbuffer);
|
||||
}
|
||||
GLboolean glIsRenderbuffer(GLuint renderbuffer) __attribute__((alias("glshim_glIsRenderbuffer")));
|
||||
#endif
|
||||
#ifndef skip_glRenderbufferStorage
|
||||
void glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) {
|
||||
void glshim_glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) {
|
||||
LOAD_GLES_OES(glRenderbufferStorage);
|
||||
#ifndef direct_glRenderbufferStorage
|
||||
PUSH_IF_COMPILING(glRenderbufferStorage)
|
||||
#endif
|
||||
gles_glRenderbufferStorage(target, internalformat, width, height);
|
||||
}
|
||||
void glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) __attribute__((alias("glshim_glRenderbufferStorage")));
|
||||
#endif
|
||||
#ifndef skip_glTexGenfv
|
||||
void glTexGenfv(GLenum coord, GLenum pname, const GLfloat * params) {
|
||||
void glshim_glTexGenfv(GLenum coord, GLenum pname, const GLfloat * params) {
|
||||
LOAD_GLES_OES(glTexGenfv);
|
||||
#ifndef direct_glTexGenfv
|
||||
PUSH_IF_COMPILING(glTexGenfv)
|
||||
#endif
|
||||
gles_glTexGenfv(coord, pname, params);
|
||||
}
|
||||
void glTexGenfv(GLenum coord, GLenum pname, const GLfloat * params) __attribute__((alias("glshim_glTexGenfv")));
|
||||
#endif
|
||||
#ifndef skip_glTexGeni
|
||||
void glTexGeni(GLenum coord, GLenum pname, GLint param) {
|
||||
void glshim_glTexGeni(GLenum coord, GLenum pname, GLint param) {
|
||||
LOAD_GLES_OES(glTexGeni);
|
||||
#ifndef direct_glTexGeni
|
||||
PUSH_IF_COMPILING(glTexGeni)
|
||||
#endif
|
||||
gles_glTexGeni(coord, pname, param);
|
||||
}
|
||||
void glTexGeni(GLenum coord, GLenum pname, GLint param) __attribute__((alias("glshim_glTexGeni")));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1,74 +1,75 @@
|
||||
#include "stub.h"
|
||||
|
||||
#define STUB(def)\
|
||||
def {\
|
||||
#define STUB(ret, def, args)\
|
||||
ret glshim_ ## def args {\
|
||||
char *debug = getenv("LIBGL_DEBUG");\
|
||||
if (debug && strcmp(debug, "1") == 0)\
|
||||
printf("stub: %s;\n", #def);\
|
||||
}
|
||||
} \
|
||||
ret def args __attribute((alias("glshim_"#def)));
|
||||
|
||||
STUB(void glFogCoordd(GLdouble coord))
|
||||
STUB(void glFogCoordf(GLfloat coord))
|
||||
STUB(void glFogCoorddv(const GLdouble *coord))
|
||||
STUB(void glFogCoordfv(const GLfloat *coord))
|
||||
STUB(void,glFogCoordd,(GLdouble coord));
|
||||
STUB(void,glFogCoordf,(GLfloat coord));
|
||||
STUB(void,glFogCoorddv,(const GLdouble *coord));
|
||||
STUB(void,glFogCoordfv,(const GLfloat *coord));
|
||||
#ifdef BCMHOST
|
||||
STUB(void glDiscardFramebufferEXT(GLenum target, GLsizei numAttachments, const GLenum *attachments))
|
||||
STUB(void,glDiscardFramebufferEXT,(GLenum target, GLsizei numAttachments, const GLenum *attachments));
|
||||
#endif
|
||||
|
||||
#ifdef USE_ES2
|
||||
STUB(void glClipPlanef(GLenum plane, const GLfloat *equation));
|
||||
STUB(void glDisableClientState(GLenum state));
|
||||
STUB(void glEnableClientState(GLenum state));
|
||||
STUB(void glFogf(GLenum pname, GLfloat param));
|
||||
STUB(void glFogfv(GLenum pname, const GLfloat *params));
|
||||
STUB(void glFrustumf(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat near, GLfloat far));
|
||||
STUB(void glGetClipPlanef(GLenum plane, GLfloat *equation));
|
||||
STUB(void glLightf(GLenum light, GLenum pname, GLfloat param));
|
||||
STUB(void glLightfv(GLenum light, GLenum pname, const GLfloat *params));
|
||||
STUB(void glLoadIdentity());
|
||||
STUB(void glLoadMatrixf(const GLfloat *m));
|
||||
STUB(void glMaterialf(GLenum face, GLenum pname, GLfloat param));
|
||||
STUB(void glMatrixMode(GLenum mode));
|
||||
STUB(void glMultiTexCoord4f(GLenum target, GLfloat s, GLfloat r, GLfloat q, GLfloat t));
|
||||
STUB(void glMultMatrixf(const GLfloat *m));
|
||||
STUB(void glOrthof(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat nearVal, GLfloat farVal));
|
||||
STUB(void glPopMatrix());
|
||||
STUB(void glPushMatrix());
|
||||
STUB(void glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z));
|
||||
STUB(void glScalef(GLfloat x, GLfloat y, GLfloat z));
|
||||
STUB(void glTexEnvf(GLenum target, GLenum pname, GLfloat param));
|
||||
STUB(void glTexEnvi(GLenum target, GLenum pname, GLint param));
|
||||
STUB(void glTranslatef(GLfloat x, GLfloat y, GLfloat z));
|
||||
STUB(void,glClipPlanef,(GLenum plane, const GLfloat *equation));
|
||||
STUB(void,glDisableClientState,(GLenum state));
|
||||
STUB(void,glEnableClientState,(GLenum state));
|
||||
STUB(void,glFogf,(GLenum pname, GLfloat param));
|
||||
STUB(void,glFogfv,(GLenum pname, const GLfloat *params));
|
||||
STUB(void,glFrustumf,(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat near, GLfloat far));
|
||||
STUB(void,glGetClipPlanef,(GLenum plane, GLfloat *equation));
|
||||
STUB(void,glLightf,(GLenum light, GLenum pname, GLfloat param));
|
||||
STUB(void,glLightfv,(GLenum light, GLenum pname, const GLfloat *params));
|
||||
STUB(void,glLoadIdentity,());
|
||||
STUB(void,glLoadMatrixf,(const GLfloat *m));
|
||||
STUB(void,glMaterialf,(GLenum face, GLenum pname, GLfloat param));
|
||||
STUB(void,glMatrixMode,(GLenum mode));
|
||||
STUB(void,glMultiTexCoord4f,(GLenum target, GLfloat s, GLfloat r, GLfloat q, GLfloat t));
|
||||
STUB(void,glMultMatrixf,(const GLfloat *m));
|
||||
STUB(void,glOrthof,(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat nearVal, GLfloat farVal));
|
||||
STUB(void,glPopMatrix,());
|
||||
STUB(void,glPushMatrix,());
|
||||
STUB(void,glRotatef,(GLfloat angle, GLfloat x, GLfloat y, GLfloat z));
|
||||
STUB(void,glScalef,(GLfloat x, GLfloat y, GLfloat z));
|
||||
STUB(void,glTexEnvf,(GLenum target, GLenum pname, GLfloat param));
|
||||
STUB(void,glTexEnvi,(GLenum target, GLenum pname, GLint param));
|
||||
STUB(void,glTranslatef,(GLfloat x, GLfloat y, GLfloat z));
|
||||
#endif
|
||||
|
||||
/*
|
||||
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 glCopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type))
|
||||
STUB(void glDrawBuffer(GLenum mode))
|
||||
STUB(void glEdgeFlag(GLboolean flag))
|
||||
STUB(void glIndexf(GLfloat c))
|
||||
STUB(void glPolygonStipple(const GLubyte *mask))
|
||||
STUB(void glReadBuffer(GLenum mode))
|
||||
//STUB(void glSecondaryColor3f(GLfloat r, GLfloat g, GLfloat b))
|
||||
STUB(void glColorTable (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table))
|
||||
STUB(void,glClearAccum,(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha));
|
||||
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));
|
||||
STUB(void,glIndexf,(GLfloat c));
|
||||
STUB(void,glPolygonStipple,(const GLubyte *mask));
|
||||
STUB(void,glReadBuffer,(GLenum mode));
|
||||
//STUB(void glSecondaryColor3f(GLfloat r, GLfloat g, GLfloat b));
|
||||
STUB(void,glColorTable,(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table));
|
||||
|
||||
STUB(void glAccum(GLenum op, GLfloat value))
|
||||
STUB(void glPrioritizeTextures(GLsizei n, const GLuint *textures, const GLclampf *priorities))
|
||||
STUB(void glPixelMapfv(GLenum map, GLsizei mapsize, const GLfloat *values))
|
||||
STUB(void glPixelMapuiv(GLenum map,GLsizei mapsize, const GLuint *values))
|
||||
STUB(void glPixelMapusv(GLenum map,GLsizei mapsize, const GLushort *values))
|
||||
STUB(void glPassThrough(GLfloat token))
|
||||
STUB(void glIndexMask(GLuint mask))
|
||||
STUB(void glGetPixelMapfv(GLenum map, GLfloat *data))
|
||||
STUB(void glGetPixelMapuiv(GLenum map, GLuint *data))
|
||||
STUB(void glGetPixelMapusv(GLenum map, GLushort *data))
|
||||
STUB(void glClearIndex(GLfloat c))
|
||||
STUB(void glGetPolygonStipple(GLubyte *pattern))
|
||||
STUB(void glFeedbackBuffer(GLsizei size, GLenum type, GLfloat *buffer))
|
||||
STUB(void glEdgeFlagv(GLboolean *flag))
|
||||
//STUB(void glIndexPointer(GLenum type, GLsizei stride, const GLvoid * pointer))
|
||||
STUB(void,glAccum,(GLenum op, GLfloat value));
|
||||
STUB(void,glPrioritizeTextures,(GLsizei n, const GLuint *textures, const GLclampf *priorities));
|
||||
STUB(void,glPixelMapfv,(GLenum map, GLsizei mapsize, const GLfloat *values));
|
||||
STUB(void,glPixelMapuiv,(GLenum map,GLsizei mapsize, const GLuint *values));
|
||||
STUB(void,glPixelMapusv,(GLenum map,GLsizei mapsize, const GLushort *values));
|
||||
STUB(void,glPassThrough,(GLfloat token));
|
||||
STUB(void,glIndexMask,(GLuint mask));
|
||||
STUB(void,glGetPixelMapfv,(GLenum map, GLfloat *data));
|
||||
STUB(void,glGetPixelMapuiv,(GLenum map, GLuint *data));
|
||||
STUB(void,glGetPixelMapusv,(GLenum map, GLushort *data));
|
||||
STUB(void,glClearIndex,(GLfloat c));
|
||||
STUB(void,glGetPolygonStipple,(GLubyte *pattern));
|
||||
STUB(void,glFeedbackBuffer,(GLsizei size, GLenum type, GLfloat *buffer));
|
||||
STUB(void,glEdgeFlagv,(GLboolean *flag));
|
||||
//STUB(void glIndexPointer(GLenum type, GLsizei stride, const GLvoid * pointer));
|
||||
#undef STUB
|
||||
|
||||
@@ -1,40 +1,40 @@
|
||||
#include "../gl.h"
|
||||
|
||||
//GLint glRenderMode(GLenum mode);
|
||||
//void glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha);
|
||||
void glBlendEquationSeparatei(GLuint buf, GLenum modeRGB, GLenum modeAlpha);
|
||||
//void glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
|
||||
void glBlendFuncSeparatei(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
|
||||
void glColorMaterial(GLenum face, GLenum mode);
|
||||
void glCopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type);
|
||||
void glDrawBuffer(GLenum mode);
|
||||
void glEdgeFlag(GLboolean flag);
|
||||
void glFogCoordd(GLdouble coord);
|
||||
void glFogCoorddv(const GLdouble *coord);
|
||||
void glFogCoordf(GLfloat coord);
|
||||
void glFogCoordfv(const GLfloat *coord);
|
||||
//void glGetTexImage(GLenum target, GLint level, GLenum format, GLenum type, GLvoid * img);
|
||||
//void glGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat *params);
|
||||
//void glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint *params);
|
||||
void glIndexf(GLfloat c);
|
||||
void glLightModeli(GLenum pname, GLint param);
|
||||
void glPolygonStipple(const GLubyte *mask);
|
||||
void glReadBuffer(GLenum mode);
|
||||
void glSecondaryColor3f(GLfloat r, GLfloat g, GLfloat b);
|
||||
void glColorTable (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
|
||||
//void glIndexPointer(GLenum type, GLsizei stride, const GLvoid * pointer);
|
||||
//GLint glshim_glRenderMode(GLenum mode);
|
||||
//void glshim_glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha);
|
||||
void glshim_glBlendEquationSeparatei(GLuint buf, GLenum modeRGB, GLenum modeAlpha);
|
||||
//void glshim_glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
|
||||
void glshim_glBlendFuncSeparatei(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
|
||||
void glshim_glColorMaterial(GLenum face, GLenum mode);
|
||||
void glshim_glCopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type);
|
||||
void glshim_glDrawBuffer(GLenum mode);
|
||||
void glshim_glEdgeFlag(GLboolean flag);
|
||||
void glshim_glFogCoordd(GLdouble coord);
|
||||
void glshim_glFogCoorddv(const GLdouble *coord);
|
||||
void glshim_glFogCoordf(GLfloat coord);
|
||||
void glshim_glFogCoordfv(const GLfloat *coord);
|
||||
//void glshim_glGetTexImage(GLenum target, GLint level, GLenum format, GLenum type, GLvoid * img);
|
||||
//void glshim_glGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat *params);
|
||||
//void glshim_glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint *params);
|
||||
void glshim_glIndexf(GLfloat c);
|
||||
void glshim_glLightModeli(GLenum pname, GLint param);
|
||||
void glshim_glPolygonStipple(const GLubyte *mask);
|
||||
void glshim_glReadBuffer(GLenum mode);
|
||||
void glshim_glSecondaryColor3f(GLfloat r, GLfloat g, GLfloat b);
|
||||
void glshim_glColorTable (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
|
||||
//void glshim_glIndexPointer(GLenum type, GLsizei stride, const GLvoid * pointer);
|
||||
|
||||
void glAccum(GLenum op, GLfloat value);
|
||||
void glPrioritizeTextures(GLsizei n, const GLuint *textures, const GLclampf *priorities);
|
||||
void glPixelMapfv(GLenum map, GLsizei mapsize, const GLfloat *values);
|
||||
void glPixelMapuiv(GLenum map,GLsizei mapsize, const GLuint *values);
|
||||
void glPixelMapusv(GLenum map,GLsizei mapsize, const GLushort *values);
|
||||
void glPassThrough(GLfloat token);
|
||||
void glIndexMask(GLuint mask);
|
||||
void glGetPixelMapfv(GLenum map, GLfloat *data);
|
||||
void glGetPixelMapuiv(GLenum map, GLuint *data);
|
||||
void glGetPixelMapusv(GLenum map, GLushort *data);
|
||||
void glClearIndex(GLfloat c);
|
||||
void glGetPolygonStipple(GLubyte *pattern);
|
||||
void glFeedbackBuffer(GLsizei size, GLenum type, GLfloat *buffer);
|
||||
void glEdgeFlagv(GLboolean *flag);
|
||||
void glshim_glAccum(GLenum op, GLfloat value);
|
||||
void glshim_glPrioritizeTextures(GLsizei n, const GLuint *textures, const GLclampf *priorities);
|
||||
void glshim_glPixelMapfv(GLenum map, GLsizei mapsize, const GLfloat *values);
|
||||
void glshim_glPixelMapuiv(GLenum map,GLsizei mapsize, const GLuint *values);
|
||||
void glshim_glPixelMapusv(GLenum map,GLsizei mapsize, const GLushort *values);
|
||||
void glshim_glPassThrough(GLfloat token);
|
||||
void glshim_glIndexMask(GLuint mask);
|
||||
void glshim_glGetPixelMapfv(GLenum map, GLfloat *data);
|
||||
void glshim_glGetPixelMapuiv(GLenum map, GLuint *data);
|
||||
void glshim_glGetPixelMapusv(GLenum map, GLushort *data);
|
||||
void glshim_glClearIndex(GLfloat c);
|
||||
void glshim_glGetPolygonStipple(GLubyte *pattern);
|
||||
void glshim_glFeedbackBuffer(GLsizei size, GLenum type, GLfloat *buffer);
|
||||
void glshim_glEdgeFlagv(GLboolean *flag);
|
||||
|
||||
@@ -1,168 +1,168 @@
|
||||
EX(glActiveTexture);
|
||||
EX(glAlphaFunc);
|
||||
EX(glAlphaFuncx);
|
||||
EX(glBindBuffer);
|
||||
EX(glBindFramebuffer);
|
||||
EX(glBindRenderbuffer);
|
||||
EX(glBindTexture);
|
||||
//EX(glBlendColor);
|
||||
EX(glBlendEquation);
|
||||
EX(glBlendEquationSeparate);
|
||||
EX(glBlendFunc);
|
||||
EX(glBlendFuncSeparate);
|
||||
EX(glBufferData);
|
||||
EX(glBufferSubData);
|
||||
EX(glCheckFramebufferStatus);
|
||||
EX(glClear);
|
||||
EX(glClearColor);
|
||||
EX(glClearColorx);
|
||||
EX(glClearDepthf);
|
||||
EX(glClearDepthx);
|
||||
EX(glClearStencil);
|
||||
EX(glClientActiveTexture);
|
||||
EX(glClipPlanef);
|
||||
EX(glClipPlanex);
|
||||
EX(glColor4f);
|
||||
EX(glColor4ub);
|
||||
EX(glColor4x);
|
||||
EX(glColorMask);
|
||||
EX(glColorPointer);
|
||||
EX(glCompressedTexImage2D);
|
||||
EX(glCompressedTexSubImage2D);
|
||||
EX(glCopyTexImage2D);
|
||||
EX(glCopyTexSubImage2D);
|
||||
EX(glCullFace);
|
||||
EX(glDeleteBuffers);
|
||||
EX(glDeleteFramebuffers);
|
||||
EX(glDeleteRenderbuffers);
|
||||
EX(glDeleteTextures);
|
||||
EX(glDepthFunc);
|
||||
EX(glDepthMask);
|
||||
EX(glDepthRangef);
|
||||
EX(glDepthRangex);
|
||||
EX(glDisable);
|
||||
EX(glDisableClientState);
|
||||
EX(glDrawArrays);
|
||||
EX(glDrawElements);
|
||||
EX(glDrawTexf);
|
||||
EX(glDrawTexi);
|
||||
EX(glEnable);
|
||||
EX(glEnableClientState);
|
||||
EX(glFinish);
|
||||
EX(glFlush);
|
||||
EX(glFogf);
|
||||
EX(glFogfv);
|
||||
EX(glFogx);
|
||||
EX(glFogxv);
|
||||
EX(glFramebufferRenderbuffer);
|
||||
EX(glFramebufferTexture2D);
|
||||
EX(glFrontFace);
|
||||
EX(glFrustumf);
|
||||
EX(glFrustumx);
|
||||
EX(glGenBuffers);
|
||||
EX(glGenFramebuffers);
|
||||
EX(glGenRenderbuffers);
|
||||
EX(glGenTextures);
|
||||
EX(glGenerateMipmap);
|
||||
EX(glGetBooleanv);
|
||||
EX(glGetBufferParameteriv);
|
||||
EX(glGetClipPlanef);
|
||||
EX(glGetClipPlanex);
|
||||
EX(glGetError);
|
||||
EX(glGetFixedv);
|
||||
EX(glGetFloatv);
|
||||
EX(glGetFramebufferAttachmentParameteriv);
|
||||
EX(glGetIntegerv);
|
||||
EX(glGetLightfv);
|
||||
EX(glGetLightxv);
|
||||
EX(glGetMaterialfv);
|
||||
EX(glGetMaterialxv);
|
||||
EX(glGetPointerv);
|
||||
EX(glGetRenderbufferParameteriv);
|
||||
EX(glGetString);
|
||||
EX(glGetTexEnvfv);
|
||||
EX(glGetTexEnviv);
|
||||
EX(glGetTexEnvxv);
|
||||
EX(glGetTexParameterfv);
|
||||
EX(glGetTexParameteriv);
|
||||
EX(glGetTexParameterxv);
|
||||
EX(glHint);
|
||||
EX(glIsBuffer);
|
||||
EX(glIsEnabled);
|
||||
EX(glIsFramebuffer);
|
||||
EX(glIsRenderbuffer);
|
||||
EX(glIsTexture);
|
||||
EX(glLightModelf);
|
||||
EX(glLightModelfv);
|
||||
EX(glLightModelx);
|
||||
EX(glLightModelxv);
|
||||
EX(glLightf);
|
||||
EX(glLightfv);
|
||||
EX(glLightx);
|
||||
EX(glLightxv);
|
||||
EX(glLineWidth);
|
||||
EX(glLineWidthx);
|
||||
EX(glLoadIdentity);
|
||||
EX(glLoadMatrixf);
|
||||
EX(glLoadMatrixx);
|
||||
EX(glLogicOp);
|
||||
EX(glMaterialf);
|
||||
EX(glMaterialfv);
|
||||
EX(glMaterialx);
|
||||
EX(glMaterialxv);
|
||||
EX(glMatrixMode);
|
||||
EX(glMultMatrixf);
|
||||
EX(glMultMatrixx);
|
||||
EX(glMultiTexCoord4f);
|
||||
EX(glMultiTexCoord4x);
|
||||
EX(glNormal3f);
|
||||
EX(glNormal3x);
|
||||
EX(glNormalPointer);
|
||||
EX(glOrthof);
|
||||
EX(glOrthox);
|
||||
EX(glPixelStorei);
|
||||
EX(glPointParameterf);
|
||||
EX(glPointParameterfv);
|
||||
EX(glPointParameterx);
|
||||
EX(glPointParameterxv);
|
||||
EX(glPointSize);
|
||||
EX(glPointSizePointerOES);
|
||||
EX(glPointSizex);
|
||||
EX(glPolygonOffset);
|
||||
EX(glPolygonOffsetx);
|
||||
EX(glPopMatrix);
|
||||
EX(glPushMatrix);
|
||||
EX(glReadPixels);
|
||||
EX(glRenderbufferStorage);
|
||||
EX(glRotatef);
|
||||
EX(glRotatex);
|
||||
EX(glSampleCoverage);
|
||||
EX(glSampleCoveragex);
|
||||
EX(glScalef);
|
||||
EX(glScalex);
|
||||
EX(glScissor);
|
||||
EX(glShadeModel);
|
||||
EX(glStencilFunc);
|
||||
EX(glStencilMask);
|
||||
EX(glStencilOp);
|
||||
EX(glTexCoordPointer);
|
||||
EX(glTexEnvf);
|
||||
EX(glTexEnvfv);
|
||||
EX(glTexEnvi);
|
||||
EX(glTexEnviv);
|
||||
EX(glTexEnvx);
|
||||
EX(glTexEnvxv);
|
||||
EX(glTexGenfv);
|
||||
EX(glTexGeni);
|
||||
EX(glTexImage2D);
|
||||
EX(glTexParameterf);
|
||||
EX(glTexParameterfv);
|
||||
EX(glTexParameteri);
|
||||
EX(glTexParameteriv);
|
||||
EX(glTexParameterx);
|
||||
EX(glTexParameterxv);
|
||||
EX(glTexSubImage2D);
|
||||
EX(glTranslatef);
|
||||
EX(glTranslatex);
|
||||
EX(glVertexPointer);
|
||||
EX(glViewport);
|
||||
_EX(glActiveTexture);
|
||||
_EX(glAlphaFunc);
|
||||
_EX(glAlphaFuncx);
|
||||
_EX(glBindBuffer);
|
||||
_EX(glBindFramebuffer);
|
||||
_EX(glBindRenderbuffer);
|
||||
_EX(glBindTexture);
|
||||
//_EX(glBlendColor);
|
||||
_EX(glBlendEquation);
|
||||
_EX(glBlendEquationSeparate);
|
||||
_EX(glBlendFunc);
|
||||
_EX(glBlendFuncSeparate);
|
||||
_EX(glBufferData);
|
||||
_EX(glBufferSubData);
|
||||
_EX(glCheckFramebufferStatus);
|
||||
_EX(glClear);
|
||||
_EX(glClearColor);
|
||||
_EX(glClearColorx);
|
||||
_EX(glClearDepthf);
|
||||
_EX(glClearDepthx);
|
||||
_EX(glClearStencil);
|
||||
_EX(glClientActiveTexture);
|
||||
_EX(glClipPlanef);
|
||||
_EX(glClipPlanex);
|
||||
_EX(glColor4f);
|
||||
_EX(glColor4ub);
|
||||
_EX(glColor4x);
|
||||
_EX(glColorMask);
|
||||
_EX(glColorPointer);
|
||||
_EX(glCompressedTexImage2D);
|
||||
_EX(glCompressedTexSubImage2D);
|
||||
_EX(glCopyTexImage2D);
|
||||
_EX(glCopyTexSubImage2D);
|
||||
_EX(glCullFace);
|
||||
_EX(glDeleteBuffers);
|
||||
_EX(glDeleteFramebuffers);
|
||||
_EX(glDeleteRenderbuffers);
|
||||
_EX(glDeleteTextures);
|
||||
_EX(glDepthFunc);
|
||||
_EX(glDepthMask);
|
||||
_EX(glDepthRangef);
|
||||
_EX(glDepthRangex);
|
||||
_EX(glDisable);
|
||||
_EX(glDisableClientState);
|
||||
_EX(glDrawArrays);
|
||||
_EX(glDrawElements);
|
||||
_EX(glDrawTexf);
|
||||
_EX(glDrawTexi);
|
||||
_EX(glEnable);
|
||||
_EX(glEnableClientState);
|
||||
_EX(glFinish);
|
||||
_EX(glFlush);
|
||||
_EX(glFogf);
|
||||
_EX(glFogfv);
|
||||
_EX(glFogx);
|
||||
_EX(glFogxv);
|
||||
_EX(glFramebufferRenderbuffer);
|
||||
_EX(glFramebufferTexture2D);
|
||||
_EX(glFrontFace);
|
||||
_EX(glFrustumf);
|
||||
_EX(glFrustumx);
|
||||
_EX(glGenBuffers);
|
||||
_EX(glGenFramebuffers);
|
||||
_EX(glGenRenderbuffers);
|
||||
_EX(glGenTextures);
|
||||
_EX(glGenerateMipmap);
|
||||
_EX(glGetBooleanv);
|
||||
_EX(glGetBufferParameteriv);
|
||||
_EX(glGetClipPlanef);
|
||||
_EX(glGetClipPlanex);
|
||||
_EX(glGetError);
|
||||
_EX(glGetFixedv);
|
||||
_EX(glGetFloatv);
|
||||
_EX(glGetFramebufferAttachmentParameteriv);
|
||||
_EX(glGetIntegerv);
|
||||
_EX(glGetLightfv);
|
||||
_EX(glGetLightxv);
|
||||
_EX(glGetMaterialfv);
|
||||
_EX(glGetMaterialxv);
|
||||
_EX(glGetPointerv);
|
||||
_EX(glGetRenderbufferParameteriv);
|
||||
_EX(glGetString);
|
||||
_EX(glGetTexEnvfv);
|
||||
_EX(glGetTexEnviv);
|
||||
_EX(glGetTexEnvxv);
|
||||
_EX(glGetTexParameterfv);
|
||||
_EX(glGetTexParameteriv);
|
||||
_EX(glGetTexParameterxv);
|
||||
_EX(glHint);
|
||||
_EX(glIsBuffer);
|
||||
_EX(glIsEnabled);
|
||||
_EX(glIsFramebuffer);
|
||||
_EX(glIsRenderbuffer);
|
||||
_EX(glIsTexture);
|
||||
_EX(glLightModelf);
|
||||
_EX(glLightModelfv);
|
||||
_EX(glLightModelx);
|
||||
_EX(glLightModelxv);
|
||||
_EX(glLightf);
|
||||
_EX(glLightfv);
|
||||
_EX(glLightx);
|
||||
_EX(glLightxv);
|
||||
_EX(glLineWidth);
|
||||
_EX(glLineWidthx);
|
||||
_EX(glLoadIdentity);
|
||||
_EX(glLoadMatrixf);
|
||||
_EX(glLoadMatrixx);
|
||||
_EX(glLogicOp);
|
||||
_EX(glMaterialf);
|
||||
_EX(glMaterialfv);
|
||||
_EX(glMaterialx);
|
||||
_EX(glMaterialxv);
|
||||
_EX(glMatrixMode);
|
||||
_EX(glMultMatrixf);
|
||||
_EX(glMultMatrixx);
|
||||
_EX(glMultiTexCoord4f);
|
||||
_EX(glMultiTexCoord4x);
|
||||
_EX(glNormal3f);
|
||||
_EX(glNormal3x);
|
||||
_EX(glNormalPointer);
|
||||
_EX(glOrthof);
|
||||
_EX(glOrthox);
|
||||
_EX(glPixelStorei);
|
||||
_EX(glPointParameterf);
|
||||
_EX(glPointParameterfv);
|
||||
_EX(glPointParameterx);
|
||||
_EX(glPointParameterxv);
|
||||
_EX(glPointSize);
|
||||
_EX(glPointSizePointerOES);
|
||||
_EX(glPointSizex);
|
||||
_EX(glPolygonOffset);
|
||||
_EX(glPolygonOffsetx);
|
||||
_EX(glPopMatrix);
|
||||
_EX(glPushMatrix);
|
||||
_EX(glReadPixels);
|
||||
_EX(glRenderbufferStorage);
|
||||
_EX(glRotatef);
|
||||
_EX(glRotatex);
|
||||
_EX(glSampleCoverage);
|
||||
_EX(glSampleCoveragex);
|
||||
_EX(glScalef);
|
||||
_EX(glScalex);
|
||||
_EX(glScissor);
|
||||
_EX(glShadeModel);
|
||||
_EX(glStencilFunc);
|
||||
_EX(glStencilMask);
|
||||
_EX(glStencilOp);
|
||||
_EX(glTexCoordPointer);
|
||||
_EX(glTexEnvf);
|
||||
_EX(glTexEnvfv);
|
||||
_EX(glTexEnvi);
|
||||
_EX(glTexEnviv);
|
||||
_EX(glTexEnvx);
|
||||
_EX(glTexEnvxv);
|
||||
_EX(glTexGenfv);
|
||||
_EX(glTexGeni);
|
||||
_EX(glTexImage2D);
|
||||
_EX(glTexParameterf);
|
||||
_EX(glTexParameterfv);
|
||||
_EX(glTexParameteri);
|
||||
_EX(glTexParameteriv);
|
||||
_EX(glTexParameterx);
|
||||
_EX(glTexParameterxv);
|
||||
_EX(glTexSubImage2D);
|
||||
_EX(glTranslatef);
|
||||
_EX(glTranslatex);
|
||||
_EX(glVertexPointer);
|
||||
_EX(glViewport);
|
||||
|
||||
@@ -14,16 +14,17 @@
|
||||
|
||||
#include "glx.h"
|
||||
#include "utils.h"
|
||||
#include <GLES/gl.h>
|
||||
//#include <GLES/gl.h>
|
||||
#include "../gl/gl.h"
|
||||
#include "../glx/streaming.h"
|
||||
|
||||
bool eglInitialized = false;
|
||||
EGLDisplay eglDisplay;
|
||||
EGLSurface eglSurface;
|
||||
EGLConfig eglConfigs[1];
|
||||
static bool eglInitialized = false;
|
||||
static EGLDisplay eglDisplay;
|
||||
static EGLSurface eglSurface;
|
||||
static EGLConfig eglConfigs[1];
|
||||
#ifdef PANDORA
|
||||
struct sockaddr_un sun;
|
||||
int sock = -2;
|
||||
static struct sockaddr_un sun;
|
||||
static int sock = -2;
|
||||
#endif
|
||||
|
||||
extern void* egl;
|
||||
@@ -259,13 +260,18 @@ static void init_liveinfo() {
|
||||
}
|
||||
#endif
|
||||
extern void initialize_glshim();
|
||||
extern int initialized;
|
||||
static void scan_env() {
|
||||
static bool first = true;
|
||||
if (! first)
|
||||
return;
|
||||
if (! initialized)
|
||||
{
|
||||
initialize_glshim();
|
||||
}
|
||||
/* Check for some corruption inside state.... */
|
||||
if ((state.texture.active < 0) || (state.texture.active > MAX_TEX) ||
|
||||
(state.vao->pointers.vertex.buffer!= 0) || (state.vao->vertex != 0)) {
|
||||
if ((glstate.texture.active < 0) || (glstate.texture.active > MAX_TEX) ||
|
||||
(glstate.vao->pointers.vertex.buffer!= 0) || (glstate.vao->vertex != 0) || (glstate.list.active!=0)) {
|
||||
printf("LIBGL: Warning, memory corruption detected at init, trying to compensate\n");
|
||||
initialize_glshim();
|
||||
}
|
||||
@@ -741,8 +747,8 @@ void glXSwapBuffers(Display *display,
|
||||
static int frames = 0;
|
||||
|
||||
LOAD_EGL(eglSwapBuffers);
|
||||
int old_batch = state.gl_batch;
|
||||
if (state.gl_batch){
|
||||
int old_batch = glstate.gl_batch;
|
||||
if (glstate.gl_batch || glstate.list.active){
|
||||
flush();
|
||||
}
|
||||
#ifdef PANDORA
|
||||
@@ -756,7 +762,7 @@ void glXSwapBuffers(Display *display,
|
||||
}
|
||||
#endif
|
||||
if (g_usefbo) {
|
||||
state.gl_batch = 0;
|
||||
glstate.gl_batch = 0;
|
||||
unbindMainFBO();
|
||||
blitMainFBO();
|
||||
// blit the main_fbo before swap
|
||||
@@ -801,7 +807,7 @@ void glXSwapBuffers(Display *display,
|
||||
}
|
||||
#endif
|
||||
if (g_usefbo) {
|
||||
state.gl_batch = old_batch;
|
||||
glstate.gl_batch = old_batch;
|
||||
bindMainFBO();
|
||||
}
|
||||
}
|
||||
@@ -998,19 +1004,19 @@ void glXUseXFont(Font font, int first, int count, int listBase) {
|
||||
// Save GL texture parameters
|
||||
GLint swapbytes, lsbfirst, rowlength;
|
||||
GLint skiprows, skippixels, alignment;
|
||||
glGetIntegerv(GL_UNPACK_SWAP_BYTES, &swapbytes);
|
||||
glGetIntegerv(GL_UNPACK_LSB_FIRST, &lsbfirst);
|
||||
glGetIntegerv(GL_UNPACK_ROW_LENGTH, &rowlength);
|
||||
glGetIntegerv(GL_UNPACK_SKIP_ROWS, &skiprows);
|
||||
glGetIntegerv(GL_UNPACK_SKIP_PIXELS, &skippixels);
|
||||
glGetIntegerv(GL_UNPACK_ALIGNMENT, &alignment);
|
||||
glshim_glGetIntegerv(GL_UNPACK_SWAP_BYTES, &swapbytes);
|
||||
glshim_glGetIntegerv(GL_UNPACK_LSB_FIRST, &lsbfirst);
|
||||
glshim_glGetIntegerv(GL_UNPACK_ROW_LENGTH, &rowlength);
|
||||
glshim_glGetIntegerv(GL_UNPACK_SKIP_ROWS, &skiprows);
|
||||
glshim_glGetIntegerv(GL_UNPACK_SKIP_PIXELS, &skippixels);
|
||||
glshim_glGetIntegerv(GL_UNPACK_ALIGNMENT, &alignment);
|
||||
// Set Safe Texture params
|
||||
glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE);
|
||||
glPixelStorei(GL_UNPACK_LSB_FIRST, GL_FALSE);
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
|
||||
glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
|
||||
glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
glshim_glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE);
|
||||
glshim_glPixelStorei(GL_UNPACK_LSB_FIRST, GL_FALSE);
|
||||
glshim_glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
|
||||
glshim_glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
|
||||
glshim_glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
|
||||
glshim_glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
// Create GC and Pixmap
|
||||
pixmap = XCreatePixmap(dpy, win, 10, 10, 1);
|
||||
values.foreground = BlackPixel(dpy, DefaultScreen(dpy));
|
||||
@@ -1054,18 +1060,18 @@ void glXUseXFont(Font font, int first, int count, int listBase) {
|
||||
inefficient, but it makes the OpenGL part real easy. */
|
||||
bm_width = (width + 7) / 8;
|
||||
bm_height = height;
|
||||
glNewList(list, GL_COMPILE);
|
||||
glshim_glNewList(list, GL_COMPILE);
|
||||
if (valid && (bm_width > 0) && (bm_height > 0)) {
|
||||
|
||||
memset(bm, '\0', bm_width * bm_height);
|
||||
fill_bitmap(dpy, win, gc, bm_width, bm_height, x, y, c, bm);
|
||||
|
||||
glBitmap(width, height, x0, y0, dx, dy, bm);
|
||||
glshim_glBitmap(width, height, x0, y0, dx, dy, bm);
|
||||
}
|
||||
else {
|
||||
glBitmap(0, 0, 0.0, 0.0, dx, dy, NULL);
|
||||
glshim_glBitmap(0, 0, 0.0, 0.0, dx, dy, NULL);
|
||||
}
|
||||
glEndList();
|
||||
glshim_glEndList();
|
||||
}
|
||||
|
||||
// Free GC & Pixmap
|
||||
@@ -1074,12 +1080,12 @@ void glXUseXFont(Font font, int first, int count, int listBase) {
|
||||
XFreeGC(dpy, gc);
|
||||
|
||||
// Restore saved packing modes.
|
||||
glPixelStorei(GL_UNPACK_SWAP_BYTES, swapbytes);
|
||||
glPixelStorei(GL_UNPACK_LSB_FIRST, lsbfirst);
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, rowlength);
|
||||
glPixelStorei(GL_UNPACK_SKIP_ROWS, skiprows);
|
||||
glPixelStorei(GL_UNPACK_SKIP_PIXELS, skippixels);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, alignment);
|
||||
glshim_glPixelStorei(GL_UNPACK_SWAP_BYTES, swapbytes);
|
||||
glshim_glPixelStorei(GL_UNPACK_LSB_FIRST, lsbfirst);
|
||||
glshim_glPixelStorei(GL_UNPACK_ROW_LENGTH, rowlength);
|
||||
glshim_glPixelStorei(GL_UNPACK_SKIP_ROWS, skiprows);
|
||||
glshim_glPixelStorei(GL_UNPACK_SKIP_PIXELS, skippixels);
|
||||
glshim_glPixelStorei(GL_UNPACK_ALIGNMENT, alignment);
|
||||
// All done
|
||||
}
|
||||
#endif //ANDROID
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
#ifdef ANDROID
|
||||
#include "../gl/gl.h"
|
||||
#include "glx.h"
|
||||
#else
|
||||
#include "glx.h"
|
||||
#endif
|
||||
#include "glx.h"
|
||||
|
||||
#include "../gl/directstate.h"
|
||||
//#define DEBUG_ADDRESS
|
||||
|
||||
|
||||
#ifdef DEBUG_ADDRESS
|
||||
#define MAP(func_name, func) \
|
||||
if(cnt==1) {if ((uint32_t)((void*)func) <0x4000000) printf("glxGetProcAddress %s = %p\n", func_name, (void*)func);} if (strcmp(name, func_name) == 0) return (void *)func;
|
||||
#else
|
||||
#define MAP(func_name, func) \
|
||||
if (strcmp(name, func_name) == 0) return (void *)func;
|
||||
#endif
|
||||
|
||||
#define MAP_EGL(func_name, egl_func) \
|
||||
MAP(#func_name, egl_eglGetProcAddress(#egl_func))
|
||||
@@ -20,6 +23,12 @@
|
||||
|
||||
#define EXT(func_name) MAP(#func_name "EXT", func_name)
|
||||
|
||||
#define _EX(func_name) MAP(#func_name, glshim_ ## func_name)
|
||||
|
||||
#define _ARB(func_name) MAP(#func_name "ARB", glshim_ ## func_name)
|
||||
|
||||
#define _EXT(func_name) MAP(#func_name "EXT", glshim_ ## func_name)
|
||||
|
||||
#define STUB(func_name) \
|
||||
if (strcmp(name, #func_name) == 0) { \
|
||||
printf("glX stub: %s\n", #func_name); \
|
||||
@@ -32,6 +41,10 @@ void glXStub(void *x, ...) {
|
||||
|
||||
void *glXGetProcAddressARB(const char *name) {
|
||||
LOAD_EGL(eglGetProcAddress);
|
||||
#ifdef DEBUG_ADDRESS
|
||||
static int cnt = 0;
|
||||
cnt++;
|
||||
#endif
|
||||
// generated gles wrappers
|
||||
#ifdef USE_ES2
|
||||
#include "gles2funcs.inc"
|
||||
@@ -90,78 +103,78 @@ void *glXGetProcAddressARB(const char *name) {
|
||||
#endif //ANDROID
|
||||
|
||||
// GL_ARB_vertex_buffer_object
|
||||
ARB(glBindBuffer);
|
||||
ARB(glBufferData);
|
||||
ARB(glBufferSubData);
|
||||
ARB(glDeleteBuffers);
|
||||
ARB(glGenBuffers);
|
||||
ARB(glIsBuffer);
|
||||
EX(glGetBufferPointerv);
|
||||
ARB(glGetBufferPointerv);
|
||||
EX(glMapBuffer);
|
||||
EX(glUnmapBuffer);
|
||||
ARB(glMapBuffer);
|
||||
ARB(glUnmapBuffer);
|
||||
ARB(glGetBufferParameteriv);
|
||||
EX(glGetBufferSubData);
|
||||
ARB(glGetBufferSubData);
|
||||
_ARB(glBindBuffer);
|
||||
_ARB(glBufferData);
|
||||
_ARB(glBufferSubData);
|
||||
_ARB(glDeleteBuffers);
|
||||
_ARB(glGenBuffers);
|
||||
_ARB(glIsBuffer);
|
||||
_EX(glGetBufferPointerv);
|
||||
_ARB(glGetBufferPointerv);
|
||||
_EX(glMapBuffer);
|
||||
_EX(glUnmapBuffer);
|
||||
_ARB(glMapBuffer);
|
||||
_ARB(glUnmapBuffer);
|
||||
_ARB(glGetBufferParameteriv);
|
||||
_EX(glGetBufferSubData);
|
||||
_ARB(glGetBufferSubData);
|
||||
|
||||
// GL_ARB_vertex_array_object
|
||||
EX(glGenVertexArrays);
|
||||
EX(glBindVertexArray);
|
||||
EX(glDeleteVertexArrays);
|
||||
EX(glIsVertexArray);
|
||||
ARB(glGenVertexArrays);
|
||||
ARB(glBindVertexArray);
|
||||
ARB(glDeleteVertexArrays);
|
||||
ARB(glIsVertexArray);
|
||||
_EX(glGenVertexArrays);
|
||||
_EX(glBindVertexArray);
|
||||
_EX(glDeleteVertexArrays);
|
||||
_EX(glIsVertexArray);
|
||||
_ARB(glGenVertexArrays);
|
||||
_ARB(glBindVertexArray);
|
||||
_ARB(glDeleteVertexArrays);
|
||||
_ARB(glIsVertexArray);
|
||||
|
||||
// GL_ARB_frameBuffer_ext
|
||||
EX(glFramebufferTexture1D);
|
||||
EX(glFramebufferTexture3D);
|
||||
EX(glFramebufferTextureLayer);
|
||||
EX(glRenderbufferStorageMultisample);
|
||||
EX(glBlitFramebuffer);
|
||||
EXT(glGenFramebuffers);
|
||||
EXT(glDeleteFramebuffers);
|
||||
EXT(glIsFramebuffer);
|
||||
EXT(glCheckFramebufferStatus);
|
||||
EXT(glBindFramebuffer);
|
||||
EXT(glFramebufferTexture2D);
|
||||
EXT(glFramebufferTexture1D);
|
||||
EXT(glFramebufferTexture3D);
|
||||
EXT(glGenRenderbuffers);
|
||||
EXT(glFramebufferRenderbuffer);
|
||||
EXT(glDeleteRenderbuffers);
|
||||
EXT(glRenderbufferStorage);
|
||||
EXT(glRenderbufferStorageMultisample);
|
||||
EXT(glBindRenderbuffer);
|
||||
EXT(glIsRenderbuffer);
|
||||
EXT(glGenerateMipmap);
|
||||
EXT(glGetFramebufferAttachmentParameteriv);
|
||||
EXT(glGetRenderbufferParameteriv);
|
||||
EXT(glFramebufferTextureLayer);
|
||||
EXT(glBlitFramebuffer);
|
||||
ARB(glGenFramebuffers);
|
||||
ARB(glDeleteFramebuffers);
|
||||
ARB(glIsFramebuffer);
|
||||
ARB(glCheckFramebufferStatus);
|
||||
ARB(glBindFramebuffer);
|
||||
ARB(glFramebufferTexture2D);
|
||||
ARB(glFramebufferTexture1D);
|
||||
ARB(glFramebufferTexture3D);
|
||||
ARB(glGenRenderbuffers);
|
||||
ARB(glFramebufferRenderbuffer);
|
||||
ARB(glDeleteRenderbuffers);
|
||||
ARB(glRenderbufferStorage);
|
||||
ARB(glRenderbufferStorageMultisample);
|
||||
ARB(glBindRenderbuffer);
|
||||
ARB(glIsRenderbuffer);
|
||||
ARB(glGenerateMipmap);
|
||||
ARB(glGetFramebufferAttachmentParameteriv);
|
||||
ARB(glGetRenderbufferParameteriv);
|
||||
ARB(glFramebufferTextureLayer);
|
||||
ARB(glBlitFramebuffer);
|
||||
_EX(glFramebufferTexture1D);
|
||||
_EX(glFramebufferTexture3D);
|
||||
_EX(glFramebufferTextureLayer);
|
||||
_EX(glRenderbufferStorageMultisample);
|
||||
_EX(glBlitFramebuffer);
|
||||
_EXT(glGenFramebuffers);
|
||||
_EXT(glDeleteFramebuffers);
|
||||
_EXT(glIsFramebuffer);
|
||||
_EXT(glCheckFramebufferStatus);
|
||||
_EXT(glBindFramebuffer);
|
||||
_EXT(glFramebufferTexture2D);
|
||||
_EXT(glFramebufferTexture1D);
|
||||
_EXT(glFramebufferTexture3D);
|
||||
_EXT(glGenRenderbuffers);
|
||||
_EXT(glFramebufferRenderbuffer);
|
||||
_EXT(glDeleteRenderbuffers);
|
||||
_EXT(glRenderbufferStorage);
|
||||
_EXT(glRenderbufferStorageMultisample);
|
||||
_EXT(glBindRenderbuffer);
|
||||
_EXT(glIsRenderbuffer);
|
||||
_EXT(glGenerateMipmap);
|
||||
_EXT(glGetFramebufferAttachmentParameteriv);
|
||||
_EXT(glGetRenderbufferParameteriv);
|
||||
_EXT(glFramebufferTextureLayer);
|
||||
_EXT(glBlitFramebuffer);
|
||||
_ARB(glGenFramebuffers);
|
||||
_ARB(glDeleteFramebuffers);
|
||||
_ARB(glIsFramebuffer);
|
||||
_ARB(glCheckFramebufferStatus);
|
||||
_ARB(glBindFramebuffer);
|
||||
_ARB(glFramebufferTexture2D);
|
||||
_ARB(glFramebufferTexture1D);
|
||||
_ARB(glFramebufferTexture3D);
|
||||
_ARB(glGenRenderbuffers);
|
||||
_ARB(glFramebufferRenderbuffer);
|
||||
_ARB(glDeleteRenderbuffers);
|
||||
_ARB(glRenderbufferStorage);
|
||||
_ARB(glRenderbufferStorageMultisample);
|
||||
_ARB(glBindRenderbuffer);
|
||||
_ARB(glIsRenderbuffer);
|
||||
_ARB(glGenerateMipmap);
|
||||
_ARB(glGetFramebufferAttachmentParameteriv);
|
||||
_ARB(glGetRenderbufferParameteriv);
|
||||
_ARB(glFramebufferTextureLayer);
|
||||
_ARB(glBlitFramebuffer);
|
||||
STUB(glDrawBuffersARB);
|
||||
|
||||
/*
|
||||
@@ -180,18 +193,18 @@ void *glXGetProcAddressARB(const char *name) {
|
||||
*/
|
||||
|
||||
// GL_EXT_vertex_array
|
||||
EXT(glArrayElement);
|
||||
EXT(glDrawArrays);
|
||||
EXT(glVertexPointer);
|
||||
EXT(glNormalPointer);
|
||||
EXT(glColorPointer);
|
||||
EX(glIndexPointer); //TODO, stub for now
|
||||
EXT(glIndexPointer);
|
||||
EXT(glTexCoordPointer);
|
||||
EX(glEdgeFlagPointer); //TODO, stub for now
|
||||
EXT(glEdgeFlagPointer);
|
||||
EX(glGetPointerv);
|
||||
EXT(glGetPointerv);
|
||||
_EXT(glArrayElement);
|
||||
_EXT(glDrawArrays);
|
||||
_EXT(glVertexPointer);
|
||||
_EXT(glNormalPointer);
|
||||
_EXT(glColorPointer);
|
||||
_EX(glIndexPointer); //TODO, stub for now
|
||||
_EXT(glIndexPointer);
|
||||
_EXT(glTexCoordPointer);
|
||||
_EX(glEdgeFlagPointer); //TODO, stub for now
|
||||
_EXT(glEdgeFlagPointer);
|
||||
_EX(glGetPointerv);
|
||||
_EXT(glGetPointerv);
|
||||
|
||||
|
||||
// OES wrapper
|
||||
@@ -205,66 +218,66 @@ void *glXGetProcAddressARB(const char *name) {
|
||||
// passthrough
|
||||
// batch thunking!
|
||||
#define THUNK(suffix, type) \
|
||||
EX(glColor3##suffix##v); \
|
||||
EX(glColor3##suffix); \
|
||||
EX(glColor4##suffix##v); \
|
||||
EX(glColor4##suffix); \
|
||||
EX(glSecondaryColor3##suffix##v); \
|
||||
EX(glSecondaryColor3##suffix); \
|
||||
EXT(glSecondaryColor3##suffix##v); \
|
||||
EXT(glSecondaryColor3##suffix); \
|
||||
EX(glIndex##suffix##v); \
|
||||
EX(glIndex##suffix); \
|
||||
EX(glNormal3##suffix##v); \
|
||||
EX(glNormal3##suffix); \
|
||||
EX(glRasterPos2##suffix##v); \
|
||||
EX(glRasterPos2##suffix); \
|
||||
EX(glRasterPos3##suffix##v); \
|
||||
EX(glRasterPos3##suffix); \
|
||||
EX(glRasterPos4##suffix##v); \
|
||||
EX(glRasterPos4##suffix); \
|
||||
EX(glWindowPos2##suffix##v); \
|
||||
EX(glWindowPos2##suffix); \
|
||||
EX(glWindowPos3##suffix##v); \
|
||||
EX(glWindowPos3##suffix); \
|
||||
EX(glVertex2##suffix##v); \
|
||||
EX(glVertex2##suffix); \
|
||||
EX(glVertex3##suffix##v); \
|
||||
EX(glVertex3##suffix); \
|
||||
EX(glVertex4##suffix##v); \
|
||||
EX(glVertex4##suffix); \
|
||||
EX(glTexCoord1##suffix##v); \
|
||||
EX(glTexCoord1##suffix); \
|
||||
EX(glTexCoord2##suffix##v); \
|
||||
EX(glTexCoord2##suffix); \
|
||||
EX(glTexCoord3##suffix##v); \
|
||||
EX(glTexCoord3##suffix); \
|
||||
EX(glTexCoord4##suffix##v); \
|
||||
EX(glTexCoord4##suffix); \
|
||||
EX(glMultiTexCoord1##suffix##v); \
|
||||
EX(glMultiTexCoord1##suffix); \
|
||||
EX(glMultiTexCoord2##suffix##v); \
|
||||
EX(glMultiTexCoord2##suffix); \
|
||||
EX(glMultiTexCoord3##suffix##v); \
|
||||
EX(glMultiTexCoord3##suffix); \
|
||||
EX(glMultiTexCoord4##suffix##v); \
|
||||
EX(glMultiTexCoord4##suffix); \
|
||||
EXT(glMultiTexCoord1##suffix##v); \
|
||||
EXT(glMultiTexCoord1##suffix); \
|
||||
EXT(glMultiTexCoord2##suffix##v); \
|
||||
EXT(glMultiTexCoord2##suffix); \
|
||||
EXT(glMultiTexCoord3##suffix##v); \
|
||||
EXT(glMultiTexCoord3##suffix); \
|
||||
EXT(glMultiTexCoord4##suffix##v); \
|
||||
EXT(glMultiTexCoord4##suffix); \
|
||||
ARB(glMultiTexCoord1##suffix##v); \
|
||||
ARB(glMultiTexCoord1##suffix); \
|
||||
ARB(glMultiTexCoord2##suffix##v); \
|
||||
ARB(glMultiTexCoord2##suffix); \
|
||||
ARB(glMultiTexCoord3##suffix##v); \
|
||||
ARB(glMultiTexCoord3##suffix); \
|
||||
ARB(glMultiTexCoord4##suffix##v); \
|
||||
ARB(glMultiTexCoord4##suffix);
|
||||
_EX(glColor3##suffix##v); \
|
||||
_EX(glColor3##suffix); \
|
||||
_EX(glColor4##suffix##v); \
|
||||
_EX(glColor4##suffix); \
|
||||
_EX(glSecondaryColor3##suffix##v); \
|
||||
_EX(glSecondaryColor3##suffix); \
|
||||
_EXT(glSecondaryColor3##suffix##v); \
|
||||
_EXT(glSecondaryColor3##suffix); \
|
||||
_EX(glIndex##suffix##v); \
|
||||
_EX(glIndex##suffix); \
|
||||
_EX(glNormal3##suffix##v); \
|
||||
_EX(glNormal3##suffix); \
|
||||
_EX(glRasterPos2##suffix##v); \
|
||||
_EX(glRasterPos2##suffix); \
|
||||
_EX(glRasterPos3##suffix##v); \
|
||||
_EX(glRasterPos3##suffix); \
|
||||
_EX(glRasterPos4##suffix##v); \
|
||||
_EX(glRasterPos4##suffix); \
|
||||
_EX(glWindowPos2##suffix##v); \
|
||||
_EX(glWindowPos2##suffix); \
|
||||
_EX(glWindowPos3##suffix##v); \
|
||||
_EX(glWindowPos3##suffix); \
|
||||
_EX(glVertex2##suffix##v); \
|
||||
_EX(glVertex2##suffix); \
|
||||
_EX(glVertex3##suffix##v); \
|
||||
_EX(glVertex3##suffix); \
|
||||
_EX(glVertex4##suffix##v); \
|
||||
_EX(glVertex4##suffix); \
|
||||
_EX(glTexCoord1##suffix##v); \
|
||||
_EX(glTexCoord1##suffix); \
|
||||
_EX(glTexCoord2##suffix##v); \
|
||||
_EX(glTexCoord2##suffix); \
|
||||
_EX(glTexCoord3##suffix##v); \
|
||||
_EX(glTexCoord3##suffix); \
|
||||
_EX(glTexCoord4##suffix##v); \
|
||||
_EX(glTexCoord4##suffix); \
|
||||
_EX(glMultiTexCoord1##suffix##v); \
|
||||
_EX(glMultiTexCoord1##suffix); \
|
||||
_EX(glMultiTexCoord2##suffix##v); \
|
||||
_EX(glMultiTexCoord2##suffix); \
|
||||
_EX(glMultiTexCoord3##suffix##v); \
|
||||
_EX(glMultiTexCoord3##suffix); \
|
||||
_EX(glMultiTexCoord4##suffix##v); \
|
||||
_EX(glMultiTexCoord4##suffix); \
|
||||
_EXT(glMultiTexCoord1##suffix##v); \
|
||||
_EXT(glMultiTexCoord1##suffix); \
|
||||
_EXT(glMultiTexCoord2##suffix##v); \
|
||||
_EXT(glMultiTexCoord2##suffix); \
|
||||
_EXT(glMultiTexCoord3##suffix##v); \
|
||||
_EXT(glMultiTexCoord3##suffix); \
|
||||
_EXT(glMultiTexCoord4##suffix##v); \
|
||||
_EXT(glMultiTexCoord4##suffix); \
|
||||
_ARB(glMultiTexCoord1##suffix##v); \
|
||||
_ARB(glMultiTexCoord1##suffix); \
|
||||
_ARB(glMultiTexCoord2##suffix##v); \
|
||||
_ARB(glMultiTexCoord2##suffix); \
|
||||
_ARB(glMultiTexCoord3##suffix##v); \
|
||||
_ARB(glMultiTexCoord3##suffix); \
|
||||
_ARB(glMultiTexCoord4##suffix##v); \
|
||||
_ARB(glMultiTexCoord4##suffix);
|
||||
|
||||
THUNK(b, GLbyte);
|
||||
THUNK(d, GLdouble);
|
||||
@@ -276,176 +289,176 @@ void *glXGetProcAddressARB(const char *name) {
|
||||
THUNK(f, GLfloat);
|
||||
#undef THUNK
|
||||
|
||||
EX(glPointParameterf);
|
||||
EX(glPointParameterfv);
|
||||
ARB(glPointParameterf);
|
||||
ARB(glPointParameterfv);
|
||||
EXT(glPointParameterf);
|
||||
EXT(glPointParameterfv);
|
||||
_EX(glPointParameterf);
|
||||
_EX(glPointParameterfv);
|
||||
_ARB(glPointParameterf);
|
||||
_ARB(glPointParameterfv);
|
||||
_EXT(glPointParameterf);
|
||||
_EXT(glPointParameterfv);
|
||||
|
||||
#ifdef USE_ES2
|
||||
EX(glCompileShaderARB);
|
||||
EX(glCreateShaderObjectARB);
|
||||
EX(glGetObjectParameterivARB);
|
||||
EX(glShaderSourceARB);
|
||||
_EX(glCompileShaderARB);
|
||||
_EX(glCreateShaderObjectARB);
|
||||
_EX(glGetObjectParameterivARB);
|
||||
_EX(glShaderSourceARB);
|
||||
#endif
|
||||
|
||||
// functions we actually define
|
||||
EXT(glActiveTexture);
|
||||
ARB(glActiveTexture);
|
||||
EX(glArrayElement);
|
||||
EX(glBegin);
|
||||
EX(glBitmap);
|
||||
_EXT(glActiveTexture);
|
||||
_ARB(glActiveTexture);
|
||||
_EX(glArrayElement);
|
||||
_EX(glBegin);
|
||||
_EX(glBitmap);
|
||||
/*EXT(glBlendColor);
|
||||
ARB(glBlendColor);*/
|
||||
EXT(glBlendEquation);
|
||||
ARB(glBlendEquation);
|
||||
EXT(glBlendFunc);
|
||||
ARB(glBlendFunc);
|
||||
_EXT(glBlendEquation);
|
||||
_ARB(glBlendEquation);
|
||||
_EXT(glBlendFunc);
|
||||
_ARB(glBlendFunc);
|
||||
#ifndef ODROID
|
||||
EXT(glBlendEquationSeparate);
|
||||
ARB(glBlendEquationSeparate);
|
||||
EX(glBlendEquationSeparatei);
|
||||
EXT(glBlendEquationSeparatei);
|
||||
ARB(glBlendEquationSeparatei);
|
||||
EXT(glBlendFuncSeparate);
|
||||
ARB(glBlendFuncSeparate);
|
||||
EX(glBlendFuncSeparatei);
|
||||
EXT(glBlendFuncSeparatei);
|
||||
ARB(glBlendFuncSeparatei);
|
||||
_EXT(glBlendEquationSeparate);
|
||||
_ARB(glBlendEquationSeparate);
|
||||
_EX(glBlendEquationSeparatei);
|
||||
_EXT(glBlendEquationSeparatei);
|
||||
_ARB(glBlendEquationSeparatei);
|
||||
_EXT(glBlendFuncSeparate);
|
||||
_ARB(glBlendFuncSeparate);
|
||||
_EX(glBlendFuncSeparatei);
|
||||
_EXT(glBlendFuncSeparatei);
|
||||
_ARB(glBlendFuncSeparatei);
|
||||
#endif
|
||||
EX(glCallList);
|
||||
EX(glCallLists);
|
||||
EX(glClearDepth);
|
||||
EXT(glClientActiveTexture);
|
||||
ARB(glClientActiveTexture);
|
||||
EX(glClipPlane);
|
||||
EX(glCopyPixels);
|
||||
EX(glDeleteLists);
|
||||
EX(glDepthRange);
|
||||
EX(glDrawBuffer);
|
||||
EX(glDrawPixels);
|
||||
EX(glDrawRangeElements);
|
||||
EX(glDrawRangeElementsEXT);
|
||||
EX(glEdgeFlag);
|
||||
EX(glEnd);
|
||||
EX(glEndList);
|
||||
EX(glEvalCoord1d);
|
||||
EX(glEvalCoord1f);
|
||||
EX(glEvalCoord2d);
|
||||
EX(glEvalCoord2f);
|
||||
EX(glEvalMesh1);
|
||||
EX(glEvalMesh2);
|
||||
EX(glEvalPoint1);
|
||||
EX(glEvalPoint2);
|
||||
EX(glFogCoordd);
|
||||
EX(glFogCoorddv);
|
||||
EX(glFogCoordf);
|
||||
EX(glFogCoordfv);
|
||||
EX(glFogi);
|
||||
EX(glFogiv);
|
||||
EX(glFrustum);
|
||||
EX(glGenLists);
|
||||
EX(glGetDoublev);
|
||||
EX(glGetIntegerv);
|
||||
EX(glGetMapdv);
|
||||
EX(glGetMapfv);
|
||||
EX(glGetMapiv);
|
||||
EX(glGetTexImage);
|
||||
EX(glGetTexLevelParameterfv);
|
||||
EX(glGetTexLevelParameteriv);
|
||||
EX(glInitNames);
|
||||
EX(glInterleavedArrays);
|
||||
EX(glIsList);
|
||||
_EX(glCallList);
|
||||
_EX(glCallLists);
|
||||
_EX(glClearDepth);
|
||||
_EXT(glClientActiveTexture);
|
||||
_ARB(glClientActiveTexture);
|
||||
_EX(glClipPlane);
|
||||
_EX(glCopyPixels);
|
||||
_EX(glDeleteLists);
|
||||
_EX(glDepthRange);
|
||||
_EX(glDrawBuffer);
|
||||
_EX(glDrawPixels);
|
||||
_EX(glDrawRangeElements);
|
||||
_EXT(glDrawRangeElements);
|
||||
_EX(glEdgeFlag);
|
||||
_EX(glEnd);
|
||||
_EX(glEndList);
|
||||
_EX(glEvalCoord1d);
|
||||
_EX(glEvalCoord1f);
|
||||
_EX(glEvalCoord2d);
|
||||
_EX(glEvalCoord2f);
|
||||
_EX(glEvalMesh1);
|
||||
_EX(glEvalMesh2);
|
||||
_EX(glEvalPoint1);
|
||||
_EX(glEvalPoint2);
|
||||
_EX(glFogCoordd);
|
||||
_EX(glFogCoorddv);
|
||||
_EX(glFogCoordf);
|
||||
_EX(glFogCoordfv);
|
||||
_EX(glFogi);
|
||||
_EX(glFogiv);
|
||||
_EX(glFrustum);
|
||||
_EX(glGenLists);
|
||||
_EX(glGetDoublev);
|
||||
_EX(glGetIntegerv);
|
||||
_EX(glGetMapdv);
|
||||
_EX(glGetMapfv);
|
||||
_EX(glGetMapiv);
|
||||
_EX(glGetTexImage);
|
||||
_EX(glGetTexLevelParameterfv);
|
||||
_EX(glGetTexLevelParameteriv);
|
||||
_EX(glInitNames);
|
||||
_EX(glInterleavedArrays);
|
||||
_EX(glIsList);
|
||||
#ifndef USE_ES2
|
||||
EX(glLighti);
|
||||
EX(glLightiv);
|
||||
EX(glLightModeli);
|
||||
EX(glLightModeliv);
|
||||
_EX(glLighti);
|
||||
_EX(glLightiv);
|
||||
_EX(glLightModeli);
|
||||
_EX(glLightModeliv);
|
||||
#endif
|
||||
EX(glLineStipple);
|
||||
EX(glListBase);
|
||||
EX(glLoadMatrixd);
|
||||
EX(glLoadName);
|
||||
EX(glLockArraysEXT);
|
||||
EX(glMap1d);
|
||||
EX(glMap1f);
|
||||
EX(glMap2d);
|
||||
EX(glMap2f);
|
||||
EX(glMapGrid1d);
|
||||
EX(glMapGrid1f);
|
||||
EX(glMapGrid2d);
|
||||
EX(glMapGrid2f);
|
||||
EX(glMateriali);
|
||||
EX(glMultMatrixd);
|
||||
EX(glNewList);
|
||||
EX(glOrtho);
|
||||
EX(glPixelTransferf);
|
||||
EX(glPixelTransferi);
|
||||
EX(glPixelZoom);
|
||||
EX(glPolygonMode);
|
||||
EX(glPolygonStipple);
|
||||
EX(glPopAttrib);
|
||||
EX(glPopClientAttrib);
|
||||
EX(glPopName);
|
||||
EX(glPushAttrib);
|
||||
EX(glPushClientAttrib);
|
||||
EX(glPushName);
|
||||
EX(glRasterPos2i);
|
||||
EX(glReadBuffer);
|
||||
EX(glRectd);
|
||||
EX(glRectf);
|
||||
EX(glRecti);
|
||||
EX(glRects);
|
||||
EX(glRectdv);
|
||||
EX(glRectfv);
|
||||
EX(glRectiv);
|
||||
EX(glRectsv);
|
||||
EX(glRenderMode);
|
||||
EX(glRotated);
|
||||
EX(glScaled);
|
||||
EX(glSecondaryColorPointer);
|
||||
EXT(glSecondaryColorPointer);
|
||||
EX(glTexEnvf);
|
||||
EX(glTexEnviv);
|
||||
EX(glTexGend);
|
||||
EX(glTexGendv);
|
||||
EX(glTexGenf);
|
||||
EX(glTexGenfv);
|
||||
EX(glTexGeni);
|
||||
EX(glTexGeniv);
|
||||
EX(glTexImage1D);
|
||||
EX(glTexImage3D);
|
||||
EX(glTexSubImage1D);
|
||||
EX(glTexSubImage3D);
|
||||
EX(glCompressedTexImage1D);
|
||||
EX(glCompressedTexSubImage1D);
|
||||
EX(glCompressedTexImage3D);
|
||||
EX(glCompressedTexSubImage3D);
|
||||
EX(glGetCompressedTexImage);
|
||||
EXT(glCompressedTexImage2D);
|
||||
EXT(glCompressedTexSubImage2D);
|
||||
EXT(glCompressedTexImage1D);
|
||||
EXT(glCompressedTexSubImage1D);
|
||||
EXT(glCompressedTexImage3D);
|
||||
EXT(glCompressedTexSubImage3D);
|
||||
EXT(glGetCompressedTexImage);
|
||||
ARB(glCompressedTexImage2D);
|
||||
ARB(glCompressedTexSubImage2D);
|
||||
ARB(glCompressedTexImage1D);
|
||||
ARB(glCompressedTexSubImage1D);
|
||||
ARB(glCompressedTexImage3D);
|
||||
ARB(glCompressedTexSubImage3D);
|
||||
ARB(glGetCompressedTexImage);
|
||||
EX(glCopyTexImage1D);
|
||||
EX(glCopyTexSubImage1D);
|
||||
EX(glTranslated);
|
||||
EX(glUnlockArraysEXT);
|
||||
EX(glGetTexGenfv);
|
||||
EX(glLoadTransposeMatrixf);
|
||||
EX(glLoadTransposeMatrixd);
|
||||
EX(glMultTransposeMatrixd);
|
||||
EX(glMultTransposeMatrixf);
|
||||
_EX(glLineStipple);
|
||||
_EX(glListBase);
|
||||
_EX(glLoadMatrixd);
|
||||
_EX(glLoadName);
|
||||
_EXT(glLockArrays);
|
||||
_EX(glMap1d);
|
||||
_EX(glMap1f);
|
||||
_EX(glMap2d);
|
||||
_EX(glMap2f);
|
||||
_EX(glMapGrid1d);
|
||||
_EX(glMapGrid1f);
|
||||
_EX(glMapGrid2d);
|
||||
_EX(glMapGrid2f);
|
||||
_EX(glMateriali);
|
||||
_EX(glMultMatrixd);
|
||||
_EX(glNewList);
|
||||
_EX(glOrtho);
|
||||
_EX(glPixelTransferf);
|
||||
_EX(glPixelTransferi);
|
||||
_EX(glPixelZoom);
|
||||
_EX(glPolygonMode);
|
||||
_EX(glPolygonStipple);
|
||||
_EX(glPopAttrib);
|
||||
_EX(glPopClientAttrib);
|
||||
_EX(glPopName);
|
||||
_EX(glPushAttrib);
|
||||
_EX(glPushClientAttrib);
|
||||
_EX(glPushName);
|
||||
_EX(glRasterPos2i);
|
||||
_EX(glReadBuffer);
|
||||
_EX(glRectd);
|
||||
_EX(glRectf);
|
||||
_EX(glRecti);
|
||||
_EX(glRects);
|
||||
_EX(glRectdv);
|
||||
_EX(glRectfv);
|
||||
_EX(glRectiv);
|
||||
_EX(glRectsv);
|
||||
_EX(glRenderMode);
|
||||
_EX(glRotated);
|
||||
_EX(glScaled);
|
||||
_EX(glSecondaryColorPointer);
|
||||
_EXT(glSecondaryColorPointer);
|
||||
_EX(glTexEnvf);
|
||||
_EX(glTexEnviv);
|
||||
_EX(glTexGend);
|
||||
_EX(glTexGendv);
|
||||
_EX(glTexGenf);
|
||||
_EX(glTexGenfv);
|
||||
_EX(glTexGeni);
|
||||
_EX(glTexGeniv);
|
||||
_EX(glTexImage1D);
|
||||
_EX(glTexImage3D);
|
||||
_EX(glTexSubImage1D);
|
||||
_EX(glTexSubImage3D);
|
||||
_EX(glCompressedTexImage1D);
|
||||
_EX(glCompressedTexSubImage1D);
|
||||
_EX(glCompressedTexImage3D);
|
||||
_EX(glCompressedTexSubImage3D);
|
||||
_EX(glGetCompressedTexImage);
|
||||
_EXT(glCompressedTexImage2D);
|
||||
_EXT(glCompressedTexSubImage2D);
|
||||
_EXT(glCompressedTexImage1D);
|
||||
_EXT(glCompressedTexSubImage1D);
|
||||
_EXT(glCompressedTexImage3D);
|
||||
_EXT(glCompressedTexSubImage3D);
|
||||
_EXT(glGetCompressedTexImage);
|
||||
_ARB(glCompressedTexImage2D);
|
||||
_ARB(glCompressedTexSubImage2D);
|
||||
_ARB(glCompressedTexImage1D);
|
||||
_ARB(glCompressedTexSubImage1D);
|
||||
_ARB(glCompressedTexImage3D);
|
||||
_ARB(glCompressedTexSubImage3D);
|
||||
_ARB(glGetCompressedTexImage);
|
||||
_EX(glCopyTexImage1D);
|
||||
_EX(glCopyTexSubImage1D);
|
||||
_EX(glTranslated);
|
||||
_EXT(glUnlockArrays);
|
||||
_EX(glGetTexGenfv);
|
||||
_EX(glLoadTransposeMatrixf);
|
||||
_EX(glLoadTransposeMatrixd);
|
||||
_EX(glMultTransposeMatrixd);
|
||||
_EX(glMultTransposeMatrixf);
|
||||
// stubs for unimplemented functions
|
||||
STUB(glAccum);
|
||||
STUB(glAreTexturesResident);
|
||||
@@ -470,7 +483,7 @@ void *glXGetProcAddressARB(const char *name) {
|
||||
STUB(glPixelMapfv);
|
||||
STUB(glPixelMapuiv);
|
||||
STUB(glPixelMapusv);
|
||||
EX(glPixelStoref);
|
||||
_EX(glPixelStoref);
|
||||
STUB(glPrioritizeTextures);
|
||||
STUB(glSelectBuffer); //TODO
|
||||
|
||||
@@ -479,80 +492,80 @@ void *glXGetProcAddressARB(const char *name) {
|
||||
STUB(glIndexPointerEXT);*/
|
||||
|
||||
//EXT_direct_state_access
|
||||
EX(glClientAttribDefaultEXT);
|
||||
EX(glPushClientAttribDefaultEXT);
|
||||
EX(glMatrixLoadfEXT);
|
||||
EX(glMatrixLoaddEXT);
|
||||
EX(glMatrixMultfEXT);
|
||||
EX(glMatrixMultdEXT);
|
||||
EX(glMatrixLoadIdentityEXT);
|
||||
EX(glMatrixRotatefEXT);
|
||||
EX(glMatrixRotatedEXT);
|
||||
EX(glMatrixScalefEXT);
|
||||
EX(glMatrixScaledEXT);
|
||||
EX(glMatrixTranslatefEXT);
|
||||
EX(glMatrixTranslatedEXT);
|
||||
EX(glMatrixOrthoEXT);
|
||||
EX(glMatrixFrustumEXT);
|
||||
EX(glMatrixPushEXT);
|
||||
EX(glMatrixPopEXT);
|
||||
EX(glTextureParameteriEXT);
|
||||
EX(glTextureParameterivEXT);
|
||||
EX(glTextureParameterfEXT);
|
||||
EX(glTextureParameterfvEXT);
|
||||
EX(glTextureImage1DEXT);
|
||||
EX(glTextureImage2DEXT);
|
||||
EX(glTextureSubImage1DEXT);
|
||||
EX(glTextureSubImage2DEXT);
|
||||
EX(glCopyTextureImage1DEXT);
|
||||
EX(glCopyTextureImage2DEXT);
|
||||
EX(glCopyTextureSubImage1DEXT);
|
||||
EX(glCopyTextureSubImage2DEXT);
|
||||
EX(glGetTextureImageEXT);
|
||||
EX(glGetTextureParameterfvEXT);
|
||||
EX(glGetTextureParameterivEXT);
|
||||
EX(glGetTextureLevelParameterfvEXT);
|
||||
EX(glGetTextureLevelParameterivEXT);
|
||||
EX(glTextureImage3DEXT);
|
||||
EX(glTextureSubImage3DEXT);
|
||||
EX(glCopyTextureSubImage3DEXT);
|
||||
EX(glBindMultiTextureEXT);
|
||||
EX(glMultiTexCoordPointerEXT);
|
||||
EX(glMultiTexEnvfEXT);
|
||||
EX(glMultiTexEnvfvEXT);
|
||||
EX(glMultiTexEnviEXT);
|
||||
EX(glMultiTexEnvivEXT);
|
||||
EX(glMultiTexGendEXT);
|
||||
EX(glMultiTexGendvEXT);
|
||||
EX(glMultiTexGenfEXT);
|
||||
EX(glMultiTexGenfvEXT);
|
||||
EX(glMultiTexGeniEXT);
|
||||
EX(glMultiTexGenivEXT);
|
||||
EX(glGetMultiTexEnvfvEXT);
|
||||
EX(glGetMultiTexEnvivEXT);
|
||||
EX(glGetMultiTexGendvEXT);
|
||||
EX(glGetMultiTexGenfvEXT);
|
||||
EX(glGetMultiTexGenivEXT);
|
||||
EX(glMultiTexParameteriEXT);
|
||||
EX(glMultiTexParameterivEXT);
|
||||
EX(glMultiTexParameterfEXT);
|
||||
EX(glMultiTexParameterfvEXT);
|
||||
EX(glMultiTexImage1DEXT);
|
||||
EX(glMultiTexImage2DEXT);
|
||||
EX(glMultiTexSubImage1DEXT);
|
||||
EX(glMultiTexSubImage2DEXT);
|
||||
EX(glCopyMultiTexImage1DEXT);
|
||||
EX(glCopyMultiTexImage2DEXT);
|
||||
EX(glCopyMultiTexSubImage1DEXT);
|
||||
EX(glCopyMultiTexSubImage2DEXT);
|
||||
EX(glGetMultiTexImageEXT);
|
||||
EX(glGetMultiTexParameterfvEXT);
|
||||
EX(glGetMultiTexParameterivEXT);
|
||||
EX(glGetMultiTexLevelParameterfvEXT);
|
||||
EX(glGetMultiTexLevelParameterivEXT);
|
||||
EX(glMultiTexImage3DEXT);
|
||||
EX(glMultiTexSubImage3DEXT);
|
||||
EX(glCopyMultiTexSubImage3DEXT);
|
||||
_EX(glClientAttribDefault);
|
||||
_EX(glPushClientAttribDefault);
|
||||
_EX(glMatrixLoadf);
|
||||
_EX(glMatrixLoadd);
|
||||
_EX(glMatrixMultf);
|
||||
_EX(glMatrixMultd);
|
||||
_EX(glMatrixLoadIdentity);
|
||||
_EX(glMatrixRotatef);
|
||||
_EX(glMatrixRotated);
|
||||
_EX(glMatrixScalef);
|
||||
_EX(glMatrixScaled);
|
||||
_EX(glMatrixTranslatef);
|
||||
_EX(glMatrixTranslated);
|
||||
_EX(glMatrixOrtho);
|
||||
_EX(glMatrixFrustum);
|
||||
_EX(glMatrixPush);
|
||||
_EX(glMatrixPop);
|
||||
_EX(glTextureParameteri);
|
||||
_EX(glTextureParameteriv);
|
||||
_EX(glTextureParameterf);
|
||||
_EX(glTextureParameterfv);
|
||||
_EX(glTextureImage1D);
|
||||
_EX(glTextureImage2D);
|
||||
_EX(glTextureSubImage1D);
|
||||
_EX(glTextureSubImage2D);
|
||||
_EX(glCopyTextureImage1D);
|
||||
_EX(glCopyTextureImage2D);
|
||||
_EX(glCopyTextureSubImage1D);
|
||||
_EX(glCopyTextureSubImage2D);
|
||||
_EX(glGetTextureImage);
|
||||
_EX(glGetTextureParameterfv);
|
||||
_EX(glGetTextureParameteriv);
|
||||
_EX(glGetTextureLevelParameterfv);
|
||||
_EX(glGetTextureLevelParameteriv);
|
||||
_EX(glTextureImage3D);
|
||||
_EX(glTextureSubImage3D);
|
||||
_EX(glCopyTextureSubImage3D);
|
||||
_EX(glBindMultiTexture);
|
||||
_EX(glMultiTexCoordPointer);
|
||||
_EX(glMultiTexEnvf);
|
||||
_EX(glMultiTexEnvfv);
|
||||
_EX(glMultiTexEnvi);
|
||||
_EX(glMultiTexEnviv);
|
||||
_EX(glMultiTexGend);
|
||||
_EX(glMultiTexGendv);
|
||||
_EX(glMultiTexGenf);
|
||||
_EX(glMultiTexGenfv);
|
||||
_EX(glMultiTexGeni);
|
||||
_EX(glMultiTexGeniv);
|
||||
_EX(glGetMultiTexEnvfv);
|
||||
_EX(glGetMultiTexEnviv);
|
||||
_EX(glGetMultiTexGendv);
|
||||
_EX(glGetMultiTexGenfv);
|
||||
_EX(glGetMultiTexGeniv);
|
||||
_EX(glMultiTexParameteri);
|
||||
_EX(glMultiTexParameteriv);
|
||||
_EX(glMultiTexParameterf);
|
||||
_EX(glMultiTexParameterfv);
|
||||
_EX(glMultiTexImage1D);
|
||||
_EX(glMultiTexImage2D);
|
||||
_EX(glMultiTexSubImage1D);
|
||||
_EX(glMultiTexSubImage2D);
|
||||
_EX(glCopyMultiTexImage1D);
|
||||
_EX(glCopyMultiTexImage2D);
|
||||
_EX(glCopyMultiTexSubImage1D);
|
||||
_EX(glCopyMultiTexSubImage2D);
|
||||
_EX(glGetMultiTexImage);
|
||||
_EX(glGetMultiTexParameterfv);
|
||||
_EX(glGetMultiTexParameteriv);
|
||||
_EX(glGetMultiTexLevelParameterfv);
|
||||
_EX(glGetMultiTexLevelParameteriv);
|
||||
_EX(glMultiTexImage3D);
|
||||
_EX(glMultiTexSubImage3D);
|
||||
_EX(glCopyMultiTexSubImage3D);
|
||||
STUB(EnableClientStateIndexedEXT);
|
||||
STUB(DisableClientStateIndexedEXT);
|
||||
STUB(GetFloatIndexedvEXT);
|
||||
@@ -563,24 +576,24 @@ void *glXGetProcAddressARB(const char *name) {
|
||||
STUB(IsEnabledIndexedEXT);
|
||||
STUB(GetIntegerIndexedvEXT);
|
||||
STUB(GetBooleanIndexedvEXT);
|
||||
EX(glCompressedTextureImage3DEXT);
|
||||
EX(glCompressedTextureImage2DEXT);
|
||||
EX(glCompressedTextureImage1DEXT);
|
||||
EX(glCompressedTextureSubImage3DEXT);
|
||||
EX(glCompressedTextureSubImage2DEXT);
|
||||
EX(glCompressedTextureSubImage1DEXT);
|
||||
EX(glGetCompressedTextureImageEXT);
|
||||
EX(glCompressedMultiTexImage3DEXT);
|
||||
EX(glCompressedMultiTexImage2DEXT);
|
||||
EX(glCompressedMultiTexImage1DEXT);
|
||||
EX(glCompressedMultiTexSubImage3DEXT);
|
||||
EX(glCompressedMultiTexSubImage2DEXT);
|
||||
EX(glCompressedMultiTexSubImage1DEXT);
|
||||
EX(glGetCompressedMultiTexImageEXT);
|
||||
EX(glMatrixLoadTransposefEXT);
|
||||
EX(glMatrixLoadTransposedEXT);
|
||||
EX(glMatrixMultTransposefEXT);
|
||||
EX(glMatrixMultTransposedEXT);
|
||||
_EX(glCompressedTextureImage3D);
|
||||
_EX(glCompressedTextureImage2D);
|
||||
_EX(glCompressedTextureImage1D);
|
||||
_EX(glCompressedTextureSubImage3D);
|
||||
_EX(glCompressedTextureSubImage2D);
|
||||
_EX(glCompressedTextureSubImage1D);
|
||||
_EX(glGetCompressedTextureImage);
|
||||
_EX(glCompressedMultiTexImage3D);
|
||||
_EX(glCompressedMultiTexImage2D);
|
||||
_EX(glCompressedMultiTexImage1D);
|
||||
_EX(glCompressedMultiTexSubImage3D);
|
||||
_EX(glCompressedMultiTexSubImage2D);
|
||||
_EX(glCompressedMultiTexSubImage1D);
|
||||
_EX(glGetCompressedMultiTexImage);
|
||||
_EX(glMatrixLoadTransposef);
|
||||
_EX(glMatrixLoadTransposed);
|
||||
_EX(glMatrixMultTransposef);
|
||||
_EX(glMatrixMultTransposed);
|
||||
|
||||
printf("glXGetProcAddress: %s not found.\n", name);
|
||||
return NULL;
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
|
||||
#include "streaming.h"
|
||||
|
||||
PFNGLTEXBINDSTREAMIMGPROC glTexBindStreamIMG = NULL;
|
||||
PFNGLGETTEXSTREAMDEVICEATTRIBUTEIVIMGPROC glGetTexAttrIMG = NULL;
|
||||
PFNGLGETTEXSTREAMDEVICENAMEIMGPROC glGetTexDeviceIMG = NULL;
|
||||
PFNGLTEXBINDSTREAMIMGPROC *glTexBindStreamIMG = NULL;
|
||||
PFNGLGETTEXSTREAMDEVICEATTRIBUTEIVIMGPROC *glGetTexAttrIMG = NULL;
|
||||
PFNGLGETTEXSTREAMDEVICENAMEIMGPROC *glGetTexDeviceIMG = NULL;
|
||||
|
||||
//extern void* eglGetProcAddress(const char*);
|
||||
|
||||
@@ -33,9 +33,9 @@ void Streaming_Initialize() {
|
||||
return;
|
||||
// get the extension functions
|
||||
gl_streaming_initialized = 1;
|
||||
glTexBindStreamIMG =(PFNGLTEXBINDSTREAMIMGPROC)egl_eglGetProcAddress("glTexBindStreamIMG");
|
||||
glGetTexAttrIMG = (PFNGLGETTEXSTREAMDEVICEATTRIBUTEIVIMGPROC)egl_eglGetProcAddress("glGetTexStreamDeviceAttributeivIMG");
|
||||
glGetTexDeviceIMG = (PFNGLGETTEXSTREAMDEVICENAMEIMGPROC)egl_eglGetProcAddress("glGetTexStreamDeviceNameIMG");
|
||||
glTexBindStreamIMG =(PFNGLTEXBINDSTREAMIMGPROC*)egl_eglGetProcAddress("glTexBindStreamIMG");
|
||||
glGetTexAttrIMG = (PFNGLGETTEXSTREAMDEVICEATTRIBUTEIVIMGPROC*)egl_eglGetProcAddress("glGetTexStreamDeviceAttributeivIMG");
|
||||
glGetTexDeviceIMG = (PFNGLGETTEXSTREAMDEVICENAMEIMGPROC*)egl_eglGetProcAddress("glGetTexStreamDeviceNameIMG");
|
||||
|
||||
if (!glTexBindStreamIMG || !glGetTexAttrIMG || !glGetTexDeviceIMG) {
|
||||
gl_streaming = 0;
|
||||
@@ -260,8 +260,8 @@ void ApplyFilterID(int ID, GLenum min_filter, GLenum mag_filter) {
|
||||
return;
|
||||
if (!stream_cache[ID].active)
|
||||
return;
|
||||
glTexParameterf(GL_TEXTURE_STREAM_IMG, GL_TEXTURE_MIN_FILTER, min_filter);
|
||||
glTexParameterf(GL_TEXTURE_STREAM_IMG, GL_TEXTURE_MAG_FILTER, mag_filter);
|
||||
glshim_glTexParameterf(GL_TEXTURE_STREAM_IMG, GL_TEXTURE_MIN_FILTER, min_filter);
|
||||
glshim_glTexParameterf(GL_TEXTURE_STREAM_IMG, GL_TEXTURE_MAG_FILTER, mag_filter);
|
||||
}
|
||||
|
||||
// Function to activate the Steaming texture ID on current tex...
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
#ifndef STREAMING_H
|
||||
#define STREAMING_H
|
||||
#ifndef _STREAMING_H_
|
||||
#define _STREAMING_H_
|
||||
#ifdef TEXSTREAM
|
||||
|
||||
#include "../gl/gl.h"
|
||||
|
||||
#ifndef GL_APIENTRYP
|
||||
#define GL_APIENTRYP
|
||||
#endif
|
||||
#ifndef GL_IMG_texture_stream
|
||||
#define GL_TEXTURE_STREAM_IMG 0x8C0D
|
||||
#define GL_TEXTURE_NUM_STREAM_DEVICES_IMG 0x8C0E
|
||||
@@ -11,17 +14,15 @@
|
||||
#define GL_TEXTURE_STREAM_DEVICE_HEIGHT_IMG 0x8EA0
|
||||
#define GL_TEXTURE_STREAM_DEVICE_FORMAT_IMG 0x8EA1
|
||||
#define GL_TEXTURE_STREAM_DEVICE_NUM_BUFFERS_IMG 0x8EA2
|
||||
#endif
|
||||
#ifndef GL_IMG_texture_stream
|
||||
#define GL_IMG_texture_stream 1
|
||||
typedef void (GL_APIENTRYP PFNGLTEXBINDSTREAMIMGPROC) (GLint device, GLint deviceoffset);
|
||||
typedef const GLubyte *(GL_APIENTRYP PFNGLGETTEXSTREAMDEVICENAMEIMGPROC) (GLenum target);
|
||||
typedef void (GL_APIENTRYP PFNGLGETTEXSTREAMDEVICEATTRIBUTEIVIMGPROC) (GLenum target, GLenum pname, GLint *params);
|
||||
#define GL_IMG_texture_stream 1
|
||||
#endif
|
||||
|
||||
extern PFNGLTEXBINDSTREAMIMGPROC glTexBindStreamIMG;
|
||||
extern PFNGLGETTEXSTREAMDEVICEATTRIBUTEIVIMGPROC glGetTexAttrIMG;
|
||||
extern PFNGLGETTEXSTREAMDEVICENAMEIMGPROC glGetTexDeviceIMG;
|
||||
extern PFNGLTEXBINDSTREAMIMGPROC *glTexBindStreamIMG;
|
||||
extern PFNGLGETTEXSTREAMDEVICEATTRIBUTEIVIMGPROC *glGetTexAttrIMG;
|
||||
extern PFNGLGETTEXSTREAMDEVICENAMEIMGPROC *glGetTexDeviceIMG;
|
||||
|
||||
extern int gl_stream; //0 if no streaming not 0 if streaming available
|
||||
|
||||
@@ -41,5 +42,5 @@ void ApplyFilterID(int ID, GLenum min_filter, GLenum mag_filter);
|
||||
void ActivateStreaming(int ID);
|
||||
// Function to deactivate the Streaming texture on current tex...
|
||||
void DeactivateStreaming();
|
||||
#endif
|
||||
#endif
|
||||
#endif //TEXSTREAM
|
||||
#endif //_STREAMING_H_
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user