mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 16:10:41 -05:00
2008-02-01 Matthew Allum <mallum@openedhand.com>
* clutter/cogl/cogl.h: * clutter/cogl/gl/cogl.c: * clutter/cogl/gles/cogl.c: Disable the depth test and buffer as has some strange side effects, mainly on x/y axis rotation with multiple layers at same depth (eg rotating text on a bg has very strange effect). Seems no clean 100% effective way to fix without other odd issues.. So for now move to application to handle and add cogl_enable_depth_test() as for custom actors (i.e groups) to enable if need be.
This commit is contained in:
parent
307a18860c
commit
b97c326eca
3
cogl.h
3
cogl.h
@ -118,6 +118,9 @@ cogl_clip_unset (void);
|
||||
void
|
||||
cogl_enable (gulong flags);
|
||||
|
||||
void
|
||||
cogl_enable_depth_test (gboolean setting);
|
||||
|
||||
gboolean
|
||||
cogl_texture_can_size (COGLenum target,
|
||||
COGLenum pixel_format,
|
||||
|
36
gl/cogl.c
36
gl/cogl.c
@ -200,8 +200,19 @@ cogl_paint_init (const ClutterColor *color)
|
||||
glDisable (GL_LIGHTING);
|
||||
glDisable (GL_FOG);
|
||||
|
||||
glEnable (GL_DEPTH_TEST);
|
||||
glDepthFunc (GL_LEQUAL);
|
||||
/*
|
||||
* Disable the depth test for now as has some strange side effects,
|
||||
* mainly on x/y axis rotation with multiple layers at same depth
|
||||
* (eg rotating text on a bg has very strange effect). Seems no clean
|
||||
* 100% effective way to fix without other odd issues.. So for now
|
||||
* move to application to handle and add cogl_enable_depth_test()
|
||||
* as for custom actors (i.e groups) to enable if need be.
|
||||
*
|
||||
* glEnable (GL_DEPTH_TEST);
|
||||
* glEnable (GL_ALPHA_TEST)
|
||||
* glDepthFunc (GL_LEQUAL);
|
||||
* glAlphaFunc (GL_GREATER, 0.1);
|
||||
*/
|
||||
|
||||
cogl_enable (CGL_ENABLE_BLEND);
|
||||
glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
@ -308,22 +319,23 @@ cogl_enable (gulong flags)
|
||||
__enable_flags &= ~CGL_ENABLE_TEXTURE_RECT;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (flags & CGL_ENABLE_ALPHA_TEST)
|
||||
void
|
||||
cogl_enable_depth_test (gboolean setting)
|
||||
{
|
||||
if (setting)
|
||||
{
|
||||
if (!(__enable_flags & CGL_ENABLE_ALPHA_TEST))
|
||||
{
|
||||
glEnable (GL_ALPHA_TEST);
|
||||
__enable_flags |= CGL_ENABLE_ALPHA_TEST;
|
||||
}
|
||||
glEnable (GL_DEPTH_TEST);
|
||||
glEnable (GL_ALPHA_TEST);
|
||||
glDepthFunc (GL_LEQUAL);
|
||||
glAlphaFunc (GL_GREATER, 0.1);
|
||||
}
|
||||
else if (__enable_flags & CGL_ENABLE_ALPHA_TEST)
|
||||
else
|
||||
{
|
||||
glDisable (GL_DEPTH_TEST);
|
||||
glDisable (GL_ALPHA_TEST);
|
||||
__enable_flags &= ~CGL_ENABLE_ALPHA_TEST;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
18
gles/cogl.c
18
gles/cogl.c
@ -224,18 +224,22 @@ cogl_enable (gulong flags)
|
||||
__enable_flags &= ~CGL_ENABLE_TEXTURE_RECT;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if (flags & CGL_ENABLE_ALPHA_TEST)
|
||||
void
|
||||
cogl_enable_depth_test (gboolean setting)
|
||||
{
|
||||
if (setting)
|
||||
{
|
||||
if (!(__enable_flags & CGL_ENABLE_ALPHA_TEST))
|
||||
glEnable (GL_ALPHA_TEST);
|
||||
|
||||
__enable_flags |= CGL_ENABLE_ALPHA_TEST;
|
||||
glEnable (GL_DEPTH_TEST);
|
||||
glEnable (GL_ALPHA_TEST);
|
||||
glDepthFunc (GL_LEQUAL);
|
||||
glAlphaFunc (GL_GREATER, 0.1);
|
||||
}
|
||||
else if (__enable_flags & CGL_ENABLE_ALPHA_TEST)
|
||||
else
|
||||
{
|
||||
glDisable (GL_DEPTH_TEST);
|
||||
glDisable (GL_ALPHA_TEST);
|
||||
__enable_flags &= ~CGL_ENABLE_ALPHA_TEST;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user