22726e4d |
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 GRAPHICS_PLUGIN_H_ |
24 | #define GRAPHICS_PLUGIN_H_ |
25 | |
26 | #include "TextureCache.h" |
27 | #include "OpenGLManager.h" //Initializes OpenGL and handles OpenGL states |
28 | #include "RSP.h" |
29 | #include "RDP.h" |
30 | |
31 | //Forward declarations |
32 | //struct GFX_INFO; |
33 | class VI; |
34 | class Memory; |
35 | class DisplayListParser; |
36 | class FogManager; |
37 | class ROMDetector; |
38 | struct ConfigMap; |
39 | |
40 | //***************************************************************************** |
41 | //* Graphics Plugin |
42 | //! Main class for application |
43 | //***************************************************************************** |
44 | class GraphicsPlugin |
45 | { |
46 | public: |
47 | |
48 | //Constructor / Destructor |
49 | GraphicsPlugin(); |
50 | ~GraphicsPlugin(); |
51 | |
52 | //Set Configuration |
53 | void setConfig(ConfigMap* config) { m_config = config; } |
54 | void updateConfig(); |
55 | |
56 | //Function called when rom will be opened |
57 | bool initialize(GFX_INFO* graphicsInfo); |
58 | |
59 | //Render |
60 | void processDisplayList(); |
61 | void drawScreen(); |
62 | void setDrawScreenSignal(); |
63 | |
64 | //Toggle Fullscreen |
65 | void toggleFullscreen(); |
66 | |
67 | //Take Screenshot |
68 | void takeScreenshot(void *dest, int *width, int *height, int front); |
69 | |
70 | //Called when the video interface has been changed |
71 | void viStatusChanged(); |
72 | |
73 | //Function called when rom will be closed |
74 | void dispose(); |
75 | |
76 | private: |
77 | |
78 | //Config Options |
79 | void _setWindowMode(int width, int height); |
80 | void _setTextureCacheSize(int sizeInBytes); |
81 | |
82 | void _motionBlur(); |
83 | |
84 | private: |
85 | |
86 | GFX_INFO* m_graphicsInfo; //!< Information about window, memory... |
87 | RSP m_rsp; //!< Reality Signal Processor, does transform, clipping, lighting, triangle setup |
88 | RDP m_rdp; //!< Reality Drawing Processor |
89 | GBI m_gbi; //!< Graphics Binary Interface, handles mapping of GBI-commands |
90 | VI* m_vi; //!< Video Interface |
91 | Memory* m_memory; //!< Handle RDRAM, Texture Memory and Segments |
92 | TextureCache m_textureCache; //!< Save used texture for reuse |
93 | ROMDetector* m_romDetector; //!< |
94 | OpenGLManager& m_openGLMgr; //!< Handles initialization of OpenGL and OpenGL states. |
95 | DisplayListParser* m_displayListParser; //!< Parses and performs instructions from emulator |
96 | ConfigMap* m_config; //!< Settings from config dialog/file |
97 | FogManager* m_fogManager; //!< Handles fog extension |
98 | bool m_updateConfig; //!< Does configuration need to be updated? |
99 | bool m_initialized; //!< Have graphics plugin been initialized? |
100 | int m_numDListProcessed; |
101 | }; |
102 | |
103 | #endif |