~ubuntu-branches/ubuntu/saucy/mupen64plus-video-arachnoid/saucy

« back to all changes in this revision

Viewing changes to .pc/unused_glu.patch/src/OpenGLManager.h

  • Committer: Package Import Robot
  • Author(s): Sven Eckelmann
  • Date: 2013-05-05 14:21:41 UTC
  • mfrom: (3.1.3 experimental)
  • Revision ID: package-import@ubuntu.com-20130505142141-hu122rcme4kvwy7c
Tags: 1.99.5-2
* Upload to unstable
* Remove obsolete DM-Upload-Allowed in debian/control
* Disable extra debug code in release builds with -DNDEBUG in
  debian/rules

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/******************************************************************************
2
 
 * Arachnoid Graphics Plugin for Mupen64Plus
3
 
 * http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
4
 
 *
5
 
 * Copyright (C) 2009 Jon Ring
6
 
 * Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
7
 
 *
8
 
 * This program is free software; you can redistribute it and/or
9
 
 * modify it under the terms of the GNU General Public License
10
 
 * as published by the Free Software Foundation; either version 2
11
 
 * of the License, or (at your option) any later version.
12
 
 *
13
 
 * This program is distributed in the hope that it will be useful,
14
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 
 * GNU General Public License for more details.
17
 
 *
18
 
 * You should have received a copy of the GNU General Public License
19
 
 * along with this program; if not, write to the Free Software
20
 
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21
 
 *****************************************************************************/
22
 
 
23
 
#ifndef OPEN_GL_Manager_H_
24
 
#define OPEN_GL_Manager_H_
25
 
 
26
 
//OpenGL includes
27
 
#include "m64p.h"
28
 
#include "OpenGL.h"
29
 
#include <GL/glu.h>
30
 
 
31
 
//*****************************************************************************
32
 
//* OpenGL Manager Class                                                        
33
 
//! Singelton class for initializing OpenGL and contolling OpenGL states. 
34
 
//*****************************************************************************
35
 
class OpenGLManager
36
 
{
37
 
public: 
38
 
 
39
 
    //Destructor
40
 
    ~OpenGLManager();
41
 
 
42
 
    //Singleton Instance
43
 
    static OpenGLManager& getSingleton()
44
 
    {
45
 
        static OpenGLManager instance;
46
 
        return instance;
47
 
    }
48
 
 
49
 
    //Functions
50
 
    bool initialize(bool fullscreen, int width, int height, int bitDepth, int refreshRate, bool vSync, bool hideCursor);
51
 
    void dispose();
52
 
    void resize(int width, int height, int bitDepth, int refreshRate);
53
 
    bool toggleFullscreen();
54
 
    void beginRendering();
55
 
    void endRendering();
56
 
 
57
 
    //Fog
58
 
    void setFogEnabled(bool fog);    
59
 
    bool getFogEnabled();
60
 
 
61
 
    //Light
62
 
    void setLighting(bool lighting);
63
 
    bool getLightingEnabled();
64
 
 
65
 
    //Textureing
66
 
    void setTextureing2D(bool textureing);
67
 
    bool getTextureing2DEnabled();
68
 
 
69
 
    //Depth Testing
70
 
    void setZBufferEnabled(bool enable);
71
 
    bool getZBufferEnabled();    
72
 
 
73
 
    //Alpha Test
74
 
    void setAlphaTest(bool alphaTestEnable);
75
 
    bool getAlphaTestEnabled();
76
 
 
77
 
    //Wireframe
78
 
    void setWireFrame(bool wireframe);    
79
 
 
80
 
    //Culling
81
 
    void setCullMode(bool cullFront, bool cullBack);
82
 
    void setForceDisableCulling(bool force) { m_forceDisableCulling = force; }
83
 
         
84
 
    //Set Viewport
85
 
    void setViewport(int x, int y, int width, int height, float zNear=0.0f, float zFar=1.0f);
86
 
 
87
 
    //Set Scissor
88
 
    void setScissorEnabled(bool enable);
89
 
    bool getScissorEnabled();    
90
 
    void setScissor(int x, int y, int width, int height);
91
 
 
92
 
    //! Sets the backround color of OpenGL viewport 
93
 
    void setClearColor(float r, float g, float b) { glClearColor(r, g, b, 1.0f); }
94
 
 
95
 
    //Set callback from the M64P core
96
 
    void setRenderingCallback(void(*callback)(int)) { m_renderingCallback = callback; }
97
 
        
98
 
        //Set draw flag for rendering callback
99
 
        void setDrawFlag() { m_drawFlag = 1; }
100
 
 
101
 
public:
102
 
 
103
 
    //N64 Specifics
104
 
    void calcViewScale(int viWidth, int viHeight);
105
 
    float getViewScaleX() { return m_scaleX; } 
106
 
    float getViewScaleY() { return m_scaleY; }
107
 
 
108
 
public:
109
 
 
110
 
    //Gets
111
 
 
112
 
    int getWidth() { return m_width; }
113
 
    int getHeight() { return m_height; }
114
 
    bool getFullscreen() { return m_fullscreen; }
115
 
 
116
 
private:
117
 
 
118
 
     //Constructor
119
 
    OpenGLManager();          
120
 
 
121
 
private:
122
 
 
123
 
    bool m_wireframe;            //!< Wireframe mode enabled?
124
 
    bool m_lighting;             //!< Lighting enabled?
125
 
    int m_width;                 //!< Display widht
126
 
    int m_height;                //!< Display height
127
 
    int m_bitDepth;              //!< Fullscreen bitdepth
128
 
    int m_refreshRate;           //!< Fullscreen refresh rate 
129
 
    float m_scaleX;              //!< DisplayWidth aka WindowWidth / viWidth (n64 specific)
130
 
    float m_scaleY;              //!< DisplayHeight aka WindowHeight / viHeight (n64 specific)
131
 
    bool m_fullscreen;           //!< Fullscreen mode or window mode?
132
 
    bool m_forceDisableCulling;  //!< Culling cant be enabled if this is true
133
 
    
134
 
    void (*m_renderingCallback)(int);  //Rendering callback from the core
135
 
        int m_drawFlag;
136
 
};
137
 
 
138
 
#endif