summaryrefslogtreecommitdiffhomepage
path: root/Stars45/GameWinDX9.cpp
diff options
context:
space:
mode:
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)
{