diff --git a/Bin/DLL/DebugCameraVertex.cso b/Bin/DLL/DebugCameraVertex.cso new file mode 100644 index 00000000..db8c9bce Binary files /dev/null and b/Bin/DLL/DebugCameraVertex.cso differ diff --git a/Bin/DLL/DebugPixel.cso b/Bin/DLL/DebugPixel.cso new file mode 100644 index 00000000..8f2b274b Binary files /dev/null and b/Bin/DLL/DebugPixel.cso differ diff --git a/Bin/DLL/DebugVertex.cso b/Bin/DLL/DebugVertex.cso new file mode 100644 index 00000000..eb211e78 Binary files /dev/null and b/Bin/DLL/DebugVertex.cso differ diff --git a/Bin/DLL/GamePhysics_x86D.dll b/Bin/DLL/GamePhysics_x86D.dll new file mode 100644 index 00000000..600f7736 Binary files /dev/null and b/Bin/DLL/GamePhysics_x86D.dll differ diff --git a/Bin/DLL/GamePhysics_x86D.exp b/Bin/DLL/GamePhysics_x86D.exp new file mode 100644 index 00000000..6e03abce Binary files /dev/null and b/Bin/DLL/GamePhysics_x86D.exp differ diff --git a/Bin/DLL/GamePhysics_x86D.ilk b/Bin/DLL/GamePhysics_x86D.ilk new file mode 100644 index 00000000..f00af251 Binary files /dev/null and b/Bin/DLL/GamePhysics_x86D.ilk differ diff --git a/Bin/DLL/GamePhysics_x86D.pdb b/Bin/DLL/GamePhysics_x86D.pdb new file mode 100644 index 00000000..44554c38 Binary files /dev/null and b/Bin/DLL/GamePhysics_x86D.pdb differ diff --git a/Bin/DLL/OysterGraphics_x86D.dll b/Bin/DLL/OysterGraphics_x86D.dll new file mode 100644 index 00000000..ce514407 Binary files /dev/null and b/Bin/DLL/OysterGraphics_x86D.dll differ diff --git a/Bin/DLL/OysterGraphics_x86D.exp b/Bin/DLL/OysterGraphics_x86D.exp new file mode 100644 index 00000000..3679e007 Binary files /dev/null and b/Bin/DLL/OysterGraphics_x86D.exp differ diff --git a/Bin/DLL/OysterGraphics_x86D.ilk b/Bin/DLL/OysterGraphics_x86D.ilk new file mode 100644 index 00000000..8e111f12 Binary files /dev/null and b/Bin/DLL/OysterGraphics_x86D.ilk differ diff --git a/Bin/DLL/OysterGraphics_x86D.pdb b/Bin/DLL/OysterGraphics_x86D.pdb new file mode 100644 index 00000000..2b032b64 Binary files /dev/null and b/Bin/DLL/OysterGraphics_x86D.pdb differ diff --git a/Bin/DLL/PixelGatherData.cso b/Bin/DLL/PixelGatherData.cso new file mode 100644 index 00000000..3ff8c1e0 Binary files /dev/null and b/Bin/DLL/PixelGatherData.cso differ diff --git a/Bin/DLL/VertexGatherData.cso b/Bin/DLL/VertexGatherData.cso new file mode 100644 index 00000000..45dd4a63 Binary files /dev/null and b/Bin/DLL/VertexGatherData.cso differ diff --git a/Code/Misc/Misc.vcxproj b/Code/Misc/Misc.vcxproj index 743cea70..e2947725 100644 --- a/Code/Misc/Misc.vcxproj +++ b/Code/Misc/Misc.vcxproj @@ -148,7 +148,6 @@ - diff --git a/Code/Misc/Misc.vcxproj.filters b/Code/Misc/Misc.vcxproj.filters index f3ea3d1f..6eae993b 100644 --- a/Code/Misc/Misc.vcxproj.filters +++ b/Code/Misc/Misc.vcxproj.filters @@ -33,9 +33,6 @@ Source Files - - Source Files - diff --git a/Code/OysterGraphics/Core/Init.cpp b/Code/OysterGraphics/Core/Init.cpp index 7802654c..48abd444 100644 --- a/Code/OysterGraphics/Core/Init.cpp +++ b/Code/OysterGraphics/Core/Init.cpp @@ -103,8 +103,8 @@ namespace Oyster desc.BufferDesc.RefreshRate.Denominator=1; desc.BufferDesc.RefreshRate.Numerator=60; - desc.BufferDesc.Height = Size.y; - desc.BufferDesc.Width = Size.x; + desc.BufferDesc.Height = (UINT)Size.y; + desc.BufferDesc.Width = (UINT)Size.x; if(Core::swapChain) { @@ -180,8 +180,8 @@ namespace Oyster desc.BindFlags = D3D11_BIND_DEPTH_STENCIL; desc.CPUAccessFlags=0; desc.MiscFlags=0; - desc.Height = Size.y; - desc.Width = Size.x; + desc.Height = (UINT)Size.y; + desc.Width = (UINT)Size.x; if(Core::depthStencil) { diff --git a/Code/OysterGraphics/DllInterfaces/GFXAPI.cpp b/Code/OysterGraphics/DllInterfaces/GFXAPI.cpp index d13adbc5..e19d497f 100644 --- a/Code/OysterGraphics/DllInterfaces/GFXAPI.cpp +++ b/Code/OysterGraphics/DllInterfaces/GFXAPI.cpp @@ -2,13 +2,16 @@ #include "../Core/Core.h" #include "../Render/Resources/Resources.h" #include "../Render/Rendering/Render.h" +#include "../FileLoader/ObjReader.h" namespace Oyster { namespace Graphics { - API::State API::Init(HWND Window, bool MSAA_Quality, bool Fullscreen) + API::State API::Init(HWND Window, bool MSAA_Quality, bool Fullscreen, Math::Float2 resulotion) { + Core::resolution = resulotion; + if(Core::Init::FullInit(Window, MSAA_Quality, Fullscreen) == Core::Init::Fail) { return API::Fail; @@ -17,6 +20,8 @@ namespace Oyster { return API::Fail; } + + Render::Preparations::Basic::SetViewPort(); return API::Sucsess; } @@ -30,5 +35,32 @@ namespace Oyster Render::Rendering::Basic::RenderScene(models,count); } + void API::EndFrame() + { + Render::Rendering::Basic::EndFrame(); + } + + API::State API::SetOptions(API::Option option) + { + return API::Sucsess; + } + + Model::Model* API::CreateModel(std::wstring filename) + { + Model::Model* m = new Model::Model(); + m->WorldMatrix = Oyster::Math::Float4x4::identity; + m->Visible = true; + + OBJReader or; + or.readOBJFile(filename); + m->info = or.toModel(); + + return m; + } + + void API::DeleteModel(Model::Model* model) + { + delete model; + } } } \ No newline at end of file diff --git a/Code/OysterGraphics/DllInterfaces/GFXAPI.h b/Code/OysterGraphics/DllInterfaces/GFXAPI.h index 0200514a..052d99d8 100644 --- a/Code/OysterGraphics/DllInterfaces/GFXAPI.h +++ b/Code/OysterGraphics/DllInterfaces/GFXAPI.h @@ -4,12 +4,18 @@ #include "OysterMath.h" #include +#if defined GFX_DLL_EXPORT + #define GFX_DLL_USAGE __declspec(dllexport) +#else + #define GFX_DLL_USAGE __declspec(dllimport) +#endif + namespace Oyster { namespace Graphics { - class API + class GFX_DLL_USAGE API { public: enum State @@ -21,7 +27,7 @@ namespace Oyster { }; - State Init(HWND Window, bool MSAA_Quality, bool Fullscreen); + static State Init(HWND Window, bool MSAA_Quality, bool Fullscreen, Oyster::Math::Float2 StartResulotion); //! @brief from Oyster::Math Float4x4, expects corect methods static void NewFrame(Oyster::Math::Float4x4 View, Oyster::Math::Float4x4 Projection); static void RenderScene(Oyster::Graphics::Model::Model* models, int count); diff --git a/Code/OysterGraphics/Model/Model.h b/Code/OysterGraphics/Model/Model.h index e24b420a..0103b143 100644 --- a/Code/OysterGraphics/Model/Model.h +++ b/Code/OysterGraphics/Model/Model.h @@ -1,6 +1,7 @@ #pragma once #ifndef Mesh_h #define Mesh_h +#include "OysterMath.h" namespace Oyster { @@ -10,6 +11,7 @@ namespace Oyster { struct Model { + //! do not Edit, linked to render data void* info; Oyster::Math::Float4x4 WorldMatrix; bool Visible; diff --git a/Code/OysterGraphics/OysterGraphics.vcxproj b/Code/OysterGraphics/OysterGraphics.vcxproj index b18d333b..5bf9ebf3 100644 --- a/Code/OysterGraphics/OysterGraphics.vcxproj +++ b/Code/OysterGraphics/OysterGraphics.vcxproj @@ -24,7 +24,7 @@ - StaticLibrary + DynamicLibrary true v110 MultiByte @@ -66,22 +66,22 @@ - $(SolutionDir)..\External\Lib\$(ProjectName)\ + $(SolutionDir)..\Bin\DLL\ $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ $(ProjectName)_$(PlatformShortName)D - $(SolutionDir)..\External\Lib\$(ProjectName)\ + $(SolutionDir)..\Bin\DLL\ $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ $(ProjectName)_$(PlatformShortName) - $(SolutionDir)..\External\Lib\$(ProjectName)\ + $(SolutionDir)..\Bin\DLL\ $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ $(ProjectName)_$(PlatformShortName)D - $(SolutionDir)..\External\Lib\$(ProjectName)\ + $(SolutionDir)..\Bin\DLL\ $(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\ $(ProjectName)_$(PlatformShortName) @@ -91,6 +91,7 @@ Disabled true $(SolutionDir)OysterMath;$(SolutionDir)Misc;%(AdditionalIncludeDirectories) + GFX_DLL_EXPORT;%(PreprocessorDefinitions) true @@ -105,6 +106,7 @@ Disabled true ..\OysterPhysic3D\Collision;..\OysterPhysics3D;..\OysterMath;..\Misc;%(AdditionalIncludeDirectories) + GFX_DLL_EXPORT;%(PreprocessorDefinitions) true @@ -118,6 +120,7 @@ true true ..\OysterPhysics3D;..\OysterMath;..\Misc;%(AdditionalIncludeDirectories) + GFX_DLL_EXPORT;%(PreprocessorDefinitions) true @@ -133,6 +136,7 @@ true true ..\OysterPhysics3D;..\OysterMath;..\Misc;%(AdditionalIncludeDirectories) + GFX_DLL_EXPORT;%(PreprocessorDefinitions) true diff --git a/Code/Tester/MainTest.cpp b/Code/Tester/MainTest.cpp index 17b543b7..a2167ef2 100644 --- a/Code/Tester/MainTest.cpp +++ b/Code/Tester/MainTest.cpp @@ -7,12 +7,9 @@ //-------------------------------------------------------------------------------------- #define NOMINMAX #include -#include "Core/Core.h" -#include "Render\Preparations\Preparations.h" -#include "Render\Resources\Resources.h" -#include "Render\Rendering\Render.h" -#include "FileLoader\ObjReader.h" -#include "Definitions\GraphicalDefinition.h" +#include "DllInterfaces\GFXAPI.h" + + //-------------------------------------------------------------------------------------- // Global Variables @@ -42,6 +39,22 @@ HRESULT InitDirect3D(); //-------------------------------------------------------------------------------------- int WINAPI wWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow ) { + + bool b = SetDllDirectoryW(L"..\\..\\DLL"); + typedef struct tagLOADPARMS32 + { + LPSTR lpEnvAddress; // address of environment strings + LPSTR lpCmdLine; // address of command line + LPSTR lpCmdShow; // how to show new program + DWORD dwReserved; // must be zero + } LOADPARMS32; + LOADPARMS32 params; + params.dwReserved=NULL; + params.lpCmdLine=""; + params.lpCmdShow=""; + params.lpEnvAddress=""; + LoadModule("OysterGraphics_x86D.dll",¶ms); + if( FAILED( InitWindow( hInstance, nCmdShow ) ) ) return 0; @@ -138,15 +151,10 @@ HRESULT InitDirect3D() { HRESULT hr = S_OK;; - Oyster::Graphics::Core::resolution = Oyster::Math::Float2( 1024, 768 ); - - if(Oyster::Graphics::Core::Init::FullInit(g_hWnd,false,false)==Oyster::Graphics::Core::Init::Fail) + if(Oyster::Graphics::API::Init(g_hWnd,false,false, Oyster::Math::Float2( 1024, 768 )) == Oyster::Graphics::API::Fail) + { return E_FAIL; - - //Init shaders - Oyster::Graphics::Render::Resources::Init(); - - Oyster::Graphics::Render::Preparations::Basic::SetViewPort(); + } #pragma region Triangle //Oyster::Graphics::Definitions::ObjVertex mesh[] = @@ -176,15 +184,12 @@ HRESULT InitDirect3D() #pragma endregion #pragma region Obj - OBJReader or; - or.readOBJFile(L"crate.obj"); - m->info = (void*)or.toModel(); - m->Visible=true; + m = Oyster::Graphics::API::CreateModel(L"bth.obj"); + m->WorldMatrix *= 0.1f; #pragma endregion - m->WorldMatrix = Oyster::Math::Matrix::identity; - P = Oyster::Math3D::ProjectionMatrix_Perspective(Oyster::Math::pi/2,16.0f/9.0f,.1f,100); + P = Oyster::Math3D::ProjectionMatrix_Perspective(Oyster::Math::pi/2,1024.0f/768.0f,.1f,100); V = Oyster::Math3D::OrientationMatrix_LookAtDirection(Oyster::Math::Float3(0,0,-1),Oyster::Math::Float3(0,1,0),Oyster::Math::Float3(0,-1.5f,10.4f)); V = Oyster::Math3D::InverseOrientationMatrix(V); @@ -200,18 +205,11 @@ HRESULT Update(float deltaTime) HRESULT Render(float deltaTime) { - Oyster::Graphics::Render::Rendering::Basic::NewFrame(V,P); - //Oyster::Graphics::Render::Preparations::Basic::ClearBackBuffer(Oyster::Math::Float4(0,0,1,1)); + Oyster::Graphics::API::NewFrame(V,P); - //m->info->Vertices->Apply(0); + Oyster::Graphics::API::RenderScene(m,1); - //Oyster::Graphics::Core::deviceContext->Draw(3,0); - - //Oyster::Graphics::Core::swapChain->Present(0,0); - - Oyster::Graphics::Render::Rendering::Basic::RenderScene(m,1); - - Oyster::Graphics::Render::Rendering::Basic::EndFrame(); + Oyster::Graphics::API::EndFrame(); return S_OK; } diff --git a/Code/Tester/Tester.vcxproj b/Code/Tester/Tester.vcxproj index a810a51a..978b5738 100644 --- a/Code/Tester/Tester.vcxproj +++ b/Code/Tester/Tester.vcxproj @@ -103,7 +103,14 @@ Windows true + OysterGraphics_$(PlatformShortName)D.lib;%(AdditionalDependencies) + $(SolutionDir)..\Bin\DLL;%(AdditionalLibraryDirectories) + OysterGraphics_x86D.dll;%(DelayLoadDLLs) + + + + @@ -118,6 +125,9 @@ Windows true + OysterGraphics_$(PlatformShortName)D.lib;%(AdditionalDependencies) + $(SolutionDir)..\Bin\DLL;%(AdditionalLibraryDirectories) + true @@ -136,6 +146,9 @@ true true true + OysterGraphics_$(PlatformShortName).lib;%(AdditionalDependencies) + $(SolutionDir)..\Bin\DLL;%(AdditionalLibraryDirectories) + true @@ -154,6 +167,9 @@ true true true + OysterGraphics_$(PlatformShortName).lib;%(AdditionalDependencies) + $(SolutionDir)..\Bin\DLL;%(AdditionalLibraryDirectories) + true @@ -165,6 +181,11 @@ {0ec83e64-230e-48ef-b08c-6ac9651b4f82} + false + true + false + false + false {f10cbc03-9809-4cba-95d8-327c287b18ee}