summaryrefslogtreecommitdiffhomepage
path: root/StarsEx/GameWinDX9.h
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-04-01 21:23:39 +0200
committerAki <please@ignore.pl>2022-04-01 21:23:39 +0200
commit3c487c5cd69c53d6fea948643c0a76df03516605 (patch)
tree72730c7b8b26a5ef8fc9a987ec4c16129efd5aac /StarsEx/GameWinDX9.h
parent8f353abd0bfe18baddd8a8250ab7c4f2d1c83a6e (diff)
downloadstarshatter-3c487c5cd69c53d6fea948643c0a76df03516605.zip
starshatter-3c487c5cd69c53d6fea948643c0a76df03516605.tar.gz
starshatter-3c487c5cd69c53d6fea948643c0a76df03516605.tar.bz2
Moved Stars45 to StarsEx
Diffstat (limited to 'StarsEx/GameWinDX9.h')
-rw-r--r--StarsEx/GameWinDX9.h79
1 files changed, 79 insertions, 0 deletions
diff --git a/StarsEx/GameWinDX9.h b/StarsEx/GameWinDX9.h
new file mode 100644
index 0000000..43fc71d
--- /dev/null
+++ b/StarsEx/GameWinDX9.h
@@ -0,0 +1,79 @@
+/* Starshatter: The Open Source Project
+ Copyright (c) 2021-2022, Starshatter: The Open Source Project Contributors
+ Copyright (c) 2011-2012, Starshatter OpenSource Distribution Contributors
+ Copyright (c) 1997-2006, Destroyer Studios LLC.
+*/
+
+#ifndef GameWinDX9_h
+#define GameWinDX9_h
+
+#include "Color.h"
+#include "Game.h"
+#include "Types.h"
+#include "WndProc.h"
+
+
+class GameWinDX9 : public Game
+{
+public:
+ static GameWinDX9* GetInstance();
+
+ GameWinDX9();
+ virtual ~GameWinDX9();
+
+ virtual bool Init(HINSTANCE hi, HINSTANCE hpi, LPSTR cmdline, int nCmdShow);
+ virtual bool InitApplication(HINSTANCE hInstance);
+ virtual bool InitInstance(HINSTANCE hInstance, int nCmdShow);
+ virtual bool InitGame();
+
+ virtual bool InitVideo();
+ virtual bool ResizeVideo();
+ virtual bool ResetVideo();
+ virtual bool ToggleFullscreen();
+ virtual bool AdjustWindowForChange();
+
+ virtual bool SetupPalette();
+ virtual bool LoadPalette(PALETTEENTRY* pal, BYTE* inv);
+
+ virtual int Run() override;
+
+ int MaxTexSize() const;
+ int MaxTexAspect() const;
+ Color GetScreenColor() const;
+ int GetScreenWidth() const;
+ int GetScreenHeight() const;
+
+ HINSTANCE GetHINST();
+ HWND GetHWND();
+
+ void SetMaxTexSize(int n);
+ void SetScreenColor(Color c);
+
+
+protected:
+ friend LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM uParam, LPARAM lParam);
+
+ PALETTEENTRY standard_palette[256];
+ BYTE inverse_palette[32768];
+
+ int max_tex_size;
+ Color screen_color;
+
+ HINSTANCE hInst;
+ HWND hwnd;
+
+ bool is_windowed;
+ bool is_active;
+ bool is_device_lost;
+ bool is_minimized;
+ bool is_maximized;
+ bool ignore_size_change;
+ bool is_device_initialized;
+ bool is_device_restored;
+
+private:
+ static GameWinDX9* instance;
+};
+
+
+#endif // GameWinDX9_h