MyGUI  3.0.1
MyGUI_RenderFormat.h
Go to the documentation of this file.
1 
7 /*
8  This file is part of MyGUI.
9 
10  MyGUI is free software: you can redistribute it and/or modify
11  it under the terms of the GNU Lesser General Public License as published by
12  the Free Software Foundation, either version 3 of the License, or
13  (at your option) any later version.
14 
15  MyGUI is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  GNU Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public License
21  along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
22 */
23 #ifndef __MYGUI_RENDER_FORMAT_H__
24 #define __MYGUI_RENDER_FORMAT_H__
25 
26 #include "MyGUI_Macros.h"
27 
28 namespace MyGUI
29 {
30 
32  {
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) : value(_value) { }
41 
42  friend bool operator == (VertexColourType const& a, VertexColourType const& b) { return a.value == b.value; }
43  friend bool operator != (VertexColourType const& a, VertexColourType const& b) { return a.value != b.value; }
44 
45  private:
46  Enum value;
47  };
48 
50  {
51  enum Enum
52  {
54  L8, // 1 byte pixel format, 1 byte luminance
55  L8A8, // 2 byte pixel format, 1 byte luminance, 1 byte alpha
56  R8G8B8, // 24-bit pixel format, 8 bits for red, green and blue.
57  R8G8B8A8 // 32-bit pixel format, 8 bits for red, green, blue and alpha.
58  };
59 
60  PixelFormat(Enum _value = Unknow) : value(_value) { }
61 
62  friend bool operator == (PixelFormat const& a, PixelFormat const& b) { return a.value == b.value; }
63  friend bool operator != (PixelFormat const& a, PixelFormat const& b) { return a.value != b.value; }
64 
65  private:
66  Enum value;
67  };
68 
70  {
71  enum Enum
72  {
73  Default = MYGUI_FLAG_NONE,
74  Static = MYGUI_FLAG(0),
75  Dynamic = MYGUI_FLAG(1),
76  Stream = MYGUI_FLAG(2),
77  Read = MYGUI_FLAG(3),
78  Write = MYGUI_FLAG(4),
79  RenderTarget = MYGUI_FLAG(5)
80  };
81 
82  TextureUsage(Enum _value = Default) : value(_value) { }
83 
84  friend bool operator == (TextureUsage const& a, TextureUsage const& b) { return a.value == b.value; }
85  friend bool operator != (TextureUsage const& a, TextureUsage const& b) { return a.value != b.value; }
86 
87  TextureUsage& operator |= (TextureUsage const& _other) { value = Enum(int(value) | int(_other.value)); return *this; }
88  friend TextureUsage operator | (Enum const& a, Enum const& b) { return TextureUsage(Enum(int(a) | int(b))); }
89  friend TextureUsage operator | (TextureUsage const& a, TextureUsage const& b) { return TextureUsage(Enum(int(a.value) | int(b.value))); }
90 
91  bool isValue(Enum _value) { return 0 != (value & _value); }
92 
93  private:
94  Enum value;
95  };
96 
97 } // namespace MyGUI
98 
99 
100 #endif // __MYGUI_RENDER_FORMAT_H__