Merge branch 'main' into ImGui-V2
This commit is contained in:
@@ -622,7 +622,7 @@ void ApplicationClass::Shutdown()
|
||||
bool ApplicationClass::Frame(InputClass* Input)
|
||||
{
|
||||
int mouseX, mouseY, currentMouseX, currentMouseY;
|
||||
bool result, mouseDown, keyDown, buttonQ, buttonD, buttonZ, buttonS, buttonA, buttonE;
|
||||
bool result, leftMouseDown, rightMouseDown, keyDown, buttonQ, buttonD, buttonZ, buttonS, buttonA, buttonE;
|
||||
float rotationY, rotationX, positionX, positionY, positionZ;
|
||||
|
||||
float frameTime;
|
||||
@@ -649,6 +649,10 @@ bool ApplicationClass::Frame(InputClass* Input)
|
||||
// Get the location of the mouse from the input object,
|
||||
Input->GetMouseLocation(mouseX, mouseY);
|
||||
|
||||
// Check if the mouse has been pressed.
|
||||
leftMouseDown = Input->IsLeftMousePressed();
|
||||
rightMouseDown = Input->IsRightMousePressed();
|
||||
|
||||
currentMouseX = mouseX;
|
||||
|
||||
float deltaX = currentMouseX - lastMouseX; // Calculez le d<>placement de la souris
|
||||
@@ -669,7 +673,7 @@ bool ApplicationClass::Frame(InputClass* Input)
|
||||
keyDown = Input->IsRightArrowPressed();
|
||||
m_Position->TurnRight(keyDown);
|
||||
|
||||
m_Position->TurnMouse(deltaX, deltaY);
|
||||
m_Position->TurnMouse(deltaX, deltaY, rightMouseDown);
|
||||
|
||||
// Get the current view point rotation.
|
||||
m_Position->GetRotation(rotationY, rotationX);
|
||||
@@ -725,11 +729,8 @@ bool ApplicationClass::Frame(InputClass* Input)
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check if the mouse has been pressed.
|
||||
mouseDown = Input->IsMousePressed();
|
||||
|
||||
// Update the mouse strings each frame.
|
||||
result = UpdateMouseStrings(mouseX, mouseY, mouseDown);
|
||||
result = UpdateMouseStrings(mouseX, mouseY, leftMouseDown);
|
||||
if (!result)
|
||||
{
|
||||
return false;
|
||||
@@ -1035,7 +1036,7 @@ bool ApplicationClass::Render(float rotation, float x, float y, float z)
|
||||
// Render the model using the light shader.
|
||||
result = m_LightShader->Render(m_Direct3D->GetDeviceContext(), m_Model->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix, m_Model->GetTexture(0),
|
||||
diffuseColor, lightPosition);
|
||||
|
||||
|
||||
for (auto cube : m_cubes)
|
||||
{
|
||||
|
||||
@@ -1082,7 +1083,7 @@ bool ApplicationClass::Render(float rotation, float x, float y, float z)
|
||||
diffuseColor, lightPosition);
|
||||
|
||||
if (!result)
|
||||
{
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1101,7 +1102,7 @@ bool ApplicationClass::Render(float rotation, float x, float y, float z)
|
||||
chunk->Render(m_Direct3D->GetDeviceContext());
|
||||
|
||||
result = m_LightShader->Render(m_Direct3D->GetDeviceContext(), m_Model->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix, m_Model->GetTexture(0),
|
||||
diffuseColor, lightPosition);
|
||||
diffuseColor, lightPosition);
|
||||
if (!result)
|
||||
{
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user