/
redgpu
/
ezEngine
Обзор
Документация
Войти
/
redgpu
/
ezEngine
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
Code/ThirdParty/RmlUi/Source/Core/TextureLayoutRectangle.h
62 строки
2 KB
C-Core
Updated RmlUi to 6.2 and added some improvements (#1813)
10 фев 2026, 01:19
Не верифицирован
10 фев 2026, 01:19
58e2d41
Код
Авторство
О чём код?
#pragma once #include "../../Include/RmlUi/Core/Types.h" namespace Rml { /** A texture layout rectangle is an area positioned with a texture layout. */ class TextureLayoutRectangle { public: TextureLayoutRectangle(int id, Vector2i dimensions); ~TextureLayoutRectangle(); /// Returns the rectangle's id. /// @return The rectangle's id. int GetId() const; /// Returns the rectangle's position; this is only valid if it has been placed. /// @return The rectangle's position within its texture. Vector2i GetPosition() const; /// Returns the rectangle's dimensions. /// @return The rectangle's dimensions. Vector2i GetDimensions() const; /// Places the rectangle within a texture. /// @param[in] texture_index The index of the texture this rectangle is placed on. /// @param[in] position The position within the texture of this rectangle's top-left corner. void Place(int texture_index, Vector2i position); /// Unplaces the rectangle. void Unplace(); /// Returns the rectangle's placed state. /// @return True if the rectangle has been placed, false if not. bool IsPlaced() const; /// Sets the rectangle's texture data and stride. /// @param[in] texture_data The pointer to the top-left corner of the texture's data. /// @param[in] texture_stride The stride of the texture data, in bytes. void Allocate(byte* texture_data, int texture_stride); /// Returns the index of the texture this rectangle is placed on. /// @return The texture index. int GetTextureIndex(); /// Returns the rectangle's allocated texture data. /// @return The texture data. byte* GetTextureData(); /// Returns the stride of the rectangle's texture data. /// @return The texture data stride. int GetTextureStride() const; private: int id; Vector2i dimensions; int texture_index; Vector2i texture_position; byte* texture_data; int texture_stride; }; } // namespace Rml