some infra for starting to handle dest-alpha (rgba) windows in gl engine.

not sure shaped windows will ever be sanely possible.



SVN revision: 43015
This commit is contained in:
Carsten Haitzler 2009-10-11 06:59:47 +00:00
parent 0a036d1ec2
commit a60f577446
4 changed files with 57 additions and 8 deletions

View File

@ -154,13 +154,13 @@ if test "x${have_dep}" = "xyes" ; then
evas_engine_gl_common_libs="-lGL -lpthread"
else
if test "x$2" = "xyes" ; then
x_libs="${x_libs} -lX11 -lXext"
x_libs="${x_libs} -lX11 -lXext -lXrender"
else
x_dir=${x_dir:-/usr/X11R6}
x_cflags=${x_cflags:--I${x_includes:-$x_dir/include}}
x_libs="${x_libs:--L${x_libraries:-$x_dir/lib}} -lX11"
x_libs="${x_libs:--L${x_libraries:-$x_dir/lib}} -lX11 -lXext -lXrender"
fi
AC_CHECK_HEADERS([EGL/egl.h X11/X.h X11/Xlib.h], [have_egl="yes"])
AC_CHECK_HEADERS([EGL/egl.h X11/X.h X11/Xlib.h X11/extensions/Xrender.h], [have_egl="yes"])
if test "x${have_egl}" = "xyes" ; then
have_gles20="no"
AC_CHECK_LIB(gles20, glTexImage2D, [have_gles20="yes"], , -lEGL)

View File

@ -86,7 +86,6 @@ evas_gl_common_context_new(void)
glEnable(GL_DITHER);
glDisable(GL_BLEND);
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
// for dest alpha
// glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDepthMask(GL_FALSE);

View File

@ -12,6 +12,7 @@
# include <X11/Xlib.h>
# include <X11/Xatom.h>
# include <X11/Xutil.h>
# include <X11/extensions/Xrender.h>
# elif defined(GLES_VARIETY_SGX)
# define SUPPORT_X11 1
# include <EGL/egl.h>
@ -19,12 +20,14 @@
# include <X11/Xlib.h>
# include <X11/Xatom.h>
# include <X11/Xutil.h>
# include <X11/extensions/Xrender.h>
# endif
# else
# include <GL/glx.h>
# include <X11/Xlib.h>
# include <X11/Xatom.h>
# include <X11/Xutil.h>
# include <X11/extensions/Xrender.h>
# include <GL/gl.h>
# include <GL/glx.h>
# endif

View File

@ -198,17 +198,64 @@ eng_best_visual_get(Display *disp, int screen)
XMatchVisualInfo(disp, screen, depth, TrueColor, _evas_gl_x11_vi);
// GLX
#else
int _evas_gl_x11_configuration[9] =
#if 0 // use this if we want alpha
int config_attrs[20];
GLXFBConfig *configs = NULL, config = 0;
int i, num;
config_attrs[0] = GLX_DRAWABLE_TYPE;
config_attrs[1] = GLX_WINDOW_BIT;
config_attrs[2] = GLX_DOUBLEBUFFER;
config_attrs[3] = 1;
config_attrs[4] = GLX_RED_SIZE;
config_attrs[5] = 1;
config_attrs[6] = GLX_GREEN_SIZE;
config_attrs[7] = 1;
config_attrs[8] = GLX_BLUE_SIZE;
config_attrs[9] = 1;
config_attrs[10] = None;
// if rgba
config_attrs[10] = GLX_ALPHA_SIZE;
config_attrs[11] = 1;
config_attrs[12] = GLX_RENDER_TYPE;
config_attrs[13] = GLX_RGBA_BIT;
config_attrs[14] = None;
configs = glXChooseFBConfig(disp, 0, config_attrs, &num);
for (i = 0; i < num; i++)
{
XVisualInfo *visinfo;
XRenderPictFormat *format;
visinfo = glXGetVisualFromFBConfig(disp, configs[i]);
if (!visinfo) continue;
format = XRenderFindVisualFormat(disp, visinfo->visual);
if (!format) continue;
if (format->direct.alphaMask > 0)
{
config = configs[i];
_evas_gl_x11_vi = visinfo;
break;
}
XFree(visinfo);
}
#else
int _evas_gl_x11_configuration[] =
{
GLX_DOUBLEBUFFER,
GLX_RGBA,
GLX_RED_SIZE, 1,
GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1,
GLX_RED_SIZE, 1,
GLX_GREEN_SIZE,1,
GLX_BLUE_SIZE, 1,
None
};
_evas_gl_x11_vi = glXChooseVisual(disp, screen,
_evas_gl_x11_configuration);
#endif
#endif
}
if (!_evas_gl_x11_vi) return NULL;