SDEngine
Game Engine
Loading...
Searching...
No Matches
sd::View Struct Reference

#include <View.hpp>

+ Collaboration diagram for sd::View:

Public Member Functions

 View (const std::string &name, const EngineServices &services)
 
 ~View ()
 
void on_update (float dt)
 
void on_gui_render ()
 
void on_event (EventVariant &e)
 
void on_render (vk::CommandBuffer cmd)
 
void on_fixed_update (double dt)
 
template<typename T , typename... Args>
requires std::is_base_of_v<Layer, T>
T & push_layer (Args &&... args)
 
template<typename T , typename... Args>
requires std::is_base_of_v<Layer, T>
T & push_layer (int stageOrder, Args &&... args)
 
const std::string & get_name () const
 
ViewId get_view_id () const
 
bool is_open () const
 
void set_open (bool open)
 
LayerListget_layers ()
 
const LayerListget_layers () const
 
vk::Extent2D get_extent () const
 
void resize (vk::Extent2D extent)
 
AspectMode get_aspect_mode () const
 
void set_aspect_mode (AspectMode mode)
 
RenderMode get_render_mode () const
 
void set_render_mode (RenderMode mode)
 
const VLA::Matrix4x4f & get_projection () const
 
bool consume_extent_changed ()
 Returns true (once) if the extent changed since the last call.
 
ImVec2 get_content_region_pos () const
 
ImVec2 get_content_region_extent () const
 
vk::Extent2D get_im_gui_extent ()
 
vk::Format get_color_format () const
 
vk::Format get_depth_format () const
 
vk::ImageView get_color_view () const
 
vk::ImageView get_depth_view () const
 
VkDescriptorSet get_display_texture () const
 
void create_viewport (VkExtent2D initialExtent={1280, 720})
 
void destroy_viewport ()
 
vk::Format find_depth_format ()
 
void create_vulkan_resources ()
 

Public Attributes

std::string m_name
 
LayerList m_layers
 
bool m_open = true
 
ViewId m_view_id
 
VulkanContextm_vulkan_ctx
 
SDImGuiContextm_imgui_ctx
 
Applicationm_app = nullptr
 
ImVec2 m_content_region_pos {0, 0}
 
ImVec2 m_content_region_extent {0, 0}
 
vk::Image m_color_image = VK_NULL_HANDLE
 
VmaAllocation m_color_allocation = VK_NULL_HANDLE
 
vk::UniqueImageView m_color_view
 
vk::Image m_depth_image = VK_NULL_HANDLE
 
VmaAllocation m_depth_allocation = VK_NULL_HANDLE
 
vk::UniqueImageView m_depth_view
 
VkDescriptorSet m_display_tex_ds = VK_NULL_HANDLE
 
vk::Format m_color_format = vk::Format::eR8G8B8A8Unorm
 
vk::Format m_depth_format = vk::Format::eUndefined
 
VLA::Matrix4x4f m_camera_view_projection
 
vk::Extent2D m_extent = {1280, 720}
 
bool m_extent_changed = false
 
AspectMode m_aspect_mode = AspectMode::BEST_FIT
 
RenderMode m_render_mode = RenderMode::SHADED
 

Friends

class Application
 
class ViewManager
 

Constructor & Destructor Documentation

◆ View()

sd::View::View ( const std::string &  name,
const EngineServices services 
)
inline

◆ ~View()

sd::View::~View ( )

Member Function Documentation

◆ consume_extent_changed()

bool sd::View::consume_extent_changed ( )
inline

Returns true (once) if the extent changed since the last call.

◆ create_viewport()

void sd::View::create_viewport ( VkExtent2D  initialExtent = {1280, 720})

◆ create_vulkan_resources()

void sd::View::create_vulkan_resources ( )

◆ destroy_viewport()

void sd::View::destroy_viewport ( )

◆ find_depth_format()

vk::Format sd::View::find_depth_format ( )

◆ get_aspect_mode()

AspectMode sd::View::get_aspect_mode ( ) const
inline

◆ get_color_format()

vk::Format sd::View::get_color_format ( ) const
inline

◆ get_color_view()

vk::ImageView sd::View::get_color_view ( ) const
inline

◆ get_content_region_extent()

ImVec2 sd::View::get_content_region_extent ( ) const
inline

◆ get_content_region_pos()

ImVec2 sd::View::get_content_region_pos ( ) const
inline

◆ get_depth_format()

vk::Format sd::View::get_depth_format ( ) const
inline

◆ get_depth_view()

vk::ImageView sd::View::get_depth_view ( ) const
inline

◆ get_display_texture()

VkDescriptorSet sd::View::get_display_texture ( ) const
inline

◆ get_extent()

vk::Extent2D sd::View::get_extent ( ) const
inline

◆ get_im_gui_extent()

vk::Extent2D sd::View::get_im_gui_extent ( )

◆ get_layers() [1/2]

LayerList & sd::View::get_layers ( )
inline

◆ get_layers() [2/2]

const LayerList & sd::View::get_layers ( ) const
inline

◆ get_name()

const std::string & sd::View::get_name ( ) const
inline

◆ get_projection()

const VLA::Matrix4x4f & sd::View::get_projection ( ) const
inline

◆ get_render_mode()

RenderMode sd::View::get_render_mode ( ) const
inline

◆ get_view_id()

ViewId sd::View::get_view_id ( ) const
inline

◆ is_open()

bool sd::View::is_open ( ) const
inline

◆ on_event()

void sd::View::on_event ( EventVariant e)
inline

◆ on_fixed_update()

void sd::View::on_fixed_update ( double  dt)
inline

◆ on_gui_render()

void sd::View::on_gui_render ( )

◆ on_render()

void sd::View::on_render ( vk::CommandBuffer  cmd)

◆ on_update()

void sd::View::on_update ( float  dt)
inline

◆ push_layer() [1/2]

template<typename T , typename... Args>
requires std::is_base_of_v<Layer, T>
T & sd::View::push_layer ( Args &&...  args)
inline

◆ push_layer() [2/2]

template<typename T , typename... Args>
requires std::is_base_of_v<Layer, T>
T & sd::View::push_layer ( int  stageOrder,
Args &&...  args 
)
inline

◆ resize()

void sd::View::resize ( vk::Extent2D  extent)

◆ set_aspect_mode()

void sd::View::set_aspect_mode ( AspectMode  mode)
inline

◆ set_open()

void sd::View::set_open ( bool  open)
inline

◆ set_render_mode()

void sd::View::set_render_mode ( RenderMode  mode)
inline

Friends And Related Symbol Documentation

◆ Application

◆ ViewManager

Member Data Documentation

◆ m_app

Application* sd::View::m_app = nullptr

◆ m_aspect_mode

AspectMode sd::View::m_aspect_mode = AspectMode::BEST_FIT

◆ m_camera_view_projection

VLA::Matrix4x4f sd::View::m_camera_view_projection

◆ m_color_allocation

VmaAllocation sd::View::m_color_allocation = VK_NULL_HANDLE

◆ m_color_format

vk::Format sd::View::m_color_format = vk::Format::eR8G8B8A8Unorm

◆ m_color_image

vk::Image sd::View::m_color_image = VK_NULL_HANDLE

◆ m_color_view

vk::UniqueImageView sd::View::m_color_view

◆ m_content_region_extent

ImVec2 sd::View::m_content_region_extent {0, 0}

◆ m_content_region_pos

ImVec2 sd::View::m_content_region_pos {0, 0}

◆ m_depth_allocation

VmaAllocation sd::View::m_depth_allocation = VK_NULL_HANDLE

◆ m_depth_format

vk::Format sd::View::m_depth_format = vk::Format::eUndefined

◆ m_depth_image

vk::Image sd::View::m_depth_image = VK_NULL_HANDLE

◆ m_depth_view

vk::UniqueImageView sd::View::m_depth_view

◆ m_display_tex_ds

VkDescriptorSet sd::View::m_display_tex_ds = VK_NULL_HANDLE

◆ m_extent

vk::Extent2D sd::View::m_extent = {1280, 720}

◆ m_extent_changed

bool sd::View::m_extent_changed = false

◆ m_imgui_ctx

SDImGuiContext& sd::View::m_imgui_ctx

◆ m_layers

LayerList sd::View::m_layers

◆ m_name

std::string sd::View::m_name

◆ m_open

bool sd::View::m_open = true

◆ m_render_mode

RenderMode sd::View::m_render_mode = RenderMode::SHADED

◆ m_view_id

ViewId sd::View::m_view_id

◆ m_vulkan_ctx

VulkanContext& sd::View::m_vulkan_ctx

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