Examples: DirectX10: Reusing imgui_impl_win32, removed that code from imgui_impl_dx10

This commit is contained in:
omar
2018-02-16 23:11:43 +01:00
parent 19540479d4
commit 6cd4e30b58
6 changed files with 35 additions and 182 deletions

View File

@ -28,9 +28,8 @@
// DirectX
#include <d3d11.h>
#include <d3dcompiler.h>
#define DIRECTINPUT_VERSION 0x0800
#include <dinput.h>
// Data
static ID3D11Device* g_pd3dDevice = NULL;
static ID3D11DeviceContext* g_pd3dDeviceContext = NULL;
static ID3D11Buffer* g_pVB = NULL;
@ -177,7 +176,7 @@ void ImGui_ImplDX11_RenderDrawData(ImDrawData* draw_data)
vp.Height = ImGui::GetIO().DisplaySize.y;
vp.MinDepth = 0.0f;
vp.MaxDepth = 1.0f;
vp.TopLeftX = vp.TopLeftY = 0.0f;
vp.TopLeftX = vp.TopLeftY = 0;
ctx->RSSetViewports(1, &vp);
// Bind shader and vertex buffers
@ -351,7 +350,8 @@ bool ImGui_ImplDX11_CreateDeviceObjects()
return false;
// Create the input layout
D3D11_INPUT_ELEMENT_DESC local_layout[] = {
D3D11_INPUT_ELEMENT_DESC local_layout[] =
{
{ "POSITION", 0, DXGI_FORMAT_R32G32_FLOAT, 0, (size_t)(&((ImDrawVert*)0)->pos), D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, (size_t)(&((ImDrawVert*)0)->uv), D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "COLOR", 0, DXGI_FORMAT_R8G8B8A8_UNORM, 0, (size_t)(&((ImDrawVert*)0)->col), D3D11_INPUT_PER_VERTEX_DATA, 0 },