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

Windows specific implementation of the Window class. More...

#include <WindowsWindow.h>

Inheritance diagram for Karma::WindowsWindow:
Karma::Window

Public Member Functions

 WindowsWindow (const WindowProps &props)
 A constructor.
virtual ~WindowsWindow ()
 A destructor.
virtual void OnUpdate () override
 Function called in each loop iteration.
virtual bool OnResize (WindowResizeEvent &event) override
 Windows specific implementation of WindowResize event.
unsigned int GetWidth () const override
 Getter for the Window width.
unsigned int GetHeight () const override
 Getter for the Window height.
void SetEventCallback (const EventCallbackFn &callback) override
 Sets a listener for Window events.
virtual void * GetNativeWindow () const override
 Getter for the native Window handle.
void SetVSync (bool enabled) override
 Sets VSync on or off.
bool IsVSync () const override
 Getter for VSync status.
GLFWwindow * GetHandle () const
 Getter for the GLFW Window handle.
Public Member Functions inherited from Karma::Window
virtual ~Window ()
 A virtual destructor for the Window.

Additional Inherited Members

Public Types inherited from Karma::Window
using EventCallbackFn = std::function<void(Event&)>
 A data structure for use in Window::SetEventCallback.
Static Public Member Functions inherited from Karma::Window
static WindowCreate (const WindowProps &props=WindowProps())
 Platform based, implemented function for Window creation.

Detailed Description

Windows specific implementation of the Window class.

Since
Karma 1.0.0

Constructor & Destructor Documentation

◆ WindowsWindow()

Karma::WindowsWindow::WindowsWindow ( const WindowProps & props)

A constructor.

Parameters
propsThe properties of the window to be created
See also
WindowsWindow::Init
Since
Karma 1.0.0

◆ ~WindowsWindow()

Karma::WindowsWindow::~WindowsWindow ( )
virtual

A destructor.

See also
WindowsWindow::ShutDown()
Since
Karma 1.0.0

Member Function Documentation

◆ GetHandle()

GLFWwindow * Karma::WindowsWindow::GetHandle ( ) const
inline

Getter for the GLFW Window handle.

Returns
GLFWwindow* The GLFW window handle
Since
Karma 1.0.0

◆ GetHeight()

unsigned int Karma::WindowsWindow::GetHeight ( ) const
inlineoverridevirtual

Getter for the Window height.

Returns
unsigned int The height of the window
Since
Karma 1.0.0

Implements Karma::Window.

◆ GetNativeWindow()

virtual void * Karma::WindowsWindow::GetNativeWindow ( ) const
inlineoverridevirtual

Getter for the native Window handle.

Returns
void* The native window handle
Since
Karma 1.0.0

Implements Karma::Window.

◆ GetWidth()

unsigned int Karma::WindowsWindow::GetWidth ( ) const
inlineoverridevirtual

Getter for the Window width.

Returns
unsigned int The width of the window
Since
Karma 1.0.0

Implements Karma::Window.

◆ IsVSync()

bool Karma::WindowsWindow::IsVSync ( ) const
overridevirtual

Getter for VSync status.

Returns
bool True if VSync is enabled, false otherwise
Since
Karma 1.0.0

Implements Karma::Window.

◆ OnResize()

bool Karma::WindowsWindow::OnResize ( WindowResizeEvent & event)
overridevirtual

Windows specific implementation of WindowResize event.

Parameters
eventThe WindowResizeEvent containing relevant data
Since
Karma 1.0.0

Implements Karma::Window.

◆ OnUpdate()

void Karma::WindowsWindow::OnUpdate ( )
overridevirtual

Function called in each loop iteration.

See also
Application::Run()
Since
Karma 1.0.0

Implements Karma::Window.

◆ SetEventCallback()

void Karma::WindowsWindow::SetEventCallback ( const EventCallbackFn & callback)
inlineoverridevirtual

Sets a listener for Window events.

Parameters
callbackThe function to be called on event
See also
Application::Application()
Since
Karma 1.0.0

Implements Karma::Window.

◆ SetVSync()

void Karma::WindowsWindow::SetVSync ( bool enabled)
overridevirtual

Sets VSync on or off.

Parameters
enabledTrue to enable VSync, false to disable
Since
Karma 1.0.0

Implements Karma::Window.


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