Files
directx-plane-game/Graphics2/SubMeshRenderer.h
iDunnoDev 7a57c73ac3 Added the camera class
Added the DDS Texture Loading for future use
Added the gamepad class for future use
Added first child method to the scenegraph
Added RGB to intensity and lerp methods to the shared methods class
Added the terrain node class with normals
Fixed issue with submeshnode not passing the world transform to the actual meshes
2022-04-18 22:33:15 +01:00

54 lines
1.4 KiB
C++

#pragma once
#include "SharedMethods.h"
#include "DirectXFramework.h"
#include "Renderer.h"
#include "Mesh.h"
class SubMeshRenderer : public Renderer
{
public:
void SetSubMesh(shared_ptr<SubMesh> subMesh);
void SetWorldTransformation(FXMMATRIX worldTransformation);
void SetAmbientLight(XMFLOAT4 ambientLight);
void SetDirectionalLight(FXMVECTOR lightVector, XMFLOAT4 lightColour);
void SetCameraPosition(XMFLOAT4 cameraPosition);
bool Initialise();
void Render();
void Shutdown(void);
private:
shared_ptr<SubMesh> _subMesh;
XMFLOAT4X4 _worldTransformation;
XMFLOAT4 _ambientLight;
XMFLOAT4 _directionalLightVector;
XMFLOAT4 _directionalLightColour;
XMFLOAT4 _cameraPosition;
ComPtr<ID3D11Device> _device;
ComPtr<ID3D11DeviceContext> _deviceContext;
ComPtr<ID3D11Buffer> _vertexBuffer;
ComPtr<ID3D11Buffer> _indexBuffer;
ComPtr<ID3DBlob> _vertexShaderByteCode = nullptr;
ComPtr<ID3DBlob> _pixelShaderByteCode = nullptr;
ComPtr<ID3D11VertexShader> _vertexShader;
ComPtr<ID3D11PixelShader> _pixelShader;
ComPtr<ID3D11InputLayout> _layout;
ComPtr<ID3D11Buffer> _constantBuffer;
ComPtr<ID3D11ShaderResourceView> _texture;
ComPtr<ID3D11BlendState> _transparentBlendState;
ComPtr<ID3D11RasterizerState> _defaultRasteriserState;
ComPtr<ID3D11RasterizerState> _noCullRasteriserState;
void BuildShaders();
void BuildVertexLayout();
void BuildConstantBuffer();
void BuildBlendState();
void BuildRendererState();
};