d3dut
diff 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 diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/win.h Sat Jun 22 10:11:39 2013 +0300 1.3 @@ -0,0 +1,42 @@ 1.4 +#ifndef D3DUT_WIN_H_ 1.5 +#define D3DUT_WIN_H_ 1.6 + 1.7 +#include <vector> 1.8 +#include <d3d11.h> 1.9 + 1.10 +#define WINCLASSNAME "d3dutwindow" 1.11 + 1.12 +struct Window { 1.13 + HWND win; 1.14 + int width, height; 1.15 + 1.16 + IDXGISwapChain *swap; 1.17 + ID3D11RenderTargetView *rtarg_view; 1.18 + 1.19 + bool must_redisplay, changed_size; 1.20 + int mousex, mousey; 1.21 + 1.22 + D3DUT_DisplayFunc display_func; 1.23 + D3DUT_ReshapeFunc reshape_func; 1.24 + D3DUT_KeyboardFunc keyboard_func; 1.25 + D3DUT_KeyboardUpFunc keyboard_up_func; 1.26 + D3DUT_SpecialFunc special_func; 1.27 + D3DUT_SpecialUpFunc special_up_func; 1.28 + D3DUT_MouseFunc mouse_func; 1.29 + D3DUT_MotionFunc motion_func; 1.30 + D3DUT_PassiveMotionFunc passive_motion_func; 1.31 +}; 1.32 + 1.33 +extern std::vector<Window*> windows; 1.34 + 1.35 +int create_window(const char *title, int xsz, int ysz, unsigned int dmflags); 1.36 +void destroy_window(int idx); 1.37 + 1.38 +void set_active_win(int idx); 1.39 +int get_active_win(); 1.40 + 1.41 +Window *get_window(int idx = -1); 1.42 + 1.43 +long CALLBACK win_handle_event(HWND syswin, unsigned int msg, unsigned int wparam, long lparam); 1.44 + 1.45 +#endif // D3DUT_WIN_H_ 1.46 \ No newline at end of file