57 lines
1.4 KiB
C++
57 lines
1.4 KiB
C++
////////////////////////////////////////////////////////////////////////////////
|
|
// Filename: colorshaderclass.h
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
#ifndef _COLORSHADERCLASS_H_
|
|
#define _COLORSHADERCLASS_H_
|
|
|
|
|
|
//////////////
|
|
// INCLUDES //
|
|
//////////////
|
|
#include "Logger.h"
|
|
#include <d3d11.h>
|
|
#include <d3dcompiler.h>
|
|
#include <directxmath.h>
|
|
#include <fstream>
|
|
using namespace DirectX;
|
|
using namespace std;
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
// Class name: ColorShaderClass
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
class ColorShaderClass
|
|
{
|
|
private:
|
|
struct MatrixBufferType
|
|
{
|
|
XMMATRIX world;
|
|
XMMATRIX view;
|
|
XMMATRIX projection;
|
|
};
|
|
|
|
public:
|
|
ColorShaderClass();
|
|
ColorShaderClass(const ColorShaderClass&);
|
|
~ColorShaderClass();
|
|
|
|
bool Initialize(ID3D11Device*, HWND);
|
|
void Shutdown();
|
|
bool Render(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX);
|
|
|
|
private:
|
|
bool InitializeShader(ID3D11Device*, HWND, WCHAR*, WCHAR*);
|
|
void ShutdownShader();
|
|
void OutputShaderErrorMessage(ID3D10Blob*, HWND, WCHAR*);
|
|
|
|
bool SetShaderParameters(ID3D11DeviceContext*, XMMATRIX, XMMATRIX, XMMATRIX);
|
|
void RenderShader(ID3D11DeviceContext*, int);
|
|
|
|
private:
|
|
ID3D11VertexShader* m_vertexShader;
|
|
ID3D11PixelShader* m_pixelShader;
|
|
ID3D11InputLayout* m_layout;
|
|
ID3D11Buffer* m_matrixBuffer;
|
|
};
|
|
|
|
#endif |