summaryrefslogtreecommitdiffhomepage
path: root/Stars45/GameWinDX9.cpp
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-03-31 23:41:46 +0200
committerAki <please@ignore.pl>2022-03-31 23:41:46 +0200
commit8f353abd0bfe18baddd8a8250ab7c4f2d1c83a6e (patch)
treefa3ba288acb3f589e16700256ade2b25c73526c9 /Stars45/GameWinDX9.cpp
parentac54470e8aeddc2acf9ae215241c77a2bf7e33e3 (diff)
downloadstarshatter-8f353abd0bfe18baddd8a8250ab7c4f2d1c83a6e.zip
starshatter-8f353abd0bfe18baddd8a8250ab7c4f2d1c83a6e.tar.gz
starshatter-8f353abd0bfe18baddd8a8250ab7c4f2d1c83a6e.tar.bz2
Moved HINST and HWND from Game to GameWinDX9
Diffstat (limited to 'Stars45/GameWinDX9.cpp')
-rw-r--r--Stars45/GameWinDX9.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/Stars45/GameWinDX9.cpp b/Stars45/GameWinDX9.cpp
index 5414027..5d04c97 100644
--- a/Stars45/GameWinDX9.cpp
+++ b/Stars45/GameWinDX9.cpp
@@ -10,6 +10,7 @@
#include <string.h>
#include "Bitmap.h"
+#include "Clock.h"
#include "Color.h"
#include "DataLoader.h"
#include "Game.h"
@@ -35,6 +36,8 @@ GameWinDX9::GetInstance()
GameWinDX9::GameWinDX9() :
max_tex_size {2048},
screen_color {Color::Black},
+ hInst{nullptr},
+ hwnd{nullptr},
is_windowed {false},
is_active {false},
is_device_lost {false},
@@ -554,6 +557,29 @@ GameWinDX9::LoadPalette(PALETTEENTRY* pal, BYTE* inv)
int
+GameWinDX9::Run()
+{
+ MSG msg;
+ status = RUN;
+ Clock::GetInstance()->Set();
+ while (status < EXIT && !Panic::Panicked()) {
+ if (PeekMessage(&msg, hwnd, 0, 0, PM_REMOVE)) {
+ if (msg.message == WM_QUIT)
+ break;
+
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ }
+ else {
+ if (GameLoop())
+ WaitMessage();
+ }
+ }
+ return exit_code ? exit_code : msg.wParam;
+}
+
+
+int
GameWinDX9::MaxTexSize() const
{
if (video) {
@@ -605,6 +631,20 @@ GameWinDX9::GetScreenHeight() const
}
+HINSTANCE
+GameWinDX9::GetHINST()
+{
+ return hInst;
+}
+
+
+HWND
+GameWinDX9::GetHWND()
+{
+ return hwnd;
+}
+
+
void
GameWinDX9::SetMaxTexSize(int n)
{