GraphicTestTri

This commit is contained in:
lanariel 2013-11-15 08:41:11 +01:00
parent d9bc8ce640
commit ed3ad9fef3
39 changed files with 113 additions and 5 deletions

Binary file not shown.

Binary file not shown.

View File

@ -74,7 +74,7 @@ bool Oyster::Engine::Init::FullInit(const Setup& setup)
{
if(!Oyster::Engine::Init::Instance(setup.SingleThreaded,setup.Reference,setup.ForceDX11))
return false;
if(!Oyster::Engine::Init::CreateSwapChain(NULL,setup.NrOfBuffers,setup.MSAA_Quality,setup.Fullscreen))
if(!Oyster::Engine::Init::CreateSwapChain(setup.window,setup.NrOfBuffers,setup.MSAA_Quality,setup.Fullscreen))
return false;
/// \todo Add Init Shaders to full Init Process
if(setup.GenerateDepthStencil)

View File

@ -29,6 +29,7 @@ namespace Oyster
bool ForceDX11;
bool GenerateDepthStencil;
bool BindDefault;
HWND window;
//all but Window params have Default Values
Setup()
{

View File

@ -174,6 +174,26 @@
<Project>{f10cbc03-9809-4cba-95d8-327c287b18ee}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<FxCompile Include="Shader\HLSL\SimpleDebug\DebugPixel.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Pixel</ShaderType>
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</DeploymentContent>
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">5.0</ShaderModel>
<EntryPointName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">ShaderMain</EntryPointName>
</FxCompile>
<FxCompile Include="Shader\HLSL\SimpleDebug\DebugVertex.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
<DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</DeploymentContent>
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">5.0</ShaderModel>
<EntryPointName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">ShaderMain</EntryPointName>
</FxCompile>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>

View File

@ -93,4 +93,8 @@
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<FxCompile Include="Shader\HLSL\SimpleDebug\DebugVertex.hlsl" />
<FxCompile Include="Shader\HLSL\SimpleDebug\DebugPixel.hlsl" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,4 @@
float4 ShaderMain() : SV_TARGET
{
return float4(1.0f, 0.0f, 0.0f, 1.0f);
}

View File

@ -0,0 +1,4 @@
float4 ShaderMain( float4 pos : POSITION ) : SV_POSITION
{
return pos;
}

Binary file not shown.

Binary file not shown.

View File

@ -1,5 +1,5 @@
Build started 11/13/2013 10:26:50 AM.
1>Project "C:\DanBias\Danbias\Tester\Tester.vcxproj" on node 4 (Build target(s)).
Build started 11/15/2013 8:31:58 AM.
1>Project "C:\DanBias\Danbias\Tester\Tester.vcxproj" on node 2 (Build target(s)).
1>ClCompile:
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\CL.exe /c /I..\OysterGraphics /I..\OysterMath /I..\Misc /ZI /nologo /W3 /WX- /sdl /Od /Oy- /D WIN32 /D _DEBUG /D _WINDOWS /D _UNICODE /D UNICODE /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"Debug\\" /Fd"Debug\vc110.pdb" /Gd /TP /analyze- /errorReport:prompt MainTest.cpp
MainTest.cpp
@ -8,9 +8,10 @@
C:\DanBias\External\Lib\Misc\Misc_x86D.lib
C:\DanBias\External\Lib\OysterMath\OysterMath_x86D.lib
C:\DanBias\External\Lib\OysterGraphics\OysterGraphics_x86D.lib
1>MainTest.obj : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/OPT:LBR' specification
Tester.vcxproj -> C:\DanBias\Danbias\Debug\Tester.exe
1>Done Building Project "C:\DanBias\Danbias\Tester\Tester.vcxproj" (Build target(s)).
Build succeeded.
Time Elapsed 00:00:02.51
Time Elapsed 00:00:05.17

View File

@ -0,0 +1 @@


View File

@ -0,0 +1 @@


View File

@ -0,0 +1 @@


View File

@ -0,0 +1 @@


View File

@ -0,0 +1 @@


View File

@ -0,0 +1 @@


View File

@ -0,0 +1 @@


View File

@ -0,0 +1 @@


View File

@ -0,0 +1 @@


View File

@ -0,0 +1 @@


View File

@ -0,0 +1 @@


View File

@ -0,0 +1 @@


View File

@ -0,0 +1 @@


View File

@ -0,0 +1 @@


View File

@ -0,0 +1 @@


View File

@ -0,0 +1 @@


View File

@ -0,0 +1 @@


View File

@ -0,0 +1 @@


View File

@ -0,0 +1 @@


View File

@ -0,0 +1 @@


View File

@ -0,0 +1 @@


View File

@ -0,0 +1 @@


Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -134,9 +134,57 @@ HRESULT InitDirect3D()
Oyster::Engine::Init::Setup setup;
setup.Fullscreen = false;
setup.ForceDX11 = true;
setup.SingleThreaded = true;
setup.window = g_hWnd;
Oyster::Engine::Init::FullInit( setup );
std::wstring ShaderPath = L"..\\OysterGraphics\\Shader\\HLSL\\";
std::wstring EffectPath = L"SimpleDebug\\";
Oyster::Core::ShaderManager::Init(ShaderPath + EffectPath + L"DebugPixel.hlsl",Oyster::Core::ShaderManager::ShaderType::Pixel,L"Debug",false);
Oyster::Core::ShaderManager::Init(ShaderPath + EffectPath + L"DebugVertex.hlsl",Oyster::Core::ShaderManager::ShaderType::Vertex,L"Debug",false);
Oyster::Core::ShaderManager::Set::Vertex(Oyster::Core::ShaderManager::Get::Vertex(L"Debug"));
Oyster::Core::ShaderManager::Set::Pixel(Oyster::Core::ShaderManager::Get::Pixel(L"Debug"));
D3D11_INPUT_ELEMENT_DESC inputDesc[] =
{
{ "POSITION", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 }
};
ID3D11InputLayout* layout;
Oyster::Core::ShaderManager::CreateInputLayout( inputDesc, 1, Oyster::Core::ShaderManager::Get::Vertex(L"Debug"), layout);
Oyster::Core::DeviceContext->IASetInputLayout(layout);
Oyster::Core::DeviceContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
Oyster::Engine::PrepareForRendering::BindBackBuffer();
struct float4
{
float x,y,z,w;
};
float4 mesh[] =
{
{-1.0f,1.0f,0.0f,1.0f},
{1.0f,1.0f,0.0f,1.0f},
{1.0f,-1.0f,0.0f,1.0f},
};
Oyster::Buffer::BUFFER_INIT_DESC desc;
desc.ElementSize= sizeof(float4);
desc.NumElements = 3;
desc.InitData=mesh;
desc.Type = Oyster::Buffer::BUFFER_TYPE::VERTEX_BUFFER;
desc.Usage = Oyster::Buffer::BUFFER_USAGE::BUFFER_USAGE_IMMUTABLE;
Oyster::Buffer b;
b.Init(desc);
b.Apply(0);
return S_OK;
}
@ -147,7 +195,11 @@ HRESULT Update(float deltaTime)
HRESULT Render(float deltaTime)
{
Oyster::Engine::PrepareForRendering::ClearBackBuffer(Oyster::Math::Float4(0,0,1,1));
Oyster::Core::DeviceContext->Draw(3,0);
Oyster::Core::SwapChain->Present(0,0);
return S_OK;
}