Bug 945 - Clipping+fbo cloning bugs
* clutter/cogl/gl/cogl.c: * clutter/cogl/gles/cogl.c: * clutter/cogl/cogl.h.in: Add cogl_clip_stack_save, cogl_clip_stack_restore, cogl_viewport and cogl_frustum. * clutter/cogl/gl/cogl-fbo.h: * clutter/cogl/gl/cogl-fbo.c: Try to attach a stencil buffer when creating an FBO. * clutter/cogl/common/cogl-clip-stack.c: Add functions to save and restore the whole state of the stack. * clutter/clutter-texture.c (clutter_texture_paint): When rendering the FBO source, setup a temporary asymmetric perspective projection matrix to render it as it would appear on screen. * clutter/clutter-private.h: * clutter/clutter-actor.c (_clutter_actor_apply_modelview_transform_recursive): No longer static and exported in clutter-private.h
This commit is contained in:
@@ -666,6 +666,31 @@ cogl_wrap_glMultMatrixx (const GLfixed *m)
|
||||
cogl_wrap_glMultMatrix (new_matrix);
|
||||
}
|
||||
|
||||
void
|
||||
cogl_wrap_glFrustumx (GLfixed left, GLfixed right,
|
||||
GLfixed bottom, GLfixed top,
|
||||
GLfixed z_near, GLfixed z_far)
|
||||
{
|
||||
float matrix[16];
|
||||
float two_near = CLUTTER_FIXED_TO_FLOAT (2 * z_near);
|
||||
|
||||
memset (matrix, 0, sizeof (matrix));
|
||||
|
||||
matrix[0] = two_near / CLUTTER_FIXED_TO_FLOAT (right - left);
|
||||
matrix[5] = two_near / CLUTTER_FIXED_TO_FLOAT (top - bottom);
|
||||
matrix[8] = CLUTTER_FIXED_TO_FLOAT (right + left)
|
||||
/ CLUTTER_FIXED_TO_FLOAT (right - left);
|
||||
matrix[9] = CLUTTER_FIXED_TO_FLOAT (top + bottom)
|
||||
/ CLUTTER_FIXED_TO_FLOAT (top - bottom);
|
||||
matrix[10] = -CLUTTER_FIXED_TO_FLOAT (z_far + z_near)
|
||||
/ CLUTTER_FIXED_TO_FLOAT (z_far - z_near);
|
||||
matrix[11] = -1.0f;
|
||||
matrix[14] = -two_near * CLUTTER_FIXED_TO_FLOAT (z_far)
|
||||
/ CLUTTER_FIXED_TO_FLOAT (z_far - z_near);
|
||||
|
||||
cogl_wrap_glMultMatrix (matrix);
|
||||
}
|
||||
|
||||
void
|
||||
cogl_wrap_glScalex (GLfixed x, GLfixed y, GLfixed z)
|
||||
{
|
||||
|
Reference in New Issue
Block a user