1
0
Fork 0

matrix: Flatten cogl-matrix-mesa.[ch] into cogl-matrix.[ch]

It has been overly cumbersome to work with the matrix code ever since we
pulled in the mesa code because we initially kept the mesa and the
original cogl code separate. We have made several updates to the mesa
code since integrating, and the coding style has changed a lot compared
to the original mesa code, so there's little point in keeping the two
files separate any longer.

Signed-off-by: Neil Roberts <neil@linux.intel.com>
This commit is contained in:
Robert Bragg 2011-06-30 21:54:19 +01:00
parent ee237be285
commit 8bfde524f8
4 changed files with 1589 additions and 1972 deletions

View file

@ -290,8 +290,6 @@ cogl_sources_c = \
$(srcdir)/cogl-journal.c \
$(srcdir)/cogl-framebuffer-private.h \
$(srcdir)/cogl-framebuffer.c \
$(srcdir)/cogl-matrix-mesa.h \
$(srcdir)/cogl-matrix-mesa.c \
$(srcdir)/cogl-profile.h \
$(srcdir)/cogl-profile.c \
$(srcdir)/cogl-flags.h \

File diff suppressed because it is too large Load diff

View file

@ -1,153 +0,0 @@
/*
* Cogl
*
* An object oriented GL/GLES Abstraction/Utility Layer
*
* Copyright (C) 2009 Intel Corporation.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*
*/
/*
* Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*
* \file math/m_matrix.h
* Defines basic structures for matrix-handling.
*/
#ifndef _M_MATRIX_H
#define _M_MATRIX_H
#include <cogl-matrix.h>
#include <cogl-quaternion.h>
#include <glib.h>
/*
* Symbolic names to some of the entries in the matrix
*
* These are handy for the viewport mapping, which is expressed as a matrix.
*/
#define MAT_SX 0
#define MAT_SY 5
#define MAT_SZ 10
#define MAT_TX 12
#define MAT_TY 13
#define MAT_TZ 14
/*
* These identify different kinds of 4x4 transformation matrices and we use
* this information to find fast-paths when available.
*/
enum CoglMatrixType {
COGL_MATRIX_TYPE_GENERAL, /**< general 4x4 matrix */
COGL_MATRIX_TYPE_IDENTITY, /**< identity matrix */
COGL_MATRIX_TYPE_3D_NO_ROT, /**< orthogonal projection and others... */
COGL_MATRIX_TYPE_PERSPECTIVE, /**< perspective projection matrix */
COGL_MATRIX_TYPE_2D, /**< 2-D transformation */
COGL_MATRIX_TYPE_2D_NO_ROT, /**< 2-D scale & translate only */
COGL_MATRIX_TYPE_3D /**< 3-D transformation */
} ;
void
_cogl_matrix_multiply (CoglMatrix *result,
const CoglMatrix *a,
const CoglMatrix *b);
void
_cogl_matrix_multiply_array (CoglMatrix *result, const float *b);
void
_cogl_matrix_init_from_array (CoglMatrix *matrix, const float *array);
void
_cogl_matrix_init_from_quaternion (CoglMatrix *matrix,
CoglQuaternion *quaternion);
void
_cogl_matrix_translate (CoglMatrix *matrix, float x, float y, float z);
void
_cogl_matrix_rotate (CoglMatrix *matrix, float angle,
float x, float y, float z);
void
_cogl_matrix_scale (CoglMatrix *matrix, float x, float y, float z);
void
_cogl_matrix_ortho (CoglMatrix *matrix,
float left, float right,
float bottom, float top,
float nearval, float farval);
void
_cogl_matrix_frustum (CoglMatrix *matrix,
float left, float right,
float bottom, float top,
float nearval, float farval);
void
_cogl_matrix_viewport (CoglMatrix *matrix,
float x, float y, float width, float height,
float z_near, float z_far, float depth_max);
void
_cogl_matrix_init_identity (CoglMatrix *matrix);
gboolean
_cogl_matrix_update_inverse (CoglMatrix *matrix);
void
_cogl_matrix_update_type_and_flags (CoglMatrix *matrix);
void
_cogl_matrix_print (const CoglMatrix *matrix);
gboolean
_cogl_matrix_is_length_preserving (const CoglMatrix *matrix);
gboolean
_cogl_matrix_has_rotation (const CoglMatrix *matrix);
gboolean
_cogl_matrix_is_general_scale (const CoglMatrix *matrix);
gboolean
_cogl_matrix_is_dirty (const CoglMatrix *matrix);
void
_cogl_matrix_util_transposef ( float to[16], const float from[16]);
#endif

File diff suppressed because it is too large Load diff