Nui Engine
A game engine framework
Loading...
Searching...
No Matches
Nui::AppBase Class Reference

Base class for all apps in Nui Engine. More...

#include <AppBase.h>

Inheritance diagram for Nui::AppBase:
Nui::Window TestApp

Public Member Functions

 AppBase (WStringView appName, Window::Style style, Window::Size size)
 Construct a new AppBase object.
 
virtual ~AppBase ()=default
 Virtual destructor.
 
virtual void OnInit ()
 Called when the app is initialized (to be implemented in derived class)
 
virtual void OnShutdown ()
 Called when the app is shutdown (to be implemented in derived class)
 
WorldGetWorld () const
 Get the world of the app.
 
- Public Member Functions inherited from Nui::Window
 Window (Window::Style style, WStringView title, Window::Size size={ 1280, 720 })
 Create a new window.
 
virtual ~Window ()
 Destroy the window.
 
HWND GetHWND () const
 Get the window handle.
 
HINSTANCE GetHinstance () const
 Get the Hinstance of the window.
 
Size GetClientSize () const
 Get the client size.
 
void SetWindowTitle (WString title)
 Set the window title.
 
bool Maximized () const
 Check if the window is maximized.
 
bool Focused () const
 Check if the window has focus.
 
bool WantsToClose () const
 Runs the window message pump and checks if the window wants to close.
 
void AddCallback (U32 msg, WndCallback callback)
 Add a window message callback.
 

Friends

class Engine
 

Additional Inherited Members

- Public Types inherited from Nui::Window
enum class  Style { Windowed , WindowedFullscreen , Borderless , BorderlessFullscreen }
 Window styles. More...
 
using WndCallback = std::function<LRESULT(NUI_WNDPROC_ARGS)>
 

Detailed Description

Base class for all apps in Nui Engine.

Note
Inherit from Nui::Window
Derived class must implement OnInit and OnShutdown

Constructor & Destructor Documentation

◆ AppBase()

Nui::AppBase::AppBase ( WStringView appName,
Window::Style style,
Window::Size size )
explicit

Construct a new AppBase object.

Parameters
appNameApp name is also window title
styleStyle of the application window
sizeSize of the application window

Member Function Documentation

◆ GetWorld()

World * Nui::AppBase::GetWorld ( ) const
inline

Get the world of the app.

Returns
A pointer to the app's world

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