d3dut

annotate src/win.h @ 1:242535442d04

added license, readme, and gpl headers
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 22 Jun 2013 10:43:12 +0300
parents ecc040281dc9
children
rev   line source
nuclear@1 1 /*
nuclear@1 2 D3DUT - Simple window creation and event handling for Direct3D 11 applications.
nuclear@1 3 Copyright (C) 2013 John Tsiombikas <nuclear@member.fsf.org>
nuclear@1 4
nuclear@1 5 This program is free software: you can redistribute it and/or modify
nuclear@1 6 it under the terms of the GNU Lesser General Public License as published by
nuclear@1 7 the Free Software Foundation, either version 3 of the License, or
nuclear@1 8 (at your option) any later version.
nuclear@1 9
nuclear@1 10 This program is distributed in the hope that it will be useful,
nuclear@1 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
nuclear@1 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
nuclear@1 13 GNU Lesser General Public License for more details.
nuclear@1 14
nuclear@1 15 You should have received a copy of the GNU Lesser General Public License
nuclear@1 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
nuclear@1 17 */
nuclear@0 18 #ifndef D3DUT_WIN_H_
nuclear@0 19 #define D3DUT_WIN_H_
nuclear@0 20
nuclear@0 21 #include <vector>
nuclear@0 22 #include <d3d11.h>
nuclear@0 23
nuclear@0 24 #define WINCLASSNAME "d3dutwindow"
nuclear@0 25
nuclear@0 26 struct Window {
nuclear@0 27 HWND win;
nuclear@0 28 int width, height;
nuclear@0 29
nuclear@0 30 IDXGISwapChain *swap;
nuclear@0 31 ID3D11RenderTargetView *rtarg_view;
nuclear@0 32
nuclear@0 33 bool must_redisplay, changed_size;
nuclear@0 34 int mousex, mousey;
nuclear@0 35
nuclear@0 36 D3DUT_DisplayFunc display_func;
nuclear@0 37 D3DUT_ReshapeFunc reshape_func;
nuclear@0 38 D3DUT_KeyboardFunc keyboard_func;
nuclear@0 39 D3DUT_KeyboardUpFunc keyboard_up_func;
nuclear@0 40 D3DUT_SpecialFunc special_func;
nuclear@0 41 D3DUT_SpecialUpFunc special_up_func;
nuclear@0 42 D3DUT_MouseFunc mouse_func;
nuclear@0 43 D3DUT_MotionFunc motion_func;
nuclear@0 44 D3DUT_PassiveMotionFunc passive_motion_func;
nuclear@0 45 };
nuclear@0 46
nuclear@0 47 extern std::vector<Window*> windows;
nuclear@0 48
nuclear@0 49 int create_window(const char *title, int xsz, int ysz, unsigned int dmflags);
nuclear@0 50 void destroy_window(int idx);
nuclear@0 51
nuclear@0 52 void set_active_win(int idx);
nuclear@0 53 int get_active_win();
nuclear@0 54
nuclear@0 55 Window *get_window(int idx = -1);
nuclear@0 56
nuclear@0 57 long CALLBACK win_handle_event(HWND syswin, unsigned int msg, unsigned int wparam, long lparam);
nuclear@0 58
nuclear@1 59 #endif // D3DUT_WIN_H_