29#ifndef DVD_CEGUIRenderer_Divide_h_
30#define DVD_CEGUIRenderer_Divide_h_
32#include "CEGUI/Base.h"
33#include "CEGUI/Renderer.h"
34#include "CEGUI/Size.h"
35#include "CEGUI/Vector.h"
36#include "CEGUI/Rect.h"
37#include "CEGUI/TextureTarget.h"
39#include "CEGUI/Config.h"
41#include <glm/mat4x4.hpp>
45# pragma warning(disable : 4251)
58 struct MemoryBarrierCommand;
66class DVDGeometryBuffer;
95#pragma region Renderer Interface
111 [[nodiscard]] Texture&
createTexture(
const String& name)
override;
112 [[nodiscard]] Texture&
createTexture(
const String& name,
const String& filename,
const String& resourceGroup)
override;
113 [[nodiscard]] Texture&
createTexture(
const String& name,
const Sizef& size)
override;
114 [[nodiscard]] Texture&
getTexture(
const String& name)
const override;
117 [[nodiscard]]
const Vector2f&
getDisplayDPI()
const override;
127 void bindDefaultState(
bool scissor, BlendMode mode,
const glm::mat4& viewProjMat );
134 [[nodiscard]]
Divide::GFX::MemoryBarrierCommand*
memCmd() const;
void beginRendering() override
@ BLEND_NORMAL_NO_SCISSOR
@ BLEND_PREMULTIPLIED_NO_SCISSOR
@ BLEND_PREMULTIPLIED_SCISSOR
Texture & createTexture(const String &name) override
void destroyTexture(Texture &texture) override
bool isTextureDefined(const String &name) const override
void setActiveRenderTarget(RenderTarget *renderTarget)
static void LogTextureCreation(const String &name)
Helper to safely log the creation of a named texture.
Divide::Handle< Divide::Texture > getTextureTarget() const
void setViewProjectionMatrix(const glm::mat4 &viewProjectionMatrix)
void destroyAllTextures() override
static String s_rendererID
String holding the renderer identification text.
void destroyGeometryBuffer(const GeometryBuffer &buffer) override
Divide::GFXDevice & _context
Parent app's graphics context.
GeometryBuffer & createGeometryBuffer() override
Divide::GFX::CommandBuffer * cmdBuffer() const
const Vector2f & getDisplayDPI() const override
TextureMap _textures
Container used to track textures.
RenderTarget * _activeRenderTarget
The active RenderTarget.
Divide::GFXDevice & context()
std::map< String, DVDTexture *, StringFastLessCompare CEGUI_MAP_ALLOC(String, DVDTexture *)> TextureMap
container type used to hold Textures we create.
void destroyTextureTarget(TextureTarget *target) override
void setDisplaySize(const Sizef &sz) override
Texture & getTexture(const String &name) const override
Divide::vector< DVDGeometryBuffer * > GeometryBufferList
container type used to hold GeometryBuffers created.
std::array< Divide::Pipeline *, Divide::to_base(PipelineType::COUNT)> PipelineContainer
container type used to hold our various compiled pipelines needed for rendering
const String & getIdentifierString() const override
RenderTarget & getDefaultRenderTarget() override
RenderTarget * _defaultTarget
The default RenderTarget.
PipelineType _activePipelineType
Active pipeline type bound for rendering. Used to index into the "_pipelines" container.
bool flipClippingHeight() const noexcept
uint getMaxTextureSize() const override
Vector2f _displayDPI
What the renderer considers to be the current display DPI resolution.
const bool _flipClippingHeight
Clipping direction is the only thing we need to manually adjust between rendering APIs....
TextureTarget * createTextureTarget() override
const Rectf & getActiveViewPort() const
void destroyAllTextureTargets() override
Divide::GFX::MemoryBarrierCommand * _memCmdInOut
Memory command from the parent app used to protected geometry buffer updates.
PipelineContainer _pipelines
Container used to store our compiled pipelines.
Divide::GFX::MemoryBarrierCommand * memCmd() const
const Sizef & getDisplaySize() const override
static void LogTextureDestruction(const String &name)
Helper to safely log the destruction of a named texture.
void endRendering() override
glm::mat4 _viewProjectionMatrix
View projection matrix.
Sizef _displaySize
What the renderer considers to be the current display size.
const glm::mat4 & getViewProjectionMatrix() const noexcept
static void destroy(CEGUIRenderer &renderer)
TextureTargetList _textureTargets
Container used to track texture targets.
Divide::vector< TextureTarget * > TextureTargetList
container type used to hold TextureTargets we create.
static CEGUIRenderer & create(Divide::GFXDevice &context, Divide::Handle< Divide::ShaderProgram > shader, CEGUI::Sizef resolution, int abi=CEGUI_VERSION_ABI)
Divide::GFX::CommandBuffer * _bufferInOut
Command buffer from the parent app used to queue up rendering commands.
GeometryBufferList _geometryBuffers
Container used to track geometry buffers.
void bindDefaultState(bool scissor, BlendMode mode, const glm::mat4 &viewProjMat)
void destroyAllGeometryBuffers() override
Rough around the edges Adapter pattern abstracting the actual rendering API and access to the GPU.
Handle console commands that start with a forward slash.
eastl::vector< Type > vector
constexpr auto to_base(const Type value) -> Type