demos/triangle: Destroy the window when escape is pressed.

This commit is contained in:
Henri Verbeet
2016-11-02 14:44:24 +01:00
parent f9805396d9
commit 169810d20d
5 changed files with 61 additions and 9 deletions

View File

@@ -41,9 +41,13 @@
#define WIDL_C_INLINE_WRAPPERS
#define COBJMACROS
#include <d3d12.h>
#include <inttypes.h>
#define ARRAY_SIZE(x) (sizeof(x) / sizeof(*x))
#define DEMO_KEY_UNKNOWN 0x0000
#define DEMO_KEY_ESCAPE 0xff1b
struct demo_vec3
{
float x, y, z;
@@ -62,6 +66,8 @@ struct demo_swapchain_desc
DXGI_FORMAT format;
};
typedef uint32_t demo_key;
static inline void demo_rasterizer_desc_init_default(D3D12_RASTERIZER_DESC *desc)
{
desc->FillMode = D3D12_FILL_MODE_SOLID;