Bug Fix + Modification ImGui
FIX : Bug de FPS diviser par 2 corrigé ~ Le model de plane.txt a été changé par celui des cube pour le model de base + Nouvelle fonction qui combine les widget pour les afficher en une ligne dans le systemclass.cpp
This commit is contained in:
parent
fbab9d7ee3
commit
3323dfa6ad
@ -159,27 +159,8 @@ bool SystemClass::Frame()
|
||||
return false;
|
||||
}
|
||||
|
||||
// Start the Dear ImGui frame
|
||||
m_imguiManager->NewFrame();
|
||||
|
||||
//ImGui Widget
|
||||
ImGui::Begin("Khaotic Engine", NULL);
|
||||
|
||||
float speed = m_Application->GetSpeed();
|
||||
m_imguiManager->WidgetSpeedSlider(&speed);
|
||||
m_Application->SetSpeed(speed);
|
||||
m_imguiManager->WidgetButton();
|
||||
m_imguiManager->WidgetFPS();
|
||||
m_imguiManager->WidgetAddObject(m_Application);
|
||||
m_imguiManager->WidgetObjectWindow(m_Application);
|
||||
m_imguiManager->WidgetTerrainWindow(m_Application);
|
||||
|
||||
ImGui::End();
|
||||
|
||||
//render imgui
|
||||
m_imguiManager->Render();
|
||||
|
||||
this->m_Application->GetDirect3D()->m_swapChain->Present(0, NULL);
|
||||
// Render ImGui
|
||||
m_imguiManager->ImGuiWidgetRenderer(m_Application);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -69,8 +69,6 @@ bool ApplicationClass::Initialize(int screenWidth, int screenHeight, HWND hwnd)
|
||||
return false;
|
||||
}
|
||||
|
||||
GenerateTerrain();
|
||||
|
||||
// Create the camera object.
|
||||
m_Camera = new CameraClass;
|
||||
if (!m_Camera)
|
||||
@ -245,7 +243,7 @@ bool ApplicationClass::Initialize(int screenWidth, int screenHeight, HWND hwnd)
|
||||
}
|
||||
|
||||
// Set the file name of the model.
|
||||
strcpy_s(modelFilename, "plane.txt");
|
||||
strcpy_s(modelFilename, "cube.txt");
|
||||
|
||||
// Set the file name of the textures.
|
||||
strcpy_s(textureFilename1, "stone01.tga");
|
||||
@ -389,7 +387,6 @@ bool ApplicationClass::Initialize(int screenWidth, int screenHeight, HWND hwnd)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -722,13 +719,6 @@ bool ApplicationClass::Frame(InputClass* Input)
|
||||
return false;
|
||||
}
|
||||
|
||||
// Render the graphics scene.
|
||||
result = Render(rotation, x, y, z);
|
||||
if (!result)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check if the mouse has been pressed.
|
||||
mouseDown = Input->IsMousePressed();
|
||||
|
||||
|
@ -84,45 +84,76 @@ private:
|
||||
bool UpdateRenderCountString(int);
|
||||
bool RenderSceneToTexture(float);
|
||||
|
||||
private:
|
||||
private :
|
||||
|
||||
// ------------------------------------- //
|
||||
// ------------- DIRECT3D -------------- //
|
||||
// ------------------------------------- //
|
||||
|
||||
D3DClass* m_Direct3D;
|
||||
CameraClass* m_Camera;
|
||||
IDXGISwapChain* m_swapChain;
|
||||
float speed = 0.1f;
|
||||
Object* m_SelectedObject;
|
||||
std::vector<Object*> m_cubes;
|
||||
std::vector<Object*> m_terrainChunk;
|
||||
LightShaderClass* m_LightShader;
|
||||
LightClass* m_Light;
|
||||
LightMapShaderClass* m_LightMapShader;
|
||||
MultiTextureShaderClass* m_MultiTextureShader;
|
||||
AlphaMapShaderClass* m_AlphaMapShader;
|
||||
ModelClass* m_Model;
|
||||
TextureShaderClass* m_TextureShader;
|
||||
BitmapClass* m_Bitmap;
|
||||
SpriteClass* m_Sprite;
|
||||
TimerClass* m_Timer;
|
||||
TextClass* m_MouseStrings;
|
||||
LightClass* m_Lights;
|
||||
int m_numLights;
|
||||
FontShaderClass* m_FontShader;
|
||||
TextClass* m_RenderCountString;
|
||||
FontClass* m_Font;
|
||||
TextClass *m_TextString1, *m_TextString2, *m_TextString3;
|
||||
FpsClass* m_Fps;
|
||||
TextClass* m_FpsString;
|
||||
int m_previousFps;
|
||||
std::vector<Object*> m_object;
|
||||
NormalMapShaderClass* m_NormalMapShader;
|
||||
SpecMapShaderClass* m_SpecMapShader;
|
||||
ModelListClass* m_ModelList;
|
||||
PositionClass* m_Position;
|
||||
FrustumClass* m_Frustum;
|
||||
|
||||
// ------------------------------------- //
|
||||
// ------------- RENDERING ------------- //
|
||||
// ------------------------------------- //
|
||||
|
||||
XMMATRIX m_baseViewMatrix;
|
||||
RenderTextureClass* m_RenderTexture;
|
||||
DisplayPlaneClass* m_DisplayPlane;
|
||||
float m_screenWidth, m_screenHeight;
|
||||
CameraClass* m_Camera;
|
||||
PositionClass* m_Position;
|
||||
FrustumClass* m_Frustum;
|
||||
|
||||
// ------------------------------------ //
|
||||
// ------------- OBJECTS -------------- //
|
||||
// ------------------------------------ //
|
||||
|
||||
Object* m_SelectedObject;
|
||||
std::vector<Object*> m_cubes;
|
||||
std::vector<Object*> m_terrainChunk;
|
||||
float speed = 0.1f; // speed for the demo spinning object
|
||||
std::vector<Object*> m_object;
|
||||
|
||||
// ----------------------------------- //
|
||||
// ------------- LIGHTS -------------- //
|
||||
// ----------------------------------- //
|
||||
|
||||
LightClass* m_Light;
|
||||
LightClass* m_Lights;
|
||||
int m_numLights;
|
||||
|
||||
// ----------------------------------- //
|
||||
// ------------- SHADERS ------------- //
|
||||
// ----------------------------------- //
|
||||
|
||||
LightShaderClass* m_LightShader;
|
||||
LightMapShaderClass* m_LightMapShader;
|
||||
MultiTextureShaderClass* m_MultiTextureShader;
|
||||
AlphaMapShaderClass* m_AlphaMapShader;
|
||||
TextureShaderClass* m_TextureShader;
|
||||
FontShaderClass* m_FontShader;
|
||||
NormalMapShaderClass* m_NormalMapShader;
|
||||
SpecMapShaderClass* m_SpecMapShader;
|
||||
TranslateShaderClass* m_TranslateShader;
|
||||
|
||||
BitmapClass* m_Bitmap;
|
||||
SpriteClass* m_Sprite;
|
||||
|
||||
// ------------------------------------------------- //
|
||||
// ------------- FPS AND INFO ON SCREEN ------------ //
|
||||
// ------------------------------------------------- //
|
||||
|
||||
TimerClass* m_Timer;
|
||||
TextClass* m_MouseStrings;
|
||||
TextClass* m_RenderCountString;
|
||||
FontClass* m_Font;
|
||||
TextClass* m_TextString1, * m_TextString2, * m_TextString3;
|
||||
FpsClass* m_Fps;
|
||||
TextClass* m_FpsString;
|
||||
int m_previousFps;
|
||||
};
|
||||
|
||||
#endif
|
@ -4,13 +4,13 @@ Size=400,400
|
||||
|
||||
[Window][Khaotic Engine]
|
||||
Pos=819,137
|
||||
Size=694,183
|
||||
Size=694,210
|
||||
|
||||
[Window][Objects]
|
||||
Pos=10,29
|
||||
Pos=222,19
|
||||
Size=492,353
|
||||
|
||||
[Window][Terrain]
|
||||
Pos=892,20
|
||||
Pos=892,19
|
||||
Size=418,94
|
||||
|
||||
|
@ -154,4 +154,29 @@ void imguiManager::WidgetTerrainWindow(ApplicationClass* app)
|
||||
}
|
||||
|
||||
ImGui::End();
|
||||
}
|
||||
|
||||
void imguiManager::ImGuiWidgetRenderer(ApplicationClass* app)
|
||||
{
|
||||
// Start the Dear ImGui frame
|
||||
NewFrame();
|
||||
|
||||
//ImGui Widget
|
||||
ImGui::Begin("Khaotic Engine", NULL);
|
||||
|
||||
float speed = app->GetSpeed();
|
||||
WidgetSpeedSlider(&speed);
|
||||
app->SetSpeed(speed);
|
||||
WidgetButton();
|
||||
WidgetFPS();
|
||||
WidgetAddObject(app);
|
||||
WidgetObjectWindow(app);
|
||||
WidgetTerrainWindow(app);
|
||||
|
||||
ImGui::End();
|
||||
|
||||
//render imgui
|
||||
Render();
|
||||
|
||||
app->GetDirect3D()->m_swapChain->Present(0, NULL);
|
||||
}
|
@ -29,6 +29,8 @@ public:
|
||||
void WidgetObjectWindow(ApplicationClass* app);
|
||||
void WidgetTerrainWindow(ApplicationClass* app);
|
||||
|
||||
void ImGuiWidgetRenderer(ApplicationClass* app);
|
||||
|
||||
private:
|
||||
ImGuiIO* io;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user