summaryrefslogtreecommitdiff
path: root/legacy/loader/window.hpp
diff options
context:
space:
mode:
authorboris <wzn@moneybot.cc>2018-11-28 16:00:02 +1300
committerboris <wzn@moneybot.cc>2018-11-28 16:00:02 +1300
commit3d412a4b30a9f7c7f51ea6562e694315948bd3da (patch)
tree26d67dfd1f3e5fd12903ad13e85d0cb8bcf8f21c /legacy/loader/window.hpp
parente4729e4393d90271a3814c7a79950a660c48325a (diff)
cleaned up
in short, the cheat and loader are now separate solutions. unused stuff was moved into the legacy solution in case anyone wants to compile it or whatever. i can change this back if you want to. also, i configured the loader to compile in x64, and have separate build types for linux and win64
Diffstat (limited to 'legacy/loader/window.hpp')
-rw-r--r--legacy/loader/window.hpp59
1 files changed, 59 insertions, 0 deletions
diff --git a/legacy/loader/window.hpp b/legacy/loader/window.hpp
new file mode 100644
index 0000000..e1efc86
--- /dev/null
+++ b/legacy/loader/window.hpp
@@ -0,0 +1,59 @@
+#pragma once
+#include <d3d9.h>
+#include <d3dx9.h>
+
+#pragma comment(lib, "d3d9.lib")
+#pragma comment(lib, "d3dx9.lib")
+
+#include <xnamath.h>
+#include <windows.h>
+
+#include <dwmapi.h>
+#pragma comment(lib, "dwmapi.lib")
+#pragma comment(lib, "winmm.lib")
+
+#include <vector>
+
+#include "input_system.hpp"
+
+namespace d3d
+{
+ typedef void( *on_frame_fn )( );
+
+ class c_window {
+ public:
+ c_window( );
+ ~c_window( );
+
+ bool create( );
+ void on_frame( );
+ void add_on_frame( on_frame_fn fn ) {
+ m_onframe_vec.push_back( fn );
+ }
+
+ HWND get_hwnd( ) { return m_hwnd; }
+
+ private:
+ bool init_d3d( );
+
+ public:
+ static LRESULT __stdcall window_procedure( HWND, UINT, WPARAM, LPARAM );
+
+ private:
+ HWND m_hwnd{ };
+ int m_size[ 2 ]{ };
+
+ WNDCLASSEX m_wc{ };
+ MSG m_msg{ };
+
+ public:
+ LPDIRECT3DDEVICE9 m_d3d_device{ };
+ D3DPRESENT_PARAMETERS m_present_params{ };
+ LPDIRECT3D9 m_d3d{ };
+
+ private:
+ std::vector< on_frame_fn > m_onframe_vec;
+ };
+}
+
+extern d3d::c_window g_window; \ No newline at end of file