~mc-return/compiz/compiz.merge-src-screen.cpp-improvements

« back to all changes in this revision

Viewing changes to include/opengl/matrix.h

  • Committer: Dennis kasprzyk
  • Author(s): Dennis Kasprzyk
  • Date: 2009-03-15 05:09:18 UTC
  • Revision ID: git-v1:163f6b6f3c3b7764987cbdf8e03cc355edeaa499
New generalized build system.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright © 2008 Danny Baumann
3
 
 *
4
 
 * Permission to use, copy, modify, distribute, and sell this software
5
 
 * and its documentation for any purpose is hereby granted without
6
 
 * fee, provided that the above copyright notice appear in all copies
7
 
 * and that both that copyright notice and this permission notice
8
 
 * appear in supporting documentation, and that the name of
9
 
 * Dennis Kasprzyk not be used in advertising or publicity pertaining to
10
 
 * distribution of the software without specific, written prior permission.
11
 
 * Dennis Kasprzyk makes no representations about the suitability of this
12
 
 * software for any purpose. It is provided "as is" without express or
13
 
 * implied warranty.
14
 
 *
15
 
 * DENNIS KASPRZYK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16
 
 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
17
 
 * NO EVENT SHALL DENNIS KASPRZYK BE LIABLE FOR ANY SPECIAL, INDIRECT OR
18
 
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
19
 
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
20
 
 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
21
 
 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22
 
 *
23
 
 * Authors: Danny Baumann <maniac@compiz-fusion.org>
24
 
 */
25
 
 
26
 
#ifndef _GLMATRIX_H
27
 
#define _GLMATRIX_H
28
 
 
29
 
#include <opengl/vector.h>
30
 
 
31
 
class CompOutput;
32
 
 
33
 
class GLMatrix {
34
 
    public:
35
 
        GLMatrix ();
36
 
        GLMatrix (const float *);
37
 
 
38
 
        const float* getMatrix () const;
39
 
 
40
 
        GLMatrix& operator*= (const GLMatrix& rhs);
41
 
 
42
 
        float& operator[] (unsigned int pos);
43
 
 
44
 
        void reset ();
45
 
        void toScreenSpace (const CompOutput *output, float z);
46
 
 
47
 
        void rotate (const float angle, const float x,
48
 
                     const float y, const float z);
49
 
        void rotate (const float angle, const GLVector& vector);
50
 
 
51
 
        void scale (const float x, const float y, const float z);
52
 
        void scale (const GLVector& vector);
53
 
 
54
 
        void translate (const float x, const float y, const float z);
55
 
        void translate (const GLVector& vector);
56
 
 
57
 
    private:
58
 
        friend GLMatrix operator* (const GLMatrix& lhs,
59
 
                                   const GLMatrix& rhs);
60
 
        friend GLVector operator* (const GLMatrix& lhs,
61
 
                                   const GLVector& rhs);
62
 
 
63
 
        float m[16];
64
 
};
65
 
 
66
 
#endif