Grindstone Game Engine
v0.2.0
An open source game engine and toolkit.
Toggle main menu visibility
Loading...
Searching...
No Matches
Win32Window.hpp
1
#pragma once
2
3
#ifndef NOMINMAX
4
#define NOMINMAX
5
#endif
6
7
#include "Window.hpp"
8
#include <windows.h>
9
#include <Common/Input/InputInterface.hpp>
10
11
namespace
Grindstone {
12
class
EngineCore
;
13
14
class
Win32Window
:
public
Window
{
15
public
:
16
virtual
bool
Initialize(
CreateInfo
& createInfo)
override
;
17
virtual
void
Show()
override
;
18
virtual
void
Hide()
override
;
19
virtual
bool
ShouldClose()
override
;
20
virtual
void
HandleEvents()
override
;
21
virtual
void
SetFullscreen(FullscreenMode mode)
override
;
22
virtual
void
GetWindowRect(
unsigned
int
& left,
unsigned
int
& top,
unsigned
int
& right,
unsigned
int
& bottom)
const override
;
23
virtual
void
GetWindowSize(
unsigned
int
& width,
unsigned
int
& height)
const override
;
24
virtual
void
SetWindowSize(
unsigned
int
width,
unsigned
int
height)
override
;
25
virtual
void
SetMousePos(
unsigned
int
x,
unsigned
int
y)
override
;
26
virtual
void
GetMousePos(
unsigned
int
& x,
unsigned
int
& y)
const override
;
27
virtual
void
SetWindowPos(
unsigned
int
x,
unsigned
int
y)
override
;
28
virtual
void
GetWindowPos(
unsigned
int
& x,
unsigned
int
& y)
const override
;
29
virtual
bool
GetWindowFocus()
const override
;
30
virtual
void
SetWindowFocus(
bool
isFocused)
override
;
31
virtual
bool
GetWindowMinimized()
const override
;
32
virtual
void
GetTitle(
char
* allocatedBuffer)
const override
;
33
virtual
void
SetTitle(
const
char
* title)
override
;
34
virtual
void
SetWindowAlpha(
float
alpha)
override
;
35
virtual
float
GetWindowDpiScale()
const override
;
36
virtual
void
Close()
override
;
37
38
virtual
bool
CopyStringToClipboard(
const
std::string& stringToCopy)
override
;
39
virtual
std::filesystem::path BrowseFolder(std::filesystem::path& defaultPath)
override
;
40
virtual
std::filesystem::path OpenFileDialogue(
const
char
* filter)
override
;
41
virtual
std::filesystem::path SaveFileDialogue(
const
char
* filter)
override
;
42
virtual
void
ExplorePath(
const
char
* path)
override
;
43
virtual
void
OpenFileUsingDefaultProgram(
const
char
* path)
override
;
44
public
:
45
HWND GetHandle()
const
;
46
private
:
47
static
LRESULT CALLBACK sWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
48
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
49
50
private
:
51
HWND windowHandle;
52
RECT windowSize;
53
unsigned
int
width;
54
unsigned
int
height;
55
FullscreenMode fullscreenMode;
56
DWORD style;
57
DWORD extendedStyle;
58
EngineCore
* engineCore =
nullptr
;
59
bool
shouldClose;
60
};
61
};
Grindstone::EngineCore
Definition
EngineCore.hpp:59
Grindstone::Win32Window
Definition
Win32Window.hpp:14
Grindstone::Window
Definition
Window.hpp:12
Grindstone::Window::CreateInfo
Definition
Window.hpp:20
sources
code
Common
Window
Win32Window.hpp
Generated by
1.17.0