Started to wrap into dll
This commit is contained in:
parent
fcd88a63ae
commit
328e4777ce
|
@ -154,7 +154,7 @@ HRESULT Buffer::Init(const BUFFER_INIT_DESC& initDesc)
|
||||||
|
|
||||||
if(FAILED(hr))
|
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;
|
return hr;
|
||||||
|
|
|
@ -6,10 +6,14 @@
|
||||||
// http://lolengine.net/blog/2011/3/4/fuck-you-microsoft-near-far-macros
|
// http://lolengine.net/blog/2011/3/4/fuck-you-microsoft-near-far-macros
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <D3D11.h>
|
#include <D3D11.h>
|
||||||
#include <d3dcompiler.h>
|
|
||||||
|
|
||||||
#pragma comment(lib, "d3d11.lib")
|
#pragma comment(lib, "d3d11.lib")
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
#include <d3dcompiler.h>
|
||||||
#pragma comment(lib, "d3dcompiler.lib")
|
#pragma comment(lib, "d3dcompiler.lib")
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#include "Core.h"
|
#include "Core.h"
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
#include <map>
|
||||||
|
|
||||||
const char* ShaderFunction = "main";
|
const char* ShaderFunction = "main";
|
||||||
|
|
||||||
|
|
|
@ -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);
|
||||||
|
|
||||||
|
};
|
|
@ -2,16 +2,8 @@
|
||||||
#ifndef Mesh_h
|
#ifndef Mesh_h
|
||||||
#define 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"
|
#include "ModelInfo.h"
|
||||||
|
|
||||||
//using namespace Oyster::Math;
|
|
||||||
|
|
||||||
namespace Oyster
|
namespace Oyster
|
||||||
{
|
{
|
||||||
|
@ -21,8 +13,12 @@ namespace Oyster
|
||||||
{
|
{
|
||||||
struct Model
|
struct Model
|
||||||
{
|
{
|
||||||
ModelInfo* info;
|
|
||||||
Oyster::Math::Float4x4 World;
|
typedef unsigned long long ModelData;
|
||||||
|
ModelData info;
|
||||||
|
//ModelInfo* info;
|
||||||
|
void* data;
|
||||||
|
int size;
|
||||||
bool Visible;
|
bool Visible;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,15 +2,9 @@
|
||||||
#ifndef MODELINFO_h
|
#ifndef MODELINFO_h
|
||||||
#define MODELINFO_h
|
#define MODELINFO_h
|
||||||
|
|
||||||
//#include "../Engine.h"
|
|
||||||
|
|
||||||
|
|
||||||
#include "..\Core\CoreIncludes.h"
|
#include "..\Core\CoreIncludes.h"
|
||||||
#include "..\Core\Buffer.h"
|
#include "..\Core\Buffer.h"
|
||||||
//#include "OysterMath.h"
|
|
||||||
//#include "ICollideable.h"
|
|
||||||
|
|
||||||
//using namespace Oyster::Math;
|
|
||||||
|
|
||||||
namespace Oyster
|
namespace Oyster
|
||||||
{
|
{
|
||||||
|
|
|
@ -35,7 +35,7 @@ namespace Oyster
|
||||||
if(models[i].Visible)
|
if(models[i].Visible)
|
||||||
{
|
{
|
||||||
void* data = Resources::ModelData.Map();
|
void* data = Resources::ModelData.Map();
|
||||||
memcpy(data,&(models[i].World),64);
|
memcpy(data,&(models[i].data),64);
|
||||||
Resources::ModelData.Unmap();
|
Resources::ModelData.Unmap();
|
||||||
|
|
||||||
//Set Materials :: NONE
|
//Set Materials :: NONE
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
#include "Resources.h"
|
#include "Resources.h"
|
||||||
#include "..\OysterGraphics\Definitions\GraphicalDefinition.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 VertexTransformDebug = L"TransformDebugVertex";
|
||||||
const std::wstring VertexDebug = L"DebugVertex";
|
const std::wstring VertexDebug = L"DebugVertex";
|
||||||
const std::wstring PixelRed = L"DebugPixel";
|
const std::wstring PixelRed = L"DebugPixel";
|
||||||
|
|
|
@ -181,9 +181,9 @@ HRESULT InitDirect3D()
|
||||||
m->info = or.toModel();
|
m->info = or.toModel();
|
||||||
#pragma endregion
|
#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::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);
|
V = Oyster::Math3D::InverseOrientationMatrix(V);
|
||||||
|
|
Loading…
Reference in New Issue