|
|
@ -342,29 +342,29 @@ bool ImGui_ImplDX10_CreateDeviceObjects()
|
|
|
|
static const char* vertexShader =
|
|
|
|
static const char* vertexShader =
|
|
|
|
"cbuffer vertexBuffer : register(b0) \
|
|
|
|
"cbuffer vertexBuffer : register(b0) \
|
|
|
|
{\
|
|
|
|
{\
|
|
|
|
float4x4 ProjectionMatrix; \
|
|
|
|
float4x4 ProjectionMatrix; \
|
|
|
|
};\
|
|
|
|
};\
|
|
|
|
struct VS_INPUT\
|
|
|
|
struct VS_INPUT\
|
|
|
|
{\
|
|
|
|
{\
|
|
|
|
float2 pos : POSITION;\
|
|
|
|
float2 pos : POSITION;\
|
|
|
|
float4 col : COLOR0;\
|
|
|
|
float4 col : COLOR0;\
|
|
|
|
float2 uv : TEXCOORD0;\
|
|
|
|
float2 uv : TEXCOORD0;\
|
|
|
|
};\
|
|
|
|
};\
|
|
|
|
\
|
|
|
|
\
|
|
|
|
struct PS_INPUT\
|
|
|
|
struct PS_INPUT\
|
|
|
|
{\
|
|
|
|
{\
|
|
|
|
float4 pos : SV_POSITION;\
|
|
|
|
float4 pos : SV_POSITION;\
|
|
|
|
float4 col : COLOR0;\
|
|
|
|
float4 col : COLOR0;\
|
|
|
|
float2 uv : TEXCOORD0;\
|
|
|
|
float2 uv : TEXCOORD0;\
|
|
|
|
};\
|
|
|
|
};\
|
|
|
|
\
|
|
|
|
\
|
|
|
|
PS_INPUT main(VS_INPUT input)\
|
|
|
|
PS_INPUT main(VS_INPUT input)\
|
|
|
|
{\
|
|
|
|
{\
|
|
|
|
PS_INPUT output;\
|
|
|
|
PS_INPUT output;\
|
|
|
|
output.pos = mul( ProjectionMatrix, float4(input.pos.xy, 0.f, 1.f));\
|
|
|
|
output.pos = mul( ProjectionMatrix, float4(input.pos.xy, 0.f, 1.f));\
|
|
|
|
output.col = input.col;\
|
|
|
|
output.col = input.col;\
|
|
|
|
output.uv = input.uv;\
|
|
|
|
output.uv = input.uv;\
|
|
|
|
return output;\
|
|
|
|
return output;\
|
|
|
|
}";
|
|
|
|
}";
|
|
|
|
|
|
|
|
|
|
|
|
ID3DBlob* vertexShaderBlob;
|
|
|
|
ID3DBlob* vertexShaderBlob;
|
|
|
@ -379,9 +379,9 @@ bool ImGui_ImplDX10_CreateDeviceObjects()
|
|
|
|
// Create the input layout
|
|
|
|
// Create the input layout
|
|
|
|
D3D10_INPUT_ELEMENT_DESC local_layout[] =
|
|
|
|
D3D10_INPUT_ELEMENT_DESC local_layout[] =
|
|
|
|
{
|
|
|
|
{
|
|
|
|
{ "POSITION", 0, DXGI_FORMAT_R32G32_FLOAT, 0, (size_t)(&((ImDrawVert*)0)->pos), D3D10_INPUT_PER_VERTEX_DATA, 0 },
|
|
|
|
{ "POSITION", 0, DXGI_FORMAT_R32G32_FLOAT, 0, (UINT)IM_OFFSETOF(ImDrawVert, pos), D3D10_INPUT_PER_VERTEX_DATA, 0 },
|
|
|
|
{ "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, (size_t)(&((ImDrawVert*)0)->uv), D3D10_INPUT_PER_VERTEX_DATA, 0 },
|
|
|
|
{ "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, (UINT)IM_OFFSETOF(ImDrawVert, uv), D3D10_INPUT_PER_VERTEX_DATA, 0 },
|
|
|
|
{ "COLOR", 0, DXGI_FORMAT_R8G8B8A8_UNORM, 0, (size_t)(&((ImDrawVert*)0)->col), D3D10_INPUT_PER_VERTEX_DATA, 0 },
|
|
|
|
{ "COLOR", 0, DXGI_FORMAT_R8G8B8A8_UNORM, 0, (UINT)IM_OFFSETOF(ImDrawVert, col), D3D10_INPUT_PER_VERTEX_DATA, 0 },
|
|
|
|
};
|
|
|
|
};
|
|
|
|
if (g_pd3dDevice->CreateInputLayout(local_layout, 3, vertexShaderBlob->GetBufferPointer(), vertexShaderBlob->GetBufferSize(), &g_pInputLayout) != S_OK)
|
|
|
|
if (g_pd3dDevice->CreateInputLayout(local_layout, 3, vertexShaderBlob->GetBufferPointer(), vertexShaderBlob->GetBufferSize(), &g_pInputLayout) != S_OK)
|
|
|
|
{
|
|
|
|
{
|
|
|
|