ClutterBehaviourEllipse api changes; z_camera calculation
This commit is contained in:
parent
84257c9820
commit
4df0665012
@ -549,6 +549,8 @@ cogl_setup_viewport (guint width,
|
||||
ClutterFixed z_near,
|
||||
ClutterFixed z_far)
|
||||
{
|
||||
GLfloat z_camera;
|
||||
|
||||
GE( glViewport (0, 0, width, height) );
|
||||
|
||||
GE( glMatrixMode (GL_PROJECTION) );
|
||||
@ -562,7 +564,9 @@ cogl_setup_viewport (guint width,
|
||||
/* camera distance from screen, 0.5 * tan (FOV) */
|
||||
#define DEFAULT_Z_CAMERA 0.866025404f
|
||||
|
||||
GE( glTranslatef (-0.5f, -0.5f, -DEFAULT_Z_CAMERA) );
|
||||
z_camera = CLUTTER_FIXED_TO_FLOAT (clutter_tani (fovy) >> 1);
|
||||
|
||||
GE( glTranslatef (-0.5f, -0.5f, -z_camera) );
|
||||
GE( glScalef ( 1.0f / width,
|
||||
-1.0f / height,
|
||||
1.0f / width) );
|
||||
|
10
gles/cogl.c
10
gles/cogl.c
@ -489,7 +489,8 @@ cogl_setup_viewport (guint w,
|
||||
{
|
||||
gint width = (gint) w;
|
||||
gint height = (gint) h;
|
||||
|
||||
ClutterFixed z_camera;
|
||||
|
||||
GE( glViewport (0, 0, width, height) );
|
||||
GE( glMatrixMode (GL_PROJECTION) );
|
||||
GE( glLoadIdentity () );
|
||||
@ -505,10 +506,9 @@ cogl_setup_viewport (guint w,
|
||||
|
||||
/* camera distance from screen, 0.5 * tan (FOV) */
|
||||
#define DEFAULT_Z_CAMERA 0.866025404f
|
||||
|
||||
GE( glTranslatex (-1 << 15,
|
||||
-1 << 15,
|
||||
-CLUTTER_FLOAT_TO_FIXED(DEFAULT_Z_CAMERA)) );
|
||||
z_camera = clutter_tani (fovy) << 1;
|
||||
|
||||
GE( glTranslatex (-1 << 15, -1 << 15, -z_camera );
|
||||
|
||||
GE( glScalex ( CFX_ONE / width,
|
||||
-CFX_ONE / height,
|
||||
|
Loading…
Reference in New Issue
Block a user