World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
WinApiWindow.h
См. документацию.
1 #pragma once
2 
3 #include <Windows.h>
4 
5 #include "Platform/OSWindow.h"
6 
7 void *WinApiMsgRouter(HWND hwnd, int msg, int wparam, void *lparam);
8 
9 class WinApiWindow : public OSWindow {
10  public:
11  explicit WinApiWindow(HWND hwnd)
12  : OSWindow() {
13  this->hwnd = hwnd;
14  }
15 
16  void SetFullscreenMode() override;
17  void SetWindowedMode(int new_window_width, int new_window_height) override;
18  void SetCursor(const char *cursor_name) override;
19 
20  int GetX() const override;
21  int GetY() const override;
22  unsigned int GetWidth() const override;
23  unsigned int GetHeight() const override;
24 
25  Point TransformCursorPos(Point &pt) const override; // screen to client
26 
27  bool OnOSMenu(int item_id) override;
28 
29  void Show() override;
30  bool Focused() override;
31  void Activate() override;
32 
33  void PeekSingleMessage() override;
34  void PeekMessageLoop() override;
35 
36  void *GetWinApiHandle() override;
37 
38  private:
39  bool WinApiMessageProc(int msg, int wparam, void *lparam, void **result);
40  void *CreateDebugMenuPanel();
41 
42 
43  HWND hwnd = nullptr;
44 
45  friend void *WinApiMsgRouter(HWND hwnd, int msg, int wparam, void *lparam);
46 };
OSWindow.h
WinApiWindow::OnOSMenu
bool OnOSMenu(int item_id) override
Definition: WinApiWindow.cpp:565
WinApiWindow::WinApiMsgRouter
friend void * WinApiMsgRouter(HWND hwnd, int msg, int wparam, void *lparam)
Definition: WinApiWindow.cpp:193
WinApiWindow::GetHeight
unsigned int GetHeight() const override
Definition: WinApiWindow.cpp:64
WinApiWindow::Activate
void Activate() override
Definition: WinApiWindow.cpp:15
WinApiWindow::GetWinApiHandle
void * GetWinApiHandle() override
Definition: WinApiWindow.cpp:11
WinApiWindow::WinApiWindow
WinApiWindow(HWND hwnd)
Definition: WinApiWindow.h:11
WinApiWindow::SetWindowedMode
void SetWindowedMode(int new_window_width, int new_window_height) override
Definition: WinApiWindow.cpp:255
result
GLuint64EXT * result
Definition: SDL_opengl_glext.h:9435
OSWindow
Definition: OSWindow.h:12
WinApiWindow::GetY
int GetY() const override
Definition: WinApiWindow.cpp:54
WinApiWindow::TransformCursorPos
Point TransformCursorPos(Point &pt) const override
Definition: WinApiWindow.cpp:71
WinApiMsgRouter
void * WinApiMsgRouter(HWND hwnd, int msg, int wparam, void *lparam)
Definition: WinApiWindow.cpp:193
WinApiWindow::SetFullscreenMode
void SetFullscreenMode() override
Definition: WinApiWindow.cpp:241
WinApiWindow::Show
void Show() override
Definition: WinApiWindow.cpp:209
WinApiWindow::CreateDebugMenuPanel
void * CreateDebugMenuPanel()
Definition: WinApiWindow.cpp:291
WinApiWindow::GetWidth
unsigned int GetWidth() const override
Definition: WinApiWindow.cpp:59
WinApiWindow::SetCursor
void SetCursor(const char *cursor_name) override
Definition: WinApiWindow.cpp:214
WinApiWindow::WinApiMessageProc
bool WinApiMessageProc(int msg, int wparam, void *lparam, void **result)
Definition: WinApiWindow.cpp:78
WinApiWindow
Definition: WinApiWindow.h:9
WinApiWindow::PeekMessageLoop
void PeekMessageLoop() override
Definition: WinApiWindow.cpp:23
WinApiWindow::GetX
int GetX() const override
Definition: WinApiWindow.cpp:49
Point
Definition: Point.h:3
WinApiWindow::hwnd
HWND hwnd
Definition: WinApiWindow.h:43
WinApiWindow::PeekSingleMessage
void PeekSingleMessage() override
Definition: WinApiWindow.cpp:35
WinApiWindow::Focused
bool Focused() override
Definition: WinApiWindow.cpp:69