World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
OSWindow.h
См. документацию.
1 #pragma once
2 #include "Engine/Point.h"
3 #include "Engine/Log.h"
4 
6 
7 
9 
10 
11 class Mouse;
12 class OSWindow {
13  public:
14  OSWindow();
15 
16  virtual void SetFullscreenMode() = 0;
17  virtual void SetWindowedMode(int new_window_width, int new_window_height) = 0;
18  virtual void SetCursor(const char *cursor_name) = 0;
19 
20  virtual int GetX() const = 0;
21  virtual int GetY() const = 0;
22  virtual unsigned int GetWidth() const = 0;
23  virtual unsigned int GetHeight() const = 0;
24 
25  virtual Point TransformCursorPos(Point &pt) const = 0; // screen to client
26 
27  virtual bool OnOSMenu(int item_id) = 0;
28 
29  virtual void Show() = 0;
30  virtual bool Focused() = 0;
31  virtual void Activate() = 0;
32 
33  virtual void PeekSingleMessage() = 0;
34  virtual void PeekMessageLoop() = 0;
35 
36  virtual void *GetWinApiHandle() = 0;
37 
38  // window-renderer integration, probably should be a separate class
39  virtual void OpenGlCreate() = 0;
40  virtual void OpenGlSwapBuffers() = 0;
41 
42  protected:
44  Log *log = nullptr;
45 };
46 
47 extern OSWindow *window;
OSWindow::GetY
virtual int GetY() const =0
OSWindow::TransformCursorPos
virtual Point TransformCursorPos(Point &pt) const =0
Mouse
Definition: Mouse.h:279
Point.h
OSWindow::OpenGlCreate
virtual void OpenGlCreate()=0
OSWindow::SetFullscreenMode
virtual void SetFullscreenMode()=0
Log
Definition: Log.h:3
OSWindow::GetWidth
virtual unsigned int GetWidth() const =0
GameWindowHandler.h
OSWindow::log
Log * log
Definition: OSWindow.h:44
OSWindow
Definition: OSWindow.h:12
OSWindow::gameCallback
GameWindowHandler * gameCallback
Definition: OSWindow.h:43
OSWindow::PeekSingleMessage
virtual void PeekSingleMessage()=0
OSWindow::GetX
virtual int GetX() const =0
OSWindow::OSWindow
OSWindow()
Definition: OSWindow.cpp:12
OSWindow::Show
virtual void Show()=0
Application::GameWindowHandler
Definition: GameWindowHandler.h:8
OSWindow::GetWinApiHandle
virtual void * GetWinApiHandle()=0
OSWindow::OnOSMenu
virtual bool OnOSMenu(int item_id)=0
window
OSWindow * window
Definition: mm7_data.cpp:711
OSWindow::PeekMessageLoop
virtual void PeekMessageLoop()=0
OSWindow::SetCursor
virtual void SetCursor(const char *cursor_name)=0
OSWindow::Activate
virtual void Activate()=0
OSWindow::OpenGlSwapBuffers
virtual void OpenGlSwapBuffers()=0
OSWindow::GetHeight
virtual unsigned int GetHeight() const =0
OSWindow::SetWindowedMode
virtual void SetWindowedMode(int new_window_width, int new_window_height)=0
Point
Definition: Point.h:3
OSWindow::Focused
virtual bool Focused()=0
Log.h