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
TextureManager.h
Go to the documentation of this file.
1/*
2--------------------------------------------------------------------------------
3This source file is part of Hydrax.
4Visit ---
5
6Copyright (C) 2008 Xavier Vergu�n Gonz�lez <xavierverguin@hotmail.com>
7 <xavyiy@gmail.com>
8
9This program is free software; you can redistribute it and/or modify it under
10the terms of the GNU Lesser General Public License as published by the Free Software
11Foundation; either version 2 of the License, or (at your option) any later
12version.
13
14This program is distributed in the hope that it will be useful, but WITHOUT
15ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
17
18You should have received a copy of the GNU Lesser General Public License along with
19this program; if not, write to the Free Software Foundation, Inc., 59 Temple
20Place - Suite 330, Boston, MA 02111-1307, USA, or go to
21http://www.gnu.org/copyleft/lesser.txt.
22--------------------------------------------------------------------------------
23*/
24
25#ifndef _Hydrax_TextureManager_H_
26#define _Hydrax_TextureManager_H_
27
28#include "Prerequisites.h"
29
30#include "Enums.h"
31#include "Image.h"
32
35
38
39namespace Hydrax
40{
41 class Hydrax;
42
46 {
47 public:
51 {
52 // Normal map
54 };
55
60
64
68 void create(const Size &Size);
69
72 void remove();
73
82 inline bool update(const TexturesID &Id, Image &Image)
83 {
84 if (Id == TEX_NORMAL_ID)
85 {
86 return _updateNormalMap(Image);
87 }
88
89 return false;
90 }
91
96 inline Ogre::TexturePtr& getTexture(const TexturesID &Id)
97 {
98 return mTextures[static_cast<int>(Id)];
99 }
100
105 inline const Ogre::String& getTextureName(const TexturesID &Id) const
106 {
107 return mTextureNames[static_cast<int>(Id)];
108 }
109
110 private:
117 bool _createTexture(Ogre::TexturePtr &Texture, const Ogre::String &Name, const Size &Size);
118
123 Ogre::TexturePtr _getTexture(const Ogre::String &Name);
124
131
133 Ogre::TexturePtr mTextures[1];
135 Ogre::String mTextureNames[1];
136
139
142 };
143}
144
147
148#endif
Class for store variable channels of an image.
Definition Image.h:43
Class for manager Normal maps.
Ogre::TexturePtr mTextures[1]
Our Ogre::TexturePtr array.
Hydrax * mHydrax
Hydrax main pointer.
Ogre::String mTextureNames[1]
Our Ogre::String array for store texture's names.
void create(const Size &Size)
Create height and normal map textures.
bool _createTexture(Ogre::TexturePtr &Texture, const Ogre::String &Name, const Size &Size)
Create an Ogre::Texture.
const Ogre::String & getTextureName(const TexturesID &Id) const
Get texture's name.
Ogre::TexturePtr & getTexture(const TexturesID &Id)
Get texture.
TexturesID
Textures enumeration.
bool mCreated
Have been created already called?
void remove()
Remove textures.
Ogre::TexturePtr _getTexture(const Ogre::String &Name)
Get an Ogre::TexturePtr.
bool update(const TexturesID &Id, Image &Image)
Update.
bool _updateNormalMap(Image &Image)
Update normal map.
Struct wich contains an especific width and height value.
Definition Help.h:41