diff --git a/Code/OysterGraphics/Core/Buffer.cpp b/Code/OysterGraphics/Core/Buffer.cpp index f530239c..87eb9c3e 100644 --- a/Code/OysterGraphics/Core/Buffer.cpp +++ b/Code/OysterGraphics/Core/Buffer.cpp @@ -154,7 +154,7 @@ HRESULT Buffer::Init(const BUFFER_INIT_DESC& initDesc) if(FAILED(hr)) { - MessageBox(NULL, "Unable to create buffer.", "Slenda Error", MB_ICONERROR | MB_OK); + MessageBox(NULL, L"Unable to create buffer.", L"Slenda Error", MB_ICONERROR | MB_OK); } return hr; diff --git a/Code/OysterGraphics/Core/CoreIncludes.h b/Code/OysterGraphics/Core/CoreIncludes.h index 26b1ce0c..037431a0 100644 --- a/Code/OysterGraphics/Core/CoreIncludes.h +++ b/Code/OysterGraphics/Core/CoreIncludes.h @@ -6,10 +6,14 @@ // http://lolengine.net/blog/2011/3/4/fuck-you-microsoft-near-far-macros #include #include -#include #pragma comment(lib, "d3d11.lib") + +#ifdef _DEBUG +#include #pragma comment(lib, "d3dcompiler.lib") +#endif + #include diff --git a/Code/OysterGraphics/Core/ShaderManager.cpp b/Code/OysterGraphics/Core/ShaderManager.cpp index 448a4b49..0b0c4fba 100644 --- a/Code/OysterGraphics/Core/ShaderManager.cpp +++ b/Code/OysterGraphics/Core/ShaderManager.cpp @@ -1,5 +1,6 @@ #include "Core.h" #include +#include const char* ShaderFunction = "main"; diff --git a/Code/OysterGraphics/DllInterfaces/SimpleInterface.h b/Code/OysterGraphics/DllInterfaces/SimpleInterface.h new file mode 100644 index 00000000..f576350d --- /dev/null +++ b/Code/OysterGraphics/DllInterfaces/SimpleInterface.h @@ -0,0 +1,27 @@ +#pragma once +#include "..\Model\Model.h" + + +class SimpleInterface +{ +public: + enum State + { + Sucsess, + Fail + }; + struct Option + { + }; + + State Init(HWND Window, bool MSAA_Quality, bool Fullscreen); + //! @brief from Oyster::Math Float4x4, expects corect methods + static void NewFrame(float View[16], float Projection[16]); + static void RenderScene(Oyster::Graphics::Render::Model* models, int count); + static void EndFrame(); + + static Oyster::Graphics::Render::Model* CreateModel(); + + static State SetOptions(Option); + +}; diff --git a/Code/OysterGraphics/Model/Model.h b/Code/OysterGraphics/Model/Model.h index 805f2ec3..381104ac 100644 --- a/Code/OysterGraphics/Model/Model.h +++ b/Code/OysterGraphics/Model/Model.h @@ -2,16 +2,8 @@ #ifndef Mesh_h #define Mesh_h -//#include "../Engine.h" - - -//#include "..\Core\CoreIncludes.h" -//#include "..\Core\Buffer.h" -#include "OysterMath.h" -//#include "ICollideable.h" #include "ModelInfo.h" -//using namespace Oyster::Math; namespace Oyster { @@ -21,8 +13,12 @@ namespace Oyster { struct Model { - ModelInfo* info; - Oyster::Math::Float4x4 World; + + typedef unsigned long long ModelData; + ModelData info; + //ModelInfo* info; + void* data; + int size; bool Visible; }; } diff --git a/Code/OysterGraphics/Model/ModelInfo.h b/Code/OysterGraphics/Model/ModelInfo.h index fb4a51b9..91a8cf45 100644 --- a/Code/OysterGraphics/Model/ModelInfo.h +++ b/Code/OysterGraphics/Model/ModelInfo.h @@ -2,15 +2,9 @@ #ifndef MODELINFO_h #define MODELINFO_h -//#include "../Engine.h" - #include "..\Core\CoreIncludes.h" #include "..\Core\Buffer.h" -//#include "OysterMath.h" -//#include "ICollideable.h" - -//using namespace Oyster::Math; namespace Oyster { diff --git a/Code/OysterGraphics/Render/Rendering/BasicRender.cpp b/Code/OysterGraphics/Render/Rendering/BasicRender.cpp index 5b8723a2..c43e165c 100644 --- a/Code/OysterGraphics/Render/Rendering/BasicRender.cpp +++ b/Code/OysterGraphics/Render/Rendering/BasicRender.cpp @@ -35,7 +35,7 @@ namespace Oyster if(models[i].Visible) { void* data = Resources::ModelData.Map(); - memcpy(data,&(models[i].World),64); + memcpy(data,&(models[i].data),64); Resources::ModelData.Unmap(); //Set Materials :: NONE diff --git a/Code/OysterGraphics/Render/Resources/Resources.cpp b/Code/OysterGraphics/Render/Resources/Resources.cpp index d5393b4a..da372888 100644 --- a/Code/OysterGraphics/Render/Resources/Resources.cpp +++ b/Code/OysterGraphics/Render/Resources/Resources.cpp @@ -1,7 +1,9 @@ #include "Resources.h" #include "..\OysterGraphics\Definitions\GraphicalDefinition.h" -const std::wstring PathFromExeToHlsl = L"..\\OysterGraphics\\Shader\\HLSL\\"; +// /Bin/Executable/Tester -> +// /Code/OysterGraphics/Shader/HLSL +const std::wstring PathFromExeToHlsl = L"..\\..\\..\\Code\\OysterGraphics\\Shader\\HLSL\\"; const std::wstring VertexTransformDebug = L"TransformDebugVertex"; const std::wstring VertexDebug = L"DebugVertex"; const std::wstring PixelRed = L"DebugPixel"; diff --git a/Code/Tester/MainTest.cpp b/Code/Tester/MainTest.cpp index ad7d4774..db2a567f 100644 --- a/Code/Tester/MainTest.cpp +++ b/Code/Tester/MainTest.cpp @@ -181,9 +181,9 @@ HRESULT InitDirect3D() m->info = or.toModel(); #pragma endregion - m->World = Oyster::Math::Matrix::identity; + //*((Oyster::Math::Matrix)m->data) = Oyster::Math::Matrix::identity; - P = Oyster::Math3D::ProjectionMatrix_Perspective(PI/2,16.0f/9.0f,.1f,100); + P = Oyster::Math3D::ProjectionMatrix_Perspective(Oyster::Math::pi/2,16.0f/9.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);