summaryrefslogtreecommitdiff
path: root/vcl/inc/vcl/opengl.hxx
blob: 7d106bc8a1c8dcc9f96c5d722aafec8459c39e4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
/*************************************************************************
 *
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * Copyright 2008 by Sun Microsystems, Inc.
 *
 * OpenOffice.org - a multi-platform office productivity suite
 *
 * $RCSfile: opengl.hxx,v $
 * $Revision: 1.3 $
 *
 * This file is part of OpenOffice.org.
 *
 * OpenOffice.org is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License version 3
 * only, as published by the Free Software Foundation.
 *
 * OpenOffice.org 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 version 3 for more details
 * (a copy is included in the LICENSE file that accompanied this code).
 *
 * You should have received a copy of the GNU Lesser General Public License
 * version 3 along with OpenOffice.org.  If not, see
 * <http://www.openoffice.org/license.html>
 * for a copy of the LGPLv3 License.
 *
 ************************************************************************/

#ifndef _SV_OPENGL_HXX
#define _SV_OPENGL_HXX

#include <tools/gen.hxx>
#include <vcl/salotype.hxx>
#include <vcl/dllapi.h>

// ----------
// - OpenGL -
// ----------

class OutputDevice;
class SalOpenGL;
class RmOpenGL;

class VCL_DLLPUBLIC OpenGL
{
    static BOOL     mbNoOGL;

private:
    OutputDevice*   mpOutDev;
    SalOpenGL*      mpOGL;

    SAL_DLLPRIVATE void ImplInit();
    SAL_DLLPRIVATE BOOL ImplInitFncPointers();

public:
                    OpenGL( OutputDevice* pOutDev );
                    ~OpenGL();

    BOOL            IsValid() const { return( mpOGL != NULL ); }
    static void     Invalidate( BOOL bInvalid = TRUE ) { mbNoOGL = bInvalid; }

    void            SetConnectOutputDevice( OutputDevice* pOutDev );
    OutputDevice*   GetConnectOutputDevice() const { return mpOutDev; }

    void            ClearDepth( GLclampd fDepth );
    void            DepthFunc( GLenum eFunc );
    void            Enable( GLenum eCap );
    void            Disable( GLenum eCap );
    void            DepthMask( GLboolean bFlag );
    void            ShadeModel( GLenum eMode );
    void            EdgeFlag( GLboolean bFlag );
    void            Clear( GLbitfield nMask );
    void            Flush();
    void            Finish();
    void            Viewport( GLint nX, GLint nY, GLsizei nWidth, GLsizei nHeight );
    void            Begin( GLenum eMode );
    void            End();
    void            Vertex3dv( const GLdouble *fVar );
    void            Normal3dv( const GLdouble *fVar );
    void            TexCoord3dv( const GLdouble *fVar );
    void            Color4ub( GLubyte cRed, GLubyte cGreen, GLubyte cBlue, GLubyte cAlpha );
    void            Materialfv( GLenum eFace, GLenum ePName, const GLfloat *fParams );
    void            Materialf( GLenum eFace, GLenum ePName, GLfloat fParam );
    void            LightModelfv( GLenum ePName, const GLfloat *fParams );
    void            LightModelf( GLenum ePName, GLfloat fParam );
    void            Lightfv( GLenum eLight, GLenum ePName, const GLfloat *fParams );
    void            Lightf( GLenum eLight, GLenum ePName, GLfloat fParam );
    void            PolygonMode( GLenum eFace, GLenum eMode );
    void            CullFace( GLenum eMode );
    void            PointSize( GLfloat fSize );
    void            LineWidth( GLfloat fWidth );
    void            MatrixMode( GLenum eMode );
    void            LoadMatrixd( const GLdouble *fM );
    void            TexImage1D( GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels );
    void            TexImage2D( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels );
    void            CopyTexImage1D( GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border );
    void            CopyTexImage2D( GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border );
    void            CopyTexSubImage1D( GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width );
    void            CopyTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height );
    void            PixelTransferf( GLenum pname, GLfloat param );
    void            PixelTransferi( GLenum pname, GLint param );
    void            GetTexLevelParameterfv( GLenum target, GLint level, GLenum pname, GLfloat *params );
    void            GetTexLevelParameteriv( GLenum target, GLint level, GLenum pname, GLint *params );
    void            GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params );
    void            GetTexParameteriv( GLenum target, GLenum pname, GLint *params );
    void            TexSubImage1D( GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels );
    void            TexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels );
    void            PixelStoref( GLenum pname, GLfloat param );
    void            PixelStorei( GLenum pname, GLint param );
    void            GenTextures( GLsizei n, GLuint *textures );
    GLboolean       IsTexture( GLuint texture );
    void            BindTexture( GLenum target, GLuint texture );
    void            DeleteTextures( GLsizei n, const GLuint *textures );
    GLboolean       AreTexturesResident( GLsizei n, const GLuint *textures, GLboolean *residences );
    void            PrioritizeTextures( GLsizei n, const GLuint *textures, const GLclampf *priorities );
    void            TexEnvf( GLenum target, GLenum pname, GLfloat param );
    void            TexEnvfv( GLenum target, GLenum pname, const GLfloat *params );
    void            TexEnvi( GLenum target, GLenum pname, GLint param );
    void            TexEnviv( GLenum target, GLenum pname, const GLint *params );
    void            TexParameterf( GLenum target, GLenum pname, GLfloat param );
    void            TexParameterfv( GLenum target, GLenum pname, const GLfloat *params );
    void            TexParameteri( GLenum target, GLenum pname, GLint param );
    void            TexParameteriv( GLenum target, GLenum pname, const GLint *params );
    void            TexGend( GLenum coord, GLenum pname, GLdouble param );
    void            TexGendv( GLenum coord, GLenum pname, const GLdouble *params );
    void            TexGenf( GLenum coord, GLenum pname, GLfloat param );
    void            TexGenfv( GLenum coord, GLenum pname, const GLfloat *params );
    void            TexGeni( GLenum coord, GLenum pname, GLint param );
    void            TexGeniv( GLenum coord, GLenum pname, const GLint *params );
    void            TexCoord2dv( const GLdouble *pParams );
    void            GetIntegerv( GLenum pname, GLint *params );
    void            PolygonOffset( GLfloat factor, GLfloat units );
    void            Scissor( GLint x, GLint y, GLsizei width, GLsizei height );

    void            EnableClientState( GLenum array );
    void            DisableClientState( GLenum array );
    void            VertexPointer( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer );
    void            ColorPointer( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer );
    void            IndexPointer( GLenum type, GLsizei stride, const GLvoid *pointer );
    void            NormalPointer( GLenum type, GLsizei stride, const GLvoid *pointer );
    void            TexCoordPointer( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer );
    void            EdgeFlagPointer( GLsizei stride, const GLvoid *pointer );
    void            ArrayElement( GLint i );
    void            DrawElements( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices );
    void            DrawArrays( GLenum mode, GLint first, GLsizei count );
    void            InterleavedArrays( GLenum format, GLsizei stride, const GLvoid *pointer );

    void            LoadIdentity();
    void            BlendFunc( GLenum sfactor,  GLenum dfactor );

private:
                    OpenGL();
                    OpenGL( const OpenGL& );
    OpenGL&         operator=( const OpenGL& );
};

#endif // _SV_OPENGL_HXX