MyGUI 3.2.0

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files
- Examples

- File List
- Globals

MyGUI_RenderFormat.h
Go to the documentation of this file.
1
6 /*
7 This file is part of MyGUI.
8
9 MyGUI is free software: you can redistribute it and/or modify
10 it under the terms of the GNU Lesser General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13
14 MyGUI is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU Lesser General Public License for more details.
18
19 You should have received a copy of the GNU Lesser General Public License
20 along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
21 */
22 #ifndef __MYGUI_RENDER_FORMAT_H__
23 #define __MYGUI_RENDER_FORMAT_H__
24
25 #include "MyGUI_Macros.h"
26
27 namespace MyGUI
28 {
29
30 struct MYGUI_EXPORT VertexColourType
31 {
32 public:
33 enum Enum
34 {
35 ColourARGB, // D3D style compact colour
36 ColourABGR, // GL style compact colour
37 MAX
38 };
39
40 VertexColourType(Enum _value = MAX) :
41 value(_value)
42 {
43 }
44
45 friend bool operator == (VertexColourType const& a, VertexColourType const& b)
46 {
47 return a.value == b.value;
48 }
49
50 friend bool operator != (VertexColourType const& a, VertexColourType const& b)
51 {
52 return a.value != b.value;
53 }
54
55 private:
56 Enum value;
57 };
58
59 struct MYGUI_EXPORT PixelFormat
60 {
61 enum Enum
62 {
63 Unknow,
64 L8, // 1 byte pixel format, 1 byte luminance
65 L8A8, // 2 byte pixel format, 1 byte luminance, 1 byte alpha
66 R8G8B8, // 24-bit pixel format, 8 bits for red, green and blue.
67 R8G8B8A8 // 32-bit pixel format, 8 bits for red, green, blue and alpha.
68 };
69
70 PixelFormat(Enum _value = Unknow) :
71 value(_value)
72 {
73 }
74
75 friend bool operator == (PixelFormat const& a, PixelFormat const& b)
76 {
77 return a.value == b.value;
78 }
79
80 friend bool operator != (PixelFormat const& a, PixelFormat const& b)
81 {
82 return a.value != b.value;
83 }
84
85 private:
86 Enum value;
87 };
88
89 struct MYGUI_EXPORT TextureUsage
90 {
91 enum Enum
92 {
93 Default = MYGUI_FLAG_NONE,
94 Static = MYGUI_FLAG(0),
95 Dynamic = MYGUI_FLAG(1),
96 Stream = MYGUI_FLAG(2),
97 Read = MYGUI_FLAG(3),
98 Write = MYGUI_FLAG(4),
99 RenderTarget = MYGUI_FLAG(5)
100 };
101
102 TextureUsage(Enum _value = Default) :
103 value(_value)
104 {
105 }
106
107 friend bool operator == (TextureUsage const& a, TextureUsage const& b)
108 {
109 return a.value == b.value;
110 }
111
112 friend bool operator != (TextureUsage const& a, TextureUsage const& b)
113 {
114 return a.value != b.value;
115 }
116
117 TextureUsage& operator |= (TextureUsage const& _other)
118 {
119 value = Enum(int(value) | int(_other.value));
120 return *this;
121 }
122
123 friend TextureUsage operator | (Enum const& a, Enum const& b)
124 {
125 return TextureUsage(Enum(int(a) | int(b)));
126 }
127
128 friend TextureUsage operator | (TextureUsage const& a, TextureUsage const& b)
129 {
130 return TextureUsage(Enum(int(a.value) | int(b.value)));
131 }
132
133 bool isValue(Enum _value) const
134 {
135 return 0 != (value & _value);
136 }
137
138 private:
139 Enum value;
140 };
141
142 } // namespace MyGUI
143
144
145 #endif // __MYGUI_RENDER_FORMAT_H__
MyGUI::FontCodeType::Enum
Enum
Definition: MyGUI_FontData.h:33
MyGUI::VertexColourType::ColourARGB
Definition: MyGUI_RenderFormat.h:35
MyGUI::TextureUsage::Enum
Enum
Definition: MyGUI_RenderFormat.h:91
MyGUI::PixelFormat::R8G8B8
Definition: MyGUI_RenderFormat.h:66
MyGUI::PixelFormat::Enum
Enum
Definition: MyGUI_RenderFormat.h:61
MyGUI::TextureUsage::TextureUsage
TextureUsage(Enum _value=Default)
Definition: MyGUI_RenderFormat.h:102
MyGUI::operator!=
bool operator!=(const UString::_const_fwd_iterator &left, const UString::_const_fwd_iterator &right)
Definition: MyGUI_UString.h:1049
MyGUI::PixelFormat::L8
Definition: MyGUI_RenderFormat.h:64
MyGUI_Macros.h
MyGUI::operator==
bool operator==(const UString::_const_fwd_iterator &left, const UString::_const_fwd_iterator &right)
Definition: MyGUI_UString.h:1046
MYGUI_FLAG
#define MYGUI_FLAG(num)
Definition: MyGUI_Macros.h:39
MyGUI::VertexColourType
Definition: MyGUI_RenderFormat.h:30
MyGUI::TextureUsage
Definition: MyGUI_RenderFormat.h:89
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition: MyGUI_Platform.h:120
MyGUI::TextureUsage::isValue
bool isValue(Enum _value) const
Definition: MyGUI_RenderFormat.h:133
MyGUI::PixelFormat::Unknow
Definition: MyGUI_RenderFormat.h:63
MyGUI::PixelFormat::PixelFormat
PixelFormat(Enum _value=Unknow)
Definition: MyGUI_RenderFormat.h:70
MYGUI_FLAG_NONE
#define MYGUI_FLAG_NONE
Definition: MyGUI_Macros.h:38
MyGUI::PixelFormat
Definition: MyGUI_RenderFormat.h:59
MyGUI::VertexColourType::Enum
Enum
Definition: MyGUI_RenderFormat.h:33
MyGUI::PixelFormat::L8A8
Definition: MyGUI_RenderFormat.h:65
MyGUI::VertexColourType::VertexColourType
VertexColourType(Enum _value=MAX)
Definition: MyGUI_RenderFormat.h:40
MyGUI::VertexColourType::ColourABGR
Definition: MyGUI_RenderFormat.h:36