#evas_gl_polygon.c \
#
-libevas_engine_gl_common_la_LIBADD = @EINA_LIBS@ @evas_engine_gl_common_libs@
+libevas_engine_gl_common_la_LIBADD = @EINA_LIBS@ @evas_engine_gl_common_libs@ @dlopen_libs@
endif
EXTRA_DIST = \
#ifdef BUILD_ENGINE_GL_QUARTZ
# include <OpenGL/gl.h>
+# include <OpenGL/glext.h>
#else
# if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
# if defined(GLES_VARIETY_S3C6410)
# include <GLES2/gl2.h>
-//// this changed. this was the old style. above the new style
-//# include <GLES/gl.h>
# elif defined(GLES_VARIETY_SGX)
# include <GLES2/gl2.h>
+# include <GLES2/gl2ext.h>
# endif
# else
# include <GL/gl.h>
+# include <GL/glext.h>
# endif
#endif
void evas_gl_font_texture_draw(Evas_GL_Context *gc, void *surface, RGBA_Draw_Context *dc, RGBA_Font_Glyph *fg, int x, int y);
+void (*glsym_glGenFramebuffers) (GLsizei a, GLuint *b);
+void (*glsym_glBindFramebuffer) (GLenum a, GLuint b);
+void (*glsym_glFramebufferTexture2D) (GLenum a, GLenum b, GLenum c, GLuint d, GLint e);
+void (*glsym_glDeleteFramebuffers) (GLsizei a, const GLuint *b);
+
#include "evas_gl_private.h"
-
+
+static int sym_done = 0;
+
+void (*glsym_glGenFramebuffers) (GLsizei a, GLuint *b) = NULL;
+void (*glsym_glBindFramebuffer) (GLenum a, GLuint b) = NULL;
+void (*glsym_glFramebufferTexture2D) (GLenum a, GLenum b, GLenum c, GLuint d, GLint e) = NULL;
+void (*glsym_glDeleteFramebuffers) (GLsizei a, const GLuint *b) = NULL;
+
+static void
+sym_missing(void)
+{
+ printf("EVAS ERROR - GL symbols missing!\n");
+}
+
+static void
+gl_symbols(void)
+{
+ if (sym_done) return;
+ sym_done = 1;
+
+#define FINDSYM(dst, sym) if (!dst) dst = dlsym(RTLD_DEFAULT, sym)
+#define FALLBAK(dst) if (!dst) dst = (void *)sym_missing;
+
+ FINDSYM(glsym_glGenFramebuffers, "glGenFramebuffers");
+ FINDSYM(glsym_glGenFramebuffers, "glGenFramebuffersEXT");
+ FALLBAK(glsym_glGenFramebuffers);
+
+ FINDSYM(glsym_glBindFramebuffer, "glBindFramebuffer");
+ FINDSYM(glsym_glBindFramebuffer, "glBindFramebufferEXT");
+ FALLBAK(glsym_glBindFramebuffer);
+
+ FINDSYM(glsym_glFramebufferTexture2D, "glFramebufferTexture2D");
+ FINDSYM(glsym_glFramebufferTexture2D, "glFramebufferTexture2DEXT");
+ FALLBAK(glsym_glFramebufferTexture2D);
+
+ FINDSYM(glsym_glDeleteFramebuffers, "glDeleteFramebuffers");
+ FINDSYM(glsym_glDeleteFramebuffers, "glDeleteFramebuffersEXT");
+ FALLBAK(glsym_glDeleteFramebuffers);
+}
+
static void shader_array_flush(Evas_GL_Context *gc);
static Evas_GL_Context *_evas_gl_common_context = NULL;
{
Evas_GL_Context *gc;
+ gl_symbols();
#if 1
if (_evas_gl_common_context)
{
# endif
#endif
if (gc->shader.surface == gc->def_surface)
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ glsym_glBindFramebuffer(GL_FRAMEBUFFER, 0);
else
- glBindFramebuffer(GL_FRAMEBUFFER, surface->tex->pt->fb);
+ glsym_glBindFramebuffer(GL_FRAMEBUFFER, surface->tex->pt->fb);
_evas_gl_common_viewport_set(gc);
}
#define _EVAS_GL_PRIVATE_H
#include "evas_gl_common.h"
+#include <dlfcn.h> /* dlopen,dlclose,etc */
+
#endif
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
_tex_2d(pt->intformat, w, h, pt->format, pt->dataformat);
- glGenFramebuffers(1, &(pt->fb));
- glBindFramebuffer(GL_FRAMEBUFFER, pt->fb);
- glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, pt->texture, 0);
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
+
+ glsym_glGenFramebuffers(1, &(pt->fb));
+ glsym_glBindFramebuffer(GL_FRAMEBUFFER, pt->fb);
+ glsym_glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, pt->texture, 0);
+ glsym_glBindFramebuffer(GL_FRAMEBUFFER, 0);
+
glBindTexture(GL_TEXTURE_2D, gc->shader.cur_tex);
return pt;
}
pt->gc->shared->tex.atlas [pt->slot][pt->fslot] =
eina_list_remove(pt->gc->shared->tex.atlas[pt->slot][pt->fslot], pt);
glDeleteTextures(1, &(pt->texture));
- if (pt->fb) glDeleteFramebuffers(1, &(pt->fb));
+ if (pt->fb) glsym_glDeleteFramebuffers(1, &(pt->fb));
free(pt);
}
# define SUPPORT_X11 1
# include <EGL/egl.h>
# include <GLES2/gl2.h>
+# include <GLES2/gl2ext.h>
# include <X11/Xlib.h>
# include <X11/Xatom.h>
# include <X11/Xutil.h>
# include <X11/Xutil.h>
# include <X11/extensions/Xrender.h>
# include <GL/gl.h>
+# include <GL/glext.h>
# include <GL/glx.h>
# endif
#endif