Pyrogenesis
13997
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
source
gui
GUIRenderer.h
Go to the documentation of this file.
1
/* Copyright (C) 2013 Wildfire Games.
2
* This file is part of 0 A.D.
3
*
4
* 0 A.D. is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation, either version 2 of the License, or
7
* (at your option) any later version.
8
*
9
* 0 A.D. is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
16
*/
17
18
#ifndef GUIRenderer_h
19
#define GUIRenderer_h
20
21
#include "
graphics/ShaderTechnique.h
"
22
#include "
graphics/Texture.h
"
23
#include "
lib/res/handle.h
"
24
#include "
ps/Overlay.h
"
25
#include "
ps/CStr.h
"
26
#include <vector>
27
28
struct
SGUIImageEffects
;
29
struct
SGUIImage
;
30
31
namespace
GUIRenderer
32
{
33
class
IGLState
34
{
35
public
:
36
virtual
~IGLState
() {};
37
virtual
void
Set
(
const
CTexturePtr
& tex)=0;
38
virtual
void
Unset
()=0;
39
};
40
41
struct
SDrawCall
42
{
43
SDrawCall
(
const
SGUIImage
* image) :
m_Image
(image) {}
44
CRect
ComputeTexCoords
()
const
;
45
46
const
SGUIImage
*
m_Image
;
47
48
bool
m_HasTexture
;
49
CTexturePtr
m_Texture
;
50
51
CRect
m_ObjectSize
;
52
int
m_CellID
;
53
54
bool
m_EnableBlending
;
55
56
CShaderTechniquePtr
m_Shader
;
57
CColor
m_ShaderColorParameter
;
58
59
CRect
m_Vertices
;
60
float
m_DeltaZ
;
61
62
CColor
m_BorderColor
;
// == CColor() for no border
63
CColor
m_BackColor
;
64
};
65
66
class
DrawCalls
:
public
std::vector<SDrawCall>
67
{
68
public
:
69
DrawCalls
();
70
// Copy/assignment results in an empty list, not an actual copy
71
DrawCalls
(
const
DrawCalls
&);
72
DrawCalls
&
operator=
(
const
DrawCalls
&);
73
};
74
}
75
76
#include "
gui/CGUISprite.h
"
77
78
namespace
GUIRenderer
79
{
80
void
UpdateDrawCallCache
(DrawCalls &Calls,
const
CStr& SpriteName,
const
CRect
& Size,
int
CellID, std::map<CStr, CGUISprite> &Sprites);
81
82
void
Draw
(DrawCalls &Calls,
float
Z
);
83
}
84
85
#endif // GUIRenderer_h
GUIRenderer::SDrawCall::ComputeTexCoords
CRect ComputeTexCoords() const
Definition:
GUIRenderer.cpp:259
SGUIImageEffects
Definition:
CGUISprite.h:65
GUIRenderer::SDrawCall::m_CellID
int m_CellID
Definition:
GUIRenderer.h:52
GUIRenderer::SDrawCall::m_Texture
CTexturePtr m_Texture
Definition:
GUIRenderer.h:49
Texture.h
CStr.h
Overlay.h
CColor
Definition:
Overlay.h:34
GUIRenderer::SDrawCall::m_ObjectSize
CRect m_ObjectSize
Definition:
GUIRenderer.h:51
GUIRenderer::SDrawCall::m_HasTexture
bool m_HasTexture
Definition:
GUIRenderer.h:48
GUIRenderer::IGLState::Set
virtual void Set(const CTexturePtr &tex)=0
CShaderTechniquePtr
shared_ptr< CShaderTechnique > CShaderTechniquePtr
Definition:
ShaderTechnique.h:112
GUIRenderer::SDrawCall::m_Vertices
CRect m_Vertices
Definition:
GUIRenderer.h:59
GUIRenderer::SDrawCall::m_DeltaZ
float m_DeltaZ
Definition:
GUIRenderer.h:60
handle.h
GUIRenderer::SDrawCall::m_EnableBlending
bool m_EnableBlending
Definition:
GUIRenderer.h:54
GUIRenderer::IGLState::Unset
virtual void Unset()=0
GUIRenderer::DrawCalls::operator=
DrawCalls & operator=(const DrawCalls &)
Definition:
GUIRenderer.cpp:53
GUIRenderer::DrawCalls
Definition:
GUIRenderer.h:66
GUIRenderer::IGLState::~IGLState
virtual ~IGLState()
Definition:
GUIRenderer.h:36
GUIRenderer::UpdateDrawCallCache
void UpdateDrawCallCache(DrawCalls &Calls, const CStr &SpriteName, const CRect &Size, int CellID, std::map< CStr, CGUISprite > &Sprites)
Definition:
GUIRenderer.cpp:59
SGUIImage
A CGUISprite is actually a collage of several real sprites, this struct represents is such real sprit...
Definition:
CGUISprite.h:77
GUIRenderer::SDrawCall
Definition:
GUIRenderer.h:41
GUIRenderer::SDrawCall::m_ShaderColorParameter
CColor m_ShaderColorParameter
Definition:
GUIRenderer.h:57
Z
Definition:
Decompose.h:22
CGUISprite.h
GUIRenderer::SDrawCall::m_BorderColor
CColor m_BorderColor
Definition:
GUIRenderer.h:62
GUIRenderer::SDrawCall::SDrawCall
SDrawCall(const SGUIImage *image)
Definition:
GUIRenderer.h:43
GUIRenderer::Draw
void Draw(DrawCalls &Calls, float Z)
Definition:
GUIRenderer.cpp:331
GUIRenderer::SDrawCall::m_Image
const SGUIImage * m_Image
Definition:
GUIRenderer.h:46
GUIRenderer::SDrawCall::m_Shader
CShaderTechniquePtr m_Shader
Definition:
GUIRenderer.h:56
GUIRenderer::SDrawCall::m_BackColor
CColor m_BackColor
Definition:
GUIRenderer.h:63
GUIRenderer::IGLState
Definition:
GUIRenderer.h:33
ShaderTechnique.h
GUIRenderer::DrawCalls::DrawCalls
DrawCalls()
Definition:
GUIRenderer.cpp:37
CRect
Rectangle class used for screen rectangles.
Definition:
Overlay.h:71
CTexturePtr
shared_ptr< CTexture > CTexturePtr
Definition:
Texture.h:22
Generated on Mon Oct 14 2013 00:58:06 for Pyrogenesis by
1.8.5