mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-12 21:47:03 +03:00
Refactored Index/Vertex Buffer
Now uses ComPtr
This commit is contained in:
parent
aff227e84a
commit
a82a338795
20 changed files with 207 additions and 189 deletions
|
@ -6,6 +6,7 @@
|
|||
#include "camera.h"
|
||||
#include "level.h"
|
||||
#include "setup.h"
|
||||
using namespace T5M::Renderer;
|
||||
|
||||
void Renderer11::collectRooms()
|
||||
{
|
||||
|
@ -464,6 +465,13 @@ void Renderer11::prepareCameraForFrame()
|
|||
m_stCameraMatrices.ViewProjection = ViewProjection;
|
||||
m_stCameraMatrices.Frame = GnFrameCounter;
|
||||
m_stCameraMatrices.CameraUnderwater = (Rooms[Camera.pos.roomNumber].flags & ENV_FLAG_WATER) != 0 ? 1: 0;
|
||||
m_stCameraMatrices.Projection = Projection;
|
||||
m_stCameraMatrices.View = View;
|
||||
m_stCameraMatrices.WorldPosition = Vector3(Camera.pos.x, Camera.pos.y, Camera.pos.z);
|
||||
m_stCameraMatrices.ViewSize = Vector2(ScreenWidth, ScreenHeight);
|
||||
m_stCameraMatrices.InvViewSize = Vector2(1 / ScreenWidth, 1 / ScreenHeight);
|
||||
m_stCameraMatrices.WorldDirection = Vector3(Camera.target.x, Camera.target.y, Camera.target.z) - Vector3(Camera.pos.x, Camera.pos.y, Camera.pos.z);
|
||||
m_stCameraMatrices.WorldDirection.Normalize();
|
||||
updateConstantBuffer(m_cbCameraMatrices, &m_stCameraMatrices, sizeof(CCameraMatrixBuffer));
|
||||
m_context->VSSetConstantBuffers(0, 1, &m_cbCameraMatrices);
|
||||
frustum.Update(View,Projection);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue