Minor Update - V8.1.0

[FIX] :

- Alpha Shader

[FEAT] :

- Add Scene action in bar menu
- Start to implemented Save And Load Logique
This commit is contained in:
2025-03-17 12:59:04 +01:00
parent 8b9e860c00
commit 7eb6ed72e6
16 changed files with 3304 additions and 108 deletions

View File

@@ -30,6 +30,7 @@
#include "reflectionshaderclass.h"
#include "physics.h"
#include "frustum.h"
#include <fstream>
#include <WICTextureLoader.h>
#include <comdef.h> // Pour _com_error
@@ -145,6 +146,12 @@ public:
void SetCanFixedUpdate(bool canFixedUpdate) { CanFixedUpdate = canFixedUpdate; };
ID3D11ShaderResourceView* GetBackBufferSRV() const {return m_BackBufferSRV;};
// Save and load scene
void SaveScene();
void LoadScene();
void SetScenePath(std::string path) { m_scenePath = path; };
private:
bool Render(float, float, float, float, float);
@@ -160,7 +167,7 @@ private:
void ConstructSkybox(); // Construct the skybox
void UpdateSkyboxPosition(); // Update the skybox position
bool RenderSkybox(XMMATRIX view, XMMATRIX projection); // Render the skybox
public :
std::vector<ID3D11ShaderResourceView*> textures;
std::vector<ID3D11ShaderResourceView*> m_SkyboxTextures;
@@ -180,6 +187,8 @@ private :
HWND m_hwnd;
bool m_windowed;
std::string m_scenePath;
// ------------------------------------- //
// ------------- RENDERING ------------- //
// ------------------------------------- //
@@ -202,6 +211,7 @@ private :
std::vector<Object*> m_terrainChunk;
float m_speed = 0.1f; // speed for the demo spinning object
std::vector<Object*> m_object;
std::vector<Object*> m_ImportedObject;
int m_ObjectId = 0;
std::vector<std::reference_wrapper<std::vector<Object*>>> m_RenderQueues;
std::vector<Object*> m_Skybox;

View File

@@ -2,7 +2,8 @@
#ifndef _IMGUI_MANAGER_H_
#define _IMGUI_MANAGER_H_
#include "Logger.h"
#include "Logger.h"
#include "sceneManager.h"
#include <imgui.h>
#include <imgui_impl_dx11.h>
@@ -23,7 +24,7 @@ public:
void Shutdown();
void Render(ApplicationClass* app);
void NewFrame();
void SetupDockspace();
void SetupDockspace(ApplicationClass* app);
// Widgets
void WidgetSpeedSlider(float* speed);

View File

@@ -77,7 +77,8 @@ public:
REFRACTION,
TEXTURE,
SKYBOX,
SUNLIGHT
SUNLIGHT,
ALPHA_MAPPING
};
ShaderType GetActiveShader() const { return m_activeShader; };

View File

@@ -0,0 +1,40 @@
#pragma once
#include <string>
class sceneManager
{
public:
static sceneManager& Get()
{
static sceneManager instance;
return instance;
}
sceneManager(sceneManager const&) = delete;
void operator=(sceneManager const&) = delete;
void SetSceneFilePath(const std::string& path) { m_sceneFilePath = path; }
void SetSceneFileName(const std::string& name) { m_sceneFileName = name; }
bool SaveScene()
{
// Implement the save scene logic here
return true;
}
bool LoadScene()
{
// Implement the load scene logic here
return true;
}
private:
sceneManager() = default;
~sceneManager() = default;
// Scene file path
std::string m_sceneFilePath;
std::string m_sceneFileName;
};

View File

@@ -3,12 +3,17 @@
#define WIN32_LEAN_AND_MEAN
static bool DEBUG_MODE = true;
#include "Logger.h"
#include "inputclass.h"
#include "applicationclass.h"
#include "imguiManager.h"
#include <mutex>
#include <filesystem>
#include <commdlg.h>
#include "../resources.h"
#include <chrono>
@@ -27,6 +32,8 @@ public:
void SendPath(wchar_t* path, std::filesystem::path WFolder);
void GetScenePath();
protected:
bool Frame();
void InitializeWindows(int&, int&);
@@ -54,7 +61,6 @@ private:
// FUNCTION PROTOTYPES //
/////////////////////////
static LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
static LRESULT CALLBACK SecondaryWndProc(HWND, UINT, WPARAM, LPARAM);
/////////////