Rigs of Rods 2023.09
Soft-body Physics Simulation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches
GPUManager.h
Go to the documentation of this file.
1/*
2--------------------------------------------------------------------------------
3This source file is part of SkyX.
4Visit http://www.paradise-studios.net/products/skyx/
5
6Copyright (C) 2009-2012 Xavier Vergu�n Gonz�lez <xavyiy@gmail.com>
7
8This program is free software; you can redistribute it and/or modify it under
9the terms of the GNU Lesser General Public License as published by the Free Software
10Foundation; either version 2 of the License, or (at your option) any later
11version.
12
13This program is distributed in the hope that it will be useful, but WITHOUT
14ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16
17You should have received a copy of the GNU Lesser General Public License along with
18this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19Place - Suite 330, Boston, MA 02111-1307, USA, or go to
20http://www.gnu.org/copyleft/lesser.txt.
21--------------------------------------------------------------------------------
22*/
23
24#ifndef _SkyX_GPUManager_H_
25#define _SkyX_GPUManager_H_
26
27#include "Prerequisites.h"
28
29namespace SkyX
30{
31 class SkyX;
32
34 {
35 public:
39 {
40 // Vertex program
42 // Fragment program
44 };
45
49 GPUManager(SkyX *s);
50
54
60 void addGroundPass(Ogre::Pass* GroundPass, const Ogre::Real& AtmosphereRadius, const Ogre::SceneBlendType& SBT = Ogre::SBT_ADD);
61
68 void setGpuProgramParameter(const GpuProgram &GpuP, const Ogre::String &Name, const int &Value, const bool& UpdateGroundPasses = true);
69
76 void setGpuProgramParameter(const GpuProgram &GpuP, const Ogre::String &Name, const Ogre::Real &Value, const bool& UpdateGroundPasses = true);
77
84 void setGpuProgramParameter(const GpuProgram &GpuP, const Ogre::String &Name, const Ogre::Vector2 &Value, const bool& UpdateGroundPasses = true);
85
92 void setGpuProgramParameter(const GpuProgram &GpuP, const Ogre::String &Name, const Ogre::Vector3 &Value, const bool& UpdateGroundPasses = true);
93
97 const Ogre::String getSkydomeMaterialName() const;
98
102 inline const Ogre::String getMoonMaterialName() const
103 {
104 return "SkyX_Moon";
105 }
106
110 void _updateFP();
111
116 {
117 mSkydomeMaterial = static_cast<Ogre::MaterialPtr>(Ogre::MaterialManager::getSingleton().getByName(getSkydomeMaterialName()));
118
119 if (!mSkydomeMaterial)
120 {
121 SkyXLOG("Error in SkyX::GPUManager: '" + getSkydomeMaterialName() + "' material not found");
122 return;
123 }
124 }
125
126 private:
131 void _setTextureHWGammaCorrection(const Ogre::String& n, const bool& g);
132
134 Ogre::MaterialPtr mSkydomeMaterial;
136 std::vector<Ogre::Pass*> mGroundPasses;
137
140 };
141}
142
143#endif
void _notifySkydomeMaterialChanged()
Notify skydome material changed.
Definition GPUManager.h:115
~GPUManager()
Destructor.
void setGpuProgramParameter(const GpuProgram &GpuP, const Ogre::String &Name, const int &Value, const bool &UpdateGroundPasses=true)
Set gpu program int parameter.
std::vector< Ogre::Pass * > mGroundPasses
Ground pass vector.
Definition GPUManager.h:136
SkyX * mSkyX
SkyX parent pointer.
Definition GPUManager.h:139
void _setTextureHWGammaCorrection(const Ogre::String &n, const bool &g)
Set texture HW gamma correction.
const Ogre::String getMoonMaterialName() const
Get moon material name.
Definition GPUManager.h:102
Ogre::MaterialPtr mSkydomeMaterial
Skydome material.
Definition GPUManager.h:134
const Ogre::String getSkydomeMaterialName() const
Get skydome material name.
void _updateFP()
Update fragment program materials.
GpuProgram
Gpu program enum.
Definition GPUManager.h:39
void addGroundPass(Ogre::Pass *GroundPass, const Ogre::Real &AtmosphereRadius, const Ogre::SceneBlendType &SBT=Ogre::SBT_ADD)
Add ground pass (Use for atmospheric scattering effect on the terrain)
#define SkyXLOG(msg)
Include external headers.