KarmaEngine
Game Engine for practical learning and research purposes
Loading...
Searching...
No Matches
Karma::KarmaGuiRenderer Class Reference

Renderer for the KarmaGui. More...

#include <KarmaGuiRenderer.h>

Static Public Member Functions

static void SetUpKarmaGuiRenderer (GLFWwindow *window)
 Sets the renderer for KarmaGui based on programmer's choice.
static void OnKarmaGuiLayerDetach ()
static void OnKarmaGuiLayerBegin ()
static void OnKarmaGuiLayerEnd ()
static KarmaGuiBackendRendererUserDataGetBackendRendererUserData ()
 Acessor function for KarmaGui's renderer backend (BackendRendererUserData).
static void AddImageTexture (char const *fileName, const std::string &label)
static void KarmaGui_ImplVulkan_Init (KarmaGui_ImplVulkan_InitInfo *initInfo)
 Initialize Vulkan backend renderer.
static void CreateDescriptorPool ()
static void GracefulVulkanShutDown ()
 Calls CleanUpVulkanAndWindowData() and does the shutting of GLFW and KarmaGui (KarmaGui::DestroyContext).
static void CleanUpVulkanAndWindowData ()
 Cleaning up vulkan allocated resources.
static void GiveLoopBeginControlToVulkan ()
static void GiveLoopEndControlToVulkan ()
static void FrameRender (KarmaGui_ImplVulkanH_Window *windowData, KGDrawData *drawData)
 Commandbuffer recording for KarmaGui primitives along with additional 2D render targets in KarmaGui_ImplVulkan_Data::Elements3DTo2D and submission to vulkan queue.
static void FramePresent (KarmaGui_ImplVulkanH_Window *windowData)
 Issues vkQueuePresentKHR to present graphics on screen.
static KGTextureID Add3DSceneFor2DRendering (std::shared_ptr< Scene > scene, KGVec2 dimensions)
 Creates the vulkan resources for 2D texture (render target) from 3D meshes or scene.

Detailed Description

Renderer for the KarmaGui.

Since
Karma 1.0.0

Member Function Documentation

◆ Add3DSceneFor2DRendering()

KGTextureID Karma::KarmaGuiRenderer::Add3DSceneFor2DRendering ( std::shared_ptr< Scene > scene,
KGVec2 dimensions )
static

Creates the vulkan resources for 2D texture (render target) from 3D meshes or scene.

Parameters
sceneThe 3D scene to be rendered to 2D texture
dimensionsThe dimensions of KarmaGui window in which 2D texture is displayed
See also
texture id being used in KarmaGuiMesa::Draw3DModelExhibitorMesa
Since
Karma 1.0.0

◆ CleanUpVulkanAndWindowData()

void Karma::KarmaGuiRenderer::CleanUpVulkanAndWindowData ( )
static

Cleaning up vulkan allocated resources.

Since
Karma 1.0.0

◆ FramePresent()

void Karma::KarmaGuiRenderer::FramePresent ( KarmaGui_ImplVulkanH_Window * windowData)
static

Issues vkQueuePresentKHR to present graphics on screen.

Parameters
windowDataThe data required for the frames_in_flight tracking, swapchain presenting, and semaphore signalling
Since
Karma 1.0.0

◆ FrameRender()

void Karma::KarmaGuiRenderer::FrameRender ( KarmaGui_ImplVulkanH_Window * windowData,
KGDrawData * drawData )
static

Commandbuffer recording for KarmaGui primitives along with additional 2D render targets in KarmaGui_ImplVulkan_Data::Elements3DTo2D and submission to vulkan queue.

Parameters
windowDataThe data required for recording the commandbuffer for KarmaGui primitives
drawDataKarmaGui primitives, basically containing KGDrawList, total vertex and index counts
Since
Karma 1.0.0

◆ GetBackendRendererUserData()

KarmaGuiBackendRendererUserData * Karma::KarmaGuiRenderer::GetBackendRendererUserData ( )
static

Acessor function for KarmaGui's renderer backend (BackendRendererUserData).

Note
We define our own KarmaGuiBackendRendererUserData for supporting OpenGL and Vulkan.
Since
Karma 1.0.0

◆ GracefulVulkanShutDown()

void Karma::KarmaGuiRenderer::GracefulVulkanShutDown ( )
static

Calls CleanUpVulkanAndWindowData() and does the shutting of GLFW and KarmaGui (KarmaGui::DestroyContext).

Since
Karma 1.0.0

◆ KarmaGui_ImplVulkan_Init()

void Karma::KarmaGuiRenderer::KarmaGui_ImplVulkan_Init ( KarmaGui_ImplVulkan_InitInfo * initInfo)
static

Initialize Vulkan backend renderer.

Todo
Think about using moving the function to KarmaGuiVulkanHandler::KarmaGui_ImplVulkan_Init instead (for better keeping IDK?)
Since
Karma 1.0.0

◆ SetUpKarmaGuiRenderer()

void Karma::KarmaGuiRenderer::SetUpKarmaGuiRenderer ( GLFWwindow * window)
static

Sets the renderer for KarmaGui based on programmer's choice.

Todo
Move the Vulkan part to KarmaGuiVulkanHandler for instance KarmaGui_ImplVulkan_Init. Or maybe just ponder first since I seem to have attempted that.

The documentation for this class was generated from the following files: