d3dut

diff include/d3dut.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/include/d3dut.h	Sat Jun 22 10:11:39 2013 +0300
     1.3 @@ -0,0 +1,95 @@
     1.4 +#ifndef D3DUT_H_
     1.5 +#define D3DUT_H_
     1.6 +
     1.7 +#ifdef _MSC_VER
     1.8 +#pragma comment(lib, "d3d11.lib")
     1.9 +#pragma comment(lib, "d3dx11.lib")
    1.10 +#pragma comment(lib, "winmm.lib")
    1.11 +
    1.12 +#ifndef D3DUT_IMPLEMENTATION
    1.13 +#pragma comment(lib, "d3dut.lib")
    1.14 +#endif
    1.15 +#endif
    1.16 +
    1.17 +#ifdef D3DUT_IMPLEMENTATION
    1.18 +#define D3DUTAPI	__declspec(dllexport)
    1.19 +#else
    1.20 +#define D3DUTAPI	__declspec(dllimport)
    1.21 +#endif
    1.22 +
    1.23 +#include <d3d11.h>
    1.24 +#include <d3dx11.h>
    1.25 +
    1.26 +#define D3DUT_RGB			0
    1.27 +#define D3DUT_RGBA			0
    1.28 +#define D3DUT_SINGLE		0
    1.29 +
    1.30 +#define D3DUT_DOUBLE		1
    1.31 +#define D3DUT_DEPTH			2
    1.32 +#define D3DUT_STENCIL		4
    1.33 +#define D3DUT_STEREO		8
    1.34 +#define D3DUT_MULTISAMPLE	16
    1.35 +
    1.36 +enum {
    1.37 +	D3DUT_WINDOW_WIDTH,
    1.38 +	D3DUT_WINDOW_HEIGHT,
    1.39 +	D3DUT_ELAPSED_TIME
    1.40 +};
    1.41 +
    1.42 +enum {
    1.43 +	D3DUT_LEFT_BUTTON,
    1.44 +	D3DUT_MIDDLE_BUTTON,
    1.45 +	D3DUT_RIGHT_BUTTON,
    1.46 +
    1.47 +	D3DUT_WHEELDOWN_BUTTON,
    1.48 +	D3DUT_WHEELUP_BUTTON
    1.49 +};
    1.50 +
    1.51 +enum {D3DUT_DOWN = 0, D3DUT_UP = 1};
    1.52 +
    1.53 +typedef void (*D3DUT_DisplayFunc)();
    1.54 +typedef void (*D3DUT_IdleFunc)();
    1.55 +typedef void (*D3DUT_ReshapeFunc)(int, int);
    1.56 +typedef void (*D3DUT_KeyboardFunc)(unsigned char, int, int);
    1.57 +typedef void (*D3DUT_KeyboardUpFunc)(unsigned char, int, int);
    1.58 +typedef void (*D3DUT_SpecialFunc)(int, int, int);
    1.59 +typedef void (*D3DUT_SpecialUpFunc)(int, int, int);
    1.60 +typedef void (*D3DUT_MouseFunc)(int, int, int, int);
    1.61 +typedef void (*D3DUT_MotionFunc)(int, int);
    1.62 +typedef void (*D3DUT_PassiveMotionFunc)(int, int);
    1.63 +
    1.64 +extern D3DUTAPI ID3D11Device *d3dut_dev;
    1.65 +extern D3DUTAPI ID3D11DeviceContext *d3dut_ctx;
    1.66 +extern D3DUTAPI ID3D11RenderTargetView *d3dut_rtview;
    1.67 +
    1.68 +void D3DUTAPI d3dut_init(int *argc, char **argv);
    1.69 +void D3DUTAPI d3dut_init_display_mode(unsigned int dmflags);
    1.70 +void D3DUTAPI d3dut_init_window_size(int xsz, int ysz);
    1.71 +
    1.72 +int D3DUTAPI d3dut_create_window(const char *title);
    1.73 +void D3DUTAPI d3dut_destroy_window(int win);
    1.74 +void D3DUTAPI d3dut_set_window(int idx);
    1.75 +int D3DUTAPI d3dut_get_window();
    1.76 +
    1.77 +void D3DUTAPI d3dut_display_func(D3DUT_DisplayFunc func);
    1.78 +void D3DUTAPI d3dut_idle_func(D3DUT_IdleFunc func);
    1.79 +void D3DUTAPI d3dut_reshape_func(D3DUT_ReshapeFunc func);
    1.80 +void D3DUTAPI d3dut_keyboard_func(D3DUT_KeyboardFunc func);
    1.81 +void D3DUTAPI d3dut_keyboard_up_func(D3DUT_KeyboardUpFunc func);
    1.82 +void D3DUTAPI d3dut_special_func(D3DUT_SpecialFunc func);
    1.83 +void D3DUTAPI d3dut_special_up_func(D3DUT_SpecialUpFunc func);
    1.84 +void D3DUTAPI d3dut_mouse_func(D3DUT_MouseFunc func);
    1.85 +void D3DUTAPI d3dut_motion_func(D3DUT_MotionFunc func);
    1.86 +void D3DUTAPI d3dut_passive_motion_func(D3DUT_PassiveMotionFunc func);
    1.87 +
    1.88 +void D3DUTAPI d3dut_post_redisplay();
    1.89 +void D3DUTAPI d3dut_swap_buffers();
    1.90 +
    1.91 +void D3DUTAPI d3dut_main_loop();
    1.92 +
    1.93 +int D3DUTAPI d3dut_get(unsigned int what);
    1.94 +
    1.95 +void D3DUTAPI d3dut_solid_sphere(double radius, int slices, int stacks);
    1.96 +// TODO ... more stuff
    1.97 +
    1.98 +#endif	// D3DUT_H_
    1.99 \ No newline at end of file