Working DirectX textures
This commit is contained in:
@@ -4,9 +4,10 @@
|
||||
#include <string>
|
||||
|
||||
#include <d3d11.h>
|
||||
|
||||
#include "Rendering/RawModel.h"
|
||||
#include "Rendering/Renderer.h"
|
||||
#include "Core/StaticSystem.h"
|
||||
#include "Rendering/Renderer.h"
|
||||
|
||||
namespace dd
|
||||
{
|
||||
@@ -21,7 +22,8 @@ private:
|
||||
public:
|
||||
~Model();
|
||||
|
||||
ID3D11Buffer* VertexBuffer;
|
||||
ID3D11Buffer* VertexBuffer = nullptr;
|
||||
ID3D11Buffer* IndexBuffer = nullptr;
|
||||
unsigned int NumVertices;
|
||||
};
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@ using namespace DirectX::SimpleMath;
|
||||
//#pragma comment (lib, "DirectXTK.lib")
|
||||
|
||||
#include "Rendering/BaseRenderer.h"
|
||||
#include "Core/StaticSystem.h"
|
||||
|
||||
namespace dd
|
||||
{
|
||||
@@ -47,6 +46,7 @@ public:
|
||||
ID3D11DeviceContext* m_DeviceContext = nullptr;
|
||||
ID3D11RenderTargetView* m_BackBuffer = nullptr;
|
||||
ID3D11DepthStencilView* m_DepthBuffer = nullptr;
|
||||
ID3D11SamplerState* m_SamplerState = nullptr;
|
||||
|
||||
private:
|
||||
struct ConstantBufferStruct
|
||||
@@ -63,7 +63,8 @@ private:
|
||||
const Model* testModel = nullptr;
|
||||
ID3D11Buffer* constantBuffer = nullptr;
|
||||
|
||||
DirectX::SimpleMath::Matrix GLMtoDX(glm::mat4 m);
|
||||
static DirectX::SimpleMath::Matrix GLMtoDXModelView(glm::mat4 m);
|
||||
static DirectX::SimpleMath::Matrix GLMtoDXProjection(glm::mat4 m);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <d3d11.h>
|
||||
#include <d3dcompiler.h>
|
||||
#pragma comment (lib, "D3DCompiler.lib")
|
||||
|
||||
#include "Core/StaticSystem.h"
|
||||
#include "Rendering/Renderer.h"
|
||||
|
||||
|
||||
@@ -19,17 +19,16 @@
|
||||
#ifndef Texture_h__
|
||||
#define Texture_h__
|
||||
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <cstdio>
|
||||
#include <d3d11.h>
|
||||
|
||||
#include "Core/ResourceManager.h"
|
||||
#include "Rendering/PNG.h"
|
||||
#include "Rendering/BaseTexture.h"
|
||||
#include "Core/StaticSystem.h"
|
||||
#include "Rendering/Renderer.h"
|
||||
|
||||
namespace dd
|
||||
{
|
||||
|
||||
class Texture : public Resource
|
||||
class Texture : public BaseTexture
|
||||
{
|
||||
friend class ResourceManager;
|
||||
|
||||
@@ -39,11 +38,13 @@ private:
|
||||
public:
|
||||
~Texture();
|
||||
|
||||
unsigned int Width = 0;
|
||||
unsigned int Height = 0;
|
||||
};
|
||||
operator ID3D11Texture2D*() { return m_Texture; }
|
||||
|
||||
ID3D11Texture2D* m_Texture = nullptr;
|
||||
ID3D11ShaderResourceView* m_ShaderResourceView = nullptr;
|
||||
private:
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // Texture_h__
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user