MyGUI
3.5.3
Main Page
Related Pages
Namespaces
Data Structures
Files
Examples
File List
Globals
MyGUIEngine
src
MyGUI_TextureUtility.cpp
Go to the documentation of this file.
1
/*
2
* This source file is part of MyGUI. For the latest info, see http://mygui.info/
3
* Distributed under the MIT License
4
* (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
5
*/
6
7
#include "
MyGUI_Precompiled.h
"
8
#include "
MyGUI_TextureUtility.h
"
9
#include "
MyGUI_RenderManager.h
"
10
11
namespace
MyGUI::texture_utility
12
{
13
14
#if !defined(MYGUI_DONT_USE_OBSOLETE)
15
const
IntSize
&
getTextureSize
(
const
std::string& _texture,
bool
_cache)
16
{
17
return
RenderManager::getInstance().getTextureSize(_texture, _cache);
18
}
19
#endif
20
21
uint32
toNativeColour
(
const
Colour& _colour, VertexColourType
_format
)
22
{
23
uint32
val32 =
uint8
(_colour.alpha * 255);
24
val32 <<= 8;
25
if
(
_format
== VertexColourType::ColourABGR)
26
{
27
val32 +=
uint8
(_colour.blue * 255);
28
val32 <<= 8;
29
val32 +=
uint8
(_colour.green * 255);
30
val32 <<= 8;
31
val32 +=
uint8
(_colour.red * 255);
32
}
33
else
34
{
35
val32 +=
uint8
(_colour.red * 255);
36
val32 <<= 8;
37
val32 +=
uint8
(_colour.green * 255);
38
val32 <<= 8;
39
val32 +=
uint8
(_colour.blue * 255);
40
}
41
return
val32;
42
}
43
44
void
convertColour
(
uint32
& _colour, VertexColourType
_format
)
45
{
46
if
(
_format
== VertexColourType::ColourABGR)
47
_colour = ((_colour & 0x00FF0000) >> 16) | ((_colour & 0x000000FF) << 16) | (_colour & 0xFF00FF00);
48
}
49
50
}
// namespace MyGUI
MyGUI_Precompiled.h
MyGUI_RenderManager.h
MyGUI_TextureUtility.h
MyGUI::texture_utility
Definition
MyGUI_TextureUtility.h:15
MyGUI::texture_utility::getTextureSize
const IntSize & getTextureSize(const std::string &_texture, bool _cache)
Definition
MyGUI_TextureUtility.cpp:15
MyGUI::texture_utility::_format
VertexColourType _format
Definition
MyGUI_TextureUtility.h:18
MyGUI::texture_utility::convertColour
void convertColour(uint32 &_colour, VertexColourType _format)
Definition
MyGUI_TextureUtility.cpp:44
MyGUI::texture_utility::toNativeColour
uint32 toNativeColour(const Colour &_colour, VertexColourType _format)
Definition
MyGUI_TextureUtility.cpp:21
MyGUI::uint32
uint32_t uint32
Definition
MyGUI_Types.h:47
MyGUI::uint8
uint8_t uint8
Definition
MyGUI_Types.h:45
MyGUI::IntSize
types::TSize< int > IntSize
Definition
MyGUI_Types.h:29
Generated by
1.18.0