OpenBarnyard
 
Loading...
Searching...
No Matches
TMSWindow.h
Go to the documentation of this file.
1#pragma once
2#include "Toshi/TObject.h"
4#include "Toshi/TString8.h"
5
6#include <dbt.h>
7#include <windowsx.h>
8
10
11class TMSWindow : public TObject
12{
13public:
15
16public:
17 static constexpr UINT s_PopupStyles = WS_POPUP | WS_CAPTION | WS_MINIMIZEBOX | WS_SYSMENU;
18
19public:
20 TMSWindow();
21 TMSWindow( const TMSWindow& ) = default;
22
23 void Update( TFLOAT a_fDeltaTime );
24
25 TBOOL Create( TRenderInterface* renderer, LPCSTR title );
27
28 void SetPosition( UINT x, UINT y, UINT width, UINT height );
29
31 {
32 TASSERT( GetHWND() != TNULL );
33 m_bWindowed = TTRUE;
34 }
35
37 {
38 TASSERT( GetHWND() != TNULL );
39 m_bWindowed = TFALSE;
40 }
41
43 {
44 return m_bDestroyed;
45 }
46
48 {
49 return m_bWindowed;
50 }
51
52 HWND GetHWND() const
53 {
54 return m_HWND;
55 }
56
57 static void SetFocused( TBOOL a_bFocused );
58
59private:
60 static LRESULT CALLBACK WndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
61
62protected:
63 static constexpr GUID WceusbshGUID = { 0x25dbce51, 0x6c8f, 0x4a72, 0x8a, 0x6d, 0xb5, 0x4c, 0x2b, 0x4f, 0xc8, 0x35 };
64
65 inline static TBOOL ms_bIsFocused;
66 inline static BOOL ms_bIsFullscreen;
67 inline static STICKYKEYS ms_StickyKeys;
68 inline static HDEVNOTIFY ms_hDeviceNotify;
69
70private:
71 HWND m_HWND; // 0x04
72 TRenderInterface* m_pRenderer; // 0x08
73 TBOOL m_bWindowed; // 0x0C
74 TBOOL m_bDestroyed; // 0x0D
75 TBOOL m_bIsFocused; // 0x0E
76 HMODULE m_ModuleHandle; // 0x10
77};
78
Rendering system interface for the Toshi engine.
#define TASSERT(X,...)
Definition Defines.h:138
#define TOSHI_NAMESPACE_START
Definition Defines.h:47
#define TOSHI_NAMESPACE_END
Definition Defines.h:50
#define TDECLARE_CLASS(THIS_CLASS, PARENT_CLASS)
Definition TObject.h:38
Char string implementation for the Toshi engine.
float TFLOAT
Definition Typedefs.h:4
#define TNULL
Definition Typedefs.h:23
#define TFALSE
Definition Typedefs.h:24
#define TTRUE
Definition Typedefs.h:25
bool TBOOL
Definition Typedefs.h:6
HWND GetHWND() const
Definition TMSWindow.h:52
void SetFullscreen()
Definition TMSWindow.h:36
static constexpr GUID WceusbshGUID
Definition TMSWindow.h:63
static void SetFocused(TBOOL a_bFocused)
static BOOL ms_bIsFullscreen
Definition TMSWindow.h:66
static HDEVNOTIFY ms_hDeviceNotify
Definition TMSWindow.h:68
TBOOL Create(TRenderInterface *renderer, LPCSTR title)
static TBOOL ms_bIsFocused
Definition TMSWindow.h:65
void UnregisterWindowClass()
void Update(TFLOAT a_fDeltaTime)
Definition TMSWindow.cpp:39
void SetPosition(UINT x, UINT y, UINT width, UINT height)
TBOOL IsWindowed() const
Definition TMSWindow.h:47
void SetWindowed()
Definition TMSWindow.h:30
static STICKYKEYS ms_StickyKeys
Definition TMSWindow.h:67
TBOOL IsDestroyed() const
Definition TMSWindow.h:42
static constexpr UINT s_PopupStyles
Definition TMSWindow.h:17
TMSWindow(const TMSWindow &)=default