Pioneer
Loading...
Searching...
No Matches
PiGuiRenderer.h
Go to the documentation of this file.
1// Copyright © 2008-2024 Pioneer Developers. See AUTHORS.txt for details
2// Licensed under the terms of the GPL v3. See licenses/GPL-3.txt
3
4#pragma once
5
6#include "graphics/Renderer.h"
7#include <memory>
8
9struct ImDrawData;
10
11namespace PiGui {
12
14 public:
16
17 void Initialize();
18 void Shutdown();
19
20 void NewFrame() {}
21
22 // Render a draw data to the screen using an orthographic projection
23 void RenderDrawData(ImDrawData *draw_data);
24
25 // Render a draw data struct using a user-defined material and rendering setup.
26 // The user is responsible for setting the transform and projection matrices before drawing.
27 // The provided material should support two parameters:
28 // - texture0: Texture2d
29 // - vertexDepth: float
30 void RenderDrawData(ImDrawData *draw_data, Graphics::Material* material);
31
32 void CreateFontsTexture();
34
35 private:
36 Graphics::Renderer *m_renderer;
37
38 std::unique_ptr<Graphics::Material> m_material;
39 std::unique_ptr<Graphics::VertexBuffer> m_vtxBuffer;
40 std::unique_ptr<Graphics::IndexBuffer> m_idxBuffer;
41 std::unique_ptr<Graphics::Texture> m_fontsTexture;
42 };
43} // namespace PiGui
Definition: Material.h:148
Definition: Renderer.h:45
Definition: PiGuiRenderer.h:13
void DestroyFontsTexture()
Definition: PiGuiRenderer.cpp:173
void Shutdown()
Definition: PiGuiRenderer.cpp:59
void CreateFontsTexture()
Definition: PiGuiRenderer.cpp:148
void NewFrame()
Definition: PiGuiRenderer.h:20
void RenderDrawData(ImDrawData *draw_data)
Definition: PiGuiRenderer.cpp:69
void Initialize()
Definition: PiGuiRenderer.cpp:26
Definition: GuiApplication.h:18