evas/wayland_egl: Change some ifdefs to make it compile withot GLES.

This will not make the engine work, but its build won't fail.

SVN revision: 78554
This commit is contained in:
Rafael Antognolli 2012-10-26 18:54:45 +00:00
parent dd7e8ad1a7
commit 60dfe259c8
3 changed files with 34 additions and 5 deletions

View File

@ -350,10 +350,8 @@ struct _Evas_Engine_GL_Context
/* If this is set: Force drawing with a particular filter */
GLuint filter_prog;
#ifdef GL_GLES
// FIXME: hack. expose egl display to gl core for egl image sec extn.
// FIXME: hack. expose egl display to gl core for egl image sec extn.
void *egldisp;
#endif
};
struct _Evas_GL_Texture_Pool

View File

@ -2232,8 +2232,13 @@ _attach_fbo_surface(Render_Engine *data __UNUSED__,
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
#ifdef GL_GLES
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_STENCIL_OES, sfc->w, sfc->h,
0, GL_DEPTH_STENCIL_OES, GL_UNSIGNED_INT_24_8_OES, NULL);
#else
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_STENCIL, sfc->w, sfc->h,
0, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, NULL);
#endif
if (sfc->rt_msaa_samples)
{
glsym_glFramebufferTexture2DMultisample(GL_FRAMEBUFFER,
@ -2432,7 +2437,12 @@ _check_gl_surface_format(GLint int_fmt, GLenum fmt, GLenum attachment, GLenum at
if (attachment)
{
// This is a little hacky but this is how we'll have to do for now.
// PS: Now it's even more hacky.
#ifdef GL_GLES
if (attach_fmt == GL_DEPTH_STENCIL_OES)
#else
if (attach_fmt == GL_DEPTH_STENCIL)
#endif
{
glGenTextures(1, &ds_tex);
glBindTexture(GL_TEXTURE_2D, ds_tex);
@ -2440,8 +2450,13 @@ _check_gl_surface_format(GLint int_fmt, GLenum fmt, GLenum attachment, GLenum at
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
#ifdef GL_GLES
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_STENCIL_OES, w, h,
0, GL_DEPTH_STENCIL_OES, GL_UNSIGNED_INT_24_8_OES, NULL);
#else
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_STENCIL, w, h,
0, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, NULL);
#endif
if (mult_samples)
{
glsym_glFramebufferTexture2DMultisample(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT,
@ -2538,6 +2553,7 @@ _set_gl_surface_cap(Render_Engine *re)
re->gl_cap.depth_8[i] = _check_gl_surface_format(GL_RGBA, GL_RGBA, GL_DEPTH_ATTACHMENT, GL_DEPTH_COMPONENT, re->gl_cap.msaa_samples[i]);
re->gl_cap.depth_16[i] = _check_gl_surface_format(GL_RGBA, GL_RGBA, GL_DEPTH_ATTACHMENT, GL_DEPTH_COMPONENT16, re->gl_cap.msaa_samples[i]);
#ifdef GL_GLES
re->gl_cap.depth_24[i] = _check_gl_surface_format(GL_RGBA, GL_RGBA, GL_DEPTH_ATTACHMENT, GL_DEPTH_COMPONENT24_OES, re->gl_cap.msaa_samples[i]);
re->gl_cap.depth_32[i] = _check_gl_surface_format(GL_RGBA, GL_RGBA, GL_DEPTH_ATTACHMENT, GL_DEPTH_COMPONENT32_OES, re->gl_cap.msaa_samples[i]);
@ -2546,6 +2562,16 @@ _set_gl_surface_cap(Render_Engine *re)
re->gl_cap.stencil_8[i] = _check_gl_surface_format(GL_RGBA, GL_RGBA, GL_STENCIL_ATTACHMENT, GL_STENCIL_INDEX8, re->gl_cap.msaa_samples[i]);
re->gl_cap.depth_24_stencil_8[i] = _check_gl_surface_format(GL_RGBA, GL_RGBA, GL_DEPTH_STENCIL_OES, GL_DEPTH_STENCIL_OES, re->gl_cap.msaa_samples[i]);
#else
re->gl_cap.depth_24[i] = _check_gl_surface_format(GL_RGBA, GL_RGBA, GL_DEPTH_ATTACHMENT, GL_DEPTH_COMPONENT24, re->gl_cap.msaa_samples[i]);
re->gl_cap.depth_32[i] = _check_gl_surface_format(GL_RGBA, GL_RGBA, GL_DEPTH_ATTACHMENT, GL_DEPTH_COMPONENT32, re->gl_cap.msaa_samples[i]);
re->gl_cap.stencil_1[i] = _check_gl_surface_format(GL_RGBA, GL_RGBA, GL_STENCIL_ATTACHMENT, GL_STENCIL_INDEX1, re->gl_cap.msaa_samples[i]);
re->gl_cap.stencil_4[i] = _check_gl_surface_format(GL_RGBA, GL_RGBA, GL_STENCIL_ATTACHMENT, GL_STENCIL_INDEX4, re->gl_cap.msaa_samples[i]);
re->gl_cap.stencil_8[i] = _check_gl_surface_format(GL_RGBA, GL_RGBA, GL_STENCIL_ATTACHMENT, GL_STENCIL_INDEX8, re->gl_cap.msaa_samples[i]);
re->gl_cap.depth_24_stencil_8[i] = _check_gl_surface_format(GL_RGBA, GL_RGBA, GL_DEPTH_STENCIL, GL_DEPTH_STENCIL, re->gl_cap.msaa_samples[i]);
#endif
}
// _print_gl_surface_cap(re, 0);

View File

@ -11,8 +11,13 @@
#define GL_GLEXT_PROTOTYPES
#include <EGL/egl.h>
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#ifdef GL_GLES
# include <GLES2/gl2.h>
# include <GLES2/gl2ext.h>
#else
# include <GL/gl.h>
# include <GL/glext.h>
#endif
#include <wayland-egl.h>
extern int _evas_engine_wl_egl_log_dom;