summaryrefslogtreecommitdiff
path: root/es_2_0
diff options
context:
space:
mode:
Diffstat (limited to 'es_2_0')
-rw-r--r--es_2_0/EGLImage.c8
-rwxr-xr-xes_2_0/Enable.c5
-rwxr-xr-xes_2_0/Program.c24
-rwxr-xr-xes_2_0/Shader.c8
-rwxr-xr-xes_2_0/Uniform.c8
-rwxr-xr-xes_2_0/es2front.h1
-rwxr-xr-xes_2_0/funcaction.inl1
-rwxr-xr-xes_2_0/makefile-dynamic4
8 files changed, 36 insertions, 23 deletions
diff --git a/es_2_0/EGLImage.c b/es_2_0/EGLImage.c
index b6d64de..a552519 100644
--- a/es_2_0/EGLImage.c
+++ b/es_2_0/EGLImage.c
@@ -9,7 +9,8 @@
#include <X11/Xutil.h>
#include <dlfcn.h>
-#define EGL_SO_FILENAME "libEGL.so"
+//#define EGL_SO_FILENAME "libEGL.so"
+#define EGL_SO_FILENAME "/usr/lib/host-gl/libEGL.so.1.0"
#define EGLCROSS_PREFIX "__hazel_cross__"
void* g_dlhandle_egl = NULL;
@@ -46,6 +47,7 @@ void GL_APIENTRY ES2ENTRY(EGLImageTargetTexture2DOES) (GLenum target,
fprintf (stderr, "======== height = 0x%x\n", (unsigned int)height);
fprintf (stderr, "======== depth = 0x%x\n", (unsigned int)depth);
+#if 0
img = XGetImage ((Display*)dpy, pixmap, 0, 0, width, height, AllPlanes, ZPixmap);
if (img == NULL) {
fprintf (stderr, "EGLImage: Failed to get pixmap image!\n");
@@ -54,5 +56,7 @@ void GL_APIENTRY ES2ENTRY(EGLImageTargetTexture2DOES) (GLenum target,
FNPTR(TexImage2D)(target, 0, GL_RGB, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, img->data);
XDestroyImage (img);
-
+#else
+ FNPTR(EGLImageTargetTexture2DOES)(target, pixmap);
+#endif
}
diff --git a/es_2_0/Enable.c b/es_2_0/Enable.c
index 8a7e2af..ddf83a5 100755
--- a/es_2_0/Enable.c
+++ b/es_2_0/Enable.c
@@ -45,11 +45,6 @@ void GL_APIENTRY ES2ENTRY(Enable)(GLenum cap) {
case GL_STENCIL_TEST:
FNPTR(Enable)(cap);
break;
- /*
- case GL_DEPTH_TEST:
- // disabled for poor supporting in WebGL.
- break;
- */
default:
ES2INTER(SetError)(GL_INVALID_ENUM);
break;
diff --git a/es_2_0/Program.c b/es_2_0/Program.c
index 1d1f2b9..ab0107d 100755
--- a/es_2_0/Program.c
+++ b/es_2_0/Program.c
@@ -97,10 +97,15 @@ GLuint GL_APIENTRY ES2ENTRY(CreateProgram)(void) {
void GL_APIENTRY ES2ENTRY(DeleteProgram)(GLuint program) {
if (program == 0) {
return;
- } else if (FNPTR(IsProgram)(program) == GL_FALSE) {
+ } else if (FNPTR(IsProgram) != NULL && FNPTR(IsProgram)(program) == GL_FALSE) {
+ ES2INTER(SetError)(GL_INVALID_VALUE);
+ return;
+ }
+ if (CCV(nProgramObjectAllocated) == NULL) {
ES2INTER(SetError)(GL_INVALID_VALUE);
return;
}
+
if (program < CCV(nProgramObjectAllocated)) {
GLint nAttachedShaders = 0;
FNPTR(GetProgramiv)(program, GL_ATTACHED_SHADERS, &nAttachedShaders);
@@ -164,22 +169,25 @@ void GL_APIENTRY ES2ENTRY(DetachShader)(GLuint program, GLuint shader) {
if ((GLint)(program) <= 0) {
ES2INTER(SetError)(GL_INVALID_VALUE);
return;
- } else if (FNPTR(IsProgram)(program) == GL_FALSE) {
+ } else if (FNPTR(IsProgram) != NULL && FNPTR(IsProgram)(program) == GL_FALSE) {
ES2INTER(SetError)(GL_INVALID_OPERATION);
return;
}
if ((GLint)(shader) <= 0) {
ES2INTER(SetError)(GL_INVALID_VALUE);
return;
- } else if (FNPTR(IsShader)(shader) == GL_FALSE) {
+ } else if (FNPTR(IsShader) != NULL && FNPTR(IsShader)(shader) == GL_FALSE) {
ES2INTER(SetError)(GL_INVALID_OPERATION);
return;
}
- FNPTR(DetachShader)(program, shader);
- pShader = &(CCV(pShaderObject)[shader]);
- if (pShader->nAttached > 0) pShader->nAttached--;
- if (pShader->nAttached == 0 && pShader->bDeleteStatus == GL_TRUE) {
- ES2INTER(ShaderObjectRelease)(pShader);
+ if (FNPTR(DetachShader) != NULL)
+ FNPTR(DetachShader)(program, shader);
+ if (CCV(pShaderObject) != NULL) {
+ pShader = &(CCV(pShaderObject)[shader]);
+ if (pShader->nAttached > 0)
+ pShader->nAttached--;
+ if (pShader->nAttached == 0 && pShader->bDeleteStatus == GL_TRUE)
+ ES2INTER(ShaderObjectRelease)(pShader);
}
}
diff --git a/es_2_0/Shader.c b/es_2_0/Shader.c
index 1e661d4..e53c92c 100755
--- a/es_2_0/Shader.c
+++ b/es_2_0/Shader.c
@@ -187,11 +187,15 @@ GLuint GL_APIENTRY ES2ENTRY(CreateShader)(GLenum type) {
void GL_APIENTRY ES2ENTRY(DeleteShader)(GLuint shader) {
if (shader == 0) {
return;
- } else if (FNPTR(IsShader)(shader) == GL_FALSE) {
+ } else if (FNPTR(IsShader) != NULL && FNPTR(IsShader)(shader) == GL_FALSE) {
ES2INTER(SetError)(GL_INVALID_VALUE);
return;
}
- FNPTR(DeleteShader)(shader);
+ if (FNPTR(DeleteShader) != NULL)
+ FNPTR(DeleteShader)(shader);
+ if (!CCV(nShaderObjectAllocated))
+ ES2INTER(SetError)(GL_INVALID_VALUE);
+ return;
if (shader < CCV(nShaderObjectAllocated)) {
struct ShaderObjectUnit* pUnit = &CCV(pShaderObject[shader]);
pUnit->bDeleteStatus = GL_TRUE;
diff --git a/es_2_0/Uniform.c b/es_2_0/Uniform.c
index d488f04..00046df 100755
--- a/es_2_0/Uniform.c
+++ b/es_2_0/Uniform.c
@@ -84,13 +84,13 @@ void GL_APIENTRY ES2ENTRY(GetUniformfv)(GLuint program, GLint location, GLfloat*
ES2INTER(SetError)(GL_INVALID_OPERATION);
return;
}
-/*
+
FNPTR(GetProgramiv)(program, GL_ACTIVE_UNIFORMS, &nActiveUniforms);
if (location < 0 || nActiveUniforms <= location) {
ES2INTER(SetError)(GL_INVALID_OPERATION);
return;
}
-*/
+
FNPTR(GetUniformfv)(program, location, params);
}
@@ -109,13 +109,13 @@ void GL_APIENTRY ES2ENTRY(GetUniformiv)(GLuint program, GLint location, GLint* p
ES2INTER(SetError)(GL_INVALID_OPERATION);
return;
}
-/*
+
FNPTR(GetProgramiv)(program, GL_ACTIVE_UNIFORMS, &nActiveUniforms);
if (location < 0 || nActiveUniforms <= location) {
ES2INTER(SetError)(GL_INVALID_OPERATION);
return;
}
-*/
+
FNPTR(GetUniformiv)(program, location, params);
}
diff --git a/es_2_0/es2front.h b/es_2_0/es2front.h
index f75e206..5e340ad 100755
--- a/es_2_0/es2front.h
+++ b/es_2_0/es2front.h
@@ -367,6 +367,7 @@ struct es2Context {
void (*fpFramebufferTexture2D)(GLenum, GLenum, GLenum, GLuint, GLint);
void (*fpGetFramebufferAttachmentParameteriv)(GLenum, GLenum, GLenum, GLint*);
GLenum (*fpCheckFramebufferStatus)(GLenum);
+ void (*fpEGLImageTargetTexture2DOES)(GLenum, GLint);
#if defined(PROVIDING_OES_texture_3D)
void (*fpTexImage3D)(GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid*);
void (*fpTexSubImage3D)(GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid*);
diff --git a/es_2_0/funcaction.inl b/es_2_0/funcaction.inl
index 22a29f8..51aa375 100755
--- a/es_2_0/funcaction.inl
+++ b/es_2_0/funcaction.inl
@@ -135,6 +135,7 @@
ACTION( FramebufferTexture2D );
ACTION( GetFramebufferAttachmentParameteriv );
ACTION( CheckFramebufferStatus );
+ ACTION( EGLImageTargetTexture2DOES );
#if defined(PROVIDING_OES_texture_3D)
ACTION( TexImage3D );
ACTION( TexSubImage3D );
diff --git a/es_2_0/makefile-dynamic b/es_2_0/makefile-dynamic
index 1fde268..3511dde 100755
--- a/es_2_0/makefile-dynamic
+++ b/es_2_0/makefile-dynamic
@@ -1,6 +1,6 @@
#!/bin/make
-CFLAGS = -I. -I../include -fPIC -Werror-implicit-function-declaration -O0 -g3
+CFLAGS = -I. -I../include -fPIC -Werror-implicit-function-declaration -O3 -g
ARFLAGS = rucv
CFLAGS += -DPROVIDING_OES_blend_func_separate
@@ -71,7 +71,7 @@ $(LIB): $(OBJS)
$(CC) -shared -Wl,-soname,$(LIBBASE).1 -o $@ $(OBJS) -ldl -lX11
install: $(LIB)
- cp $(LIB) ../lib
+ cp $(LIB) ../lib/host-gl/
# supports