d3dut

view src/win.h @ 0:ecc040281dc9

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 22 Jun 2013 10:11:39 +0300
parents
children 242535442d04
line source
1 #ifndef D3DUT_WIN_H_
2 #define D3DUT_WIN_H_
4 #include <vector>
5 #include <d3d11.h>
7 #define WINCLASSNAME "d3dutwindow"
9 struct Window {
10 HWND win;
11 int width, height;
13 IDXGISwapChain *swap;
14 ID3D11RenderTargetView *rtarg_view;
16 bool must_redisplay, changed_size;
17 int mousex, mousey;
19 D3DUT_DisplayFunc display_func;
20 D3DUT_ReshapeFunc reshape_func;
21 D3DUT_KeyboardFunc keyboard_func;
22 D3DUT_KeyboardUpFunc keyboard_up_func;
23 D3DUT_SpecialFunc special_func;
24 D3DUT_SpecialUpFunc special_up_func;
25 D3DUT_MouseFunc mouse_func;
26 D3DUT_MotionFunc motion_func;
27 D3DUT_PassiveMotionFunc passive_motion_func;
28 };
30 extern std::vector<Window*> windows;
32 int create_window(const char *title, int xsz, int ysz, unsigned int dmflags);
33 void destroy_window(int idx);
35 void set_active_win(int idx);
36 int get_active_win();
38 Window *get_window(int idx = -1);
40 long CALLBACK win_handle_event(HWND syswin, unsigned int msg, unsigned int wparam, long lparam);
42 #endif // D3DUT_WIN_H_