Foray Library
rapid prototyping framework for crossplatform development of vulkan hardware ray tracing applications
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
foray::osi::Window Class Reference

Window class. Provides access to common properties of operating system level windows. More...

#include <foray_window.hpp>

Public Member Functions

 Window ()
 
 Window (const Window &other)=delete
 
 Window (const Window &&other)=delete
 
void operator= (const Window &other)=delete
 
virtual ~Window ()
 
bool Exists () const
 Check if the window exists on an OS level.
 
virtual void Create ()
 Creates the OS level window based on the parameters of the window object.
 
virtual void Destroy ()
 Destroys the OS side of the window.
 
const std::string & Title () const
 (Getter) WindowPtr Title
 
void Title (const std::string &title)
 (Setter) WindowPtr Title
 
VkExtent2D Size () const
 (Getter) WindowPtr Size
 
void Size (const VkExtent2D size)
 (Setter) WindowPtr Size. Only works in windowed display modes.
 
VkOffset2D Position () const
 (Getter) Window Position
 
void Position (const VkOffset2D pos)
 (Setter) Window Position
 
void DisplayMode (EDisplayMode mode, bool preserveSize=false)
 (Setter) Display Mode
 
EDisplayMode DisplayMode () const
 (Getter) Display Mode
 
SDL_Window * GetSdlWindowHandle () const
 
virtual uint32_t SDLId () const
 
virtual VkSurfaceKHR GetOrCreateSurfaceKHR (VkInstance instance)
 
virtual std::vector< const char * > GetVkSurfaceExtensions () const
 
virtual void HandleEvent (const Event *event)
 

Static Public Member Functions

static std::vector< Window * > & Windows ()
 
static WindowFindBySDLId (uint32_t id)
 

Static Public Attributes

static const int32_t WINDOWPOS_AUTO = INT32_MAX
 

Protected Member Functions

virtual void HandleEvent_Resized (const EventWindowResized *event)
 
virtual void HandleEvent_Closed (const EventWindowCloseRequested *event)
 
virtual void assertThreadIsOwner ()
 

Protected Attributes

SDL_Window * mHandle = nullptr
 
VkSurfaceKHR mSurface = nullptr
 
uint32_t mId
 
std::string mTitle
 
EDisplayMode mDisplayMode
 
int32_t mDisplayId
 
VkExtent2D mFullScreenSize
 
VkExtent2D mWindowedSize
 
VkOffset2D mPosition
 
SDL_threadID mOwningThreadID
 

Static Protected Attributes

static std::vector< Window * > sWindows = std::vector<Window*>()
 

Detailed Description

Window class. Provides access to common properties of operating system level windows.

Constructor & Destructor Documentation

◆ Window() [1/3]

foray::osi::Window::Window ( )

◆ Window() [2/3]

foray::osi::Window::Window ( const Window other)
delete

◆ Window() [3/3]

foray::osi::Window::Window ( const Window &&  other)
delete

◆ ~Window()

virtual foray::osi::Window::~Window ( )
virtual

Member Function Documentation

◆ assertThreadIsOwner()

virtual void foray::osi::Window::assertThreadIsOwner ( )
protectedvirtual

◆ Create()

virtual void foray::osi::Window::Create ( )
virtual

Creates the OS level window based on the parameters of the window object.

◆ Destroy()

virtual void foray::osi::Window::Destroy ( )
virtual

Destroys the OS side of the window.

◆ DisplayMode() [1/2]

EDisplayMode foray::osi::Window::DisplayMode ( ) const
inline

(Getter) Display Mode

◆ DisplayMode() [2/2]

void foray::osi::Window::DisplayMode ( EDisplayMode  mode,
bool  preserveSize = false 
)

(Setter) Display Mode

◆ Exists()

bool foray::osi::Window::Exists ( ) const
inline

Check if the window exists on an OS level.

Returns
true if window exists

◆ FindBySDLId()

static Window * foray::osi::Window::FindBySDLId ( uint32_t  id)
static

◆ GetOrCreateSurfaceKHR()

virtual VkSurfaceKHR foray::osi::Window::GetOrCreateSurfaceKHR ( VkInstance  instance)
virtual

◆ GetSdlWindowHandle()

SDL_Window * foray::osi::Window::GetSdlWindowHandle ( ) const
inline

◆ GetVkSurfaceExtensions()

virtual std::vector< const char * > foray::osi::Window::GetVkSurfaceExtensions ( ) const
virtual

◆ HandleEvent()

virtual void foray::osi::Window::HandleEvent ( const Event event)
virtual

◆ HandleEvent_Closed()

virtual void foray::osi::Window::HandleEvent_Closed ( const EventWindowCloseRequested event)
protectedvirtual

◆ HandleEvent_Resized()

virtual void foray::osi::Window::HandleEvent_Resized ( const EventWindowResized event)
protectedvirtual

◆ operator=()

void foray::osi::Window::operator= ( const Window other)
delete

◆ Position() [1/2]

VkOffset2D foray::osi::Window::Position ( ) const
inline

(Getter) Window Position

◆ Position() [2/2]

void foray::osi::Window::Position ( const VkOffset2D  pos)

(Setter) Window Position

◆ SDLId()

virtual uint32_t foray::osi::Window::SDLId ( ) const
virtual

◆ Size() [1/2]

VkExtent2D foray::osi::Window::Size ( ) const
inline

(Getter) WindowPtr Size

Returns
Hardware-Level size in Pixels

◆ Size() [2/2]

void foray::osi::Window::Size ( const VkExtent2D  size)

(Setter) WindowPtr Size. Only works in windowed display modes.

Parameters
sizeHardware-Level size in Pixels

◆ Title() [1/2]

const std::string & foray::osi::Window::Title ( ) const
inline

(Getter) WindowPtr Title

◆ Title() [2/2]

void foray::osi::Window::Title ( const std::string &  title)

(Setter) WindowPtr Title

Parameters
titleutf-8 encoded null terminated source to copy the updated title from

◆ Windows()

static std::vector< Window * > & foray::osi::Window::Windows ( )
static

Member Data Documentation

◆ mDisplayId

int32_t foray::osi::Window::mDisplayId
protected

◆ mDisplayMode

EDisplayMode foray::osi::Window::mDisplayMode
protected

◆ mFullScreenSize

VkExtent2D foray::osi::Window::mFullScreenSize
protected

◆ mHandle

SDL_Window* foray::osi::Window::mHandle = nullptr
protected

◆ mId

uint32_t foray::osi::Window::mId
protected

◆ mOwningThreadID

SDL_threadID foray::osi::Window::mOwningThreadID
protected

◆ mPosition

VkOffset2D foray::osi::Window::mPosition
protected

◆ mSurface

VkSurfaceKHR foray::osi::Window::mSurface = nullptr
protected

◆ mTitle

std::string foray::osi::Window::mTitle
protected

◆ mWindowedSize

VkExtent2D foray::osi::Window::mWindowedSize
protected

◆ sWindows

std::vector<Window*> foray::osi::Window::sWindows = std::vector<Window*>()
inlinestaticprotected

◆ WINDOWPOS_AUTO

const int32_t foray::osi::Window::WINDOWPOS_AUTO = INT32_MAX
static

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