Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TSBK03 project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Adam Nyberg
TSBK03 project
Commits
bd07814e
Commit
bd07814e
authored
5 months ago
by
Adam Nyberg
Browse files
Options
Downloads
Patches
Plain Diff
Removed unused file
parent
a52cb577
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+0
-1
0 additions, 1 deletion
CMakeLists.txt
src/ImGuiManager.cpp
+0
-156
0 additions, 156 deletions
src/ImGuiManager.cpp
with
0 additions
and
157 deletions
CMakeLists.txt
+
0
−
1
View file @
bd07814e
...
...
@@ -72,7 +72,6 @@ target_include_directories(cuda_static PUBLIC
set
(
COMMON_SOURCES
src/spawn_particles.cpp
src/Camera.cpp
src/ImGuiManager.cpp
src/FluidSimulationApp.cpp
src/FluidRenderer.cpp
src/FluidSimulation.cpp
...
...
This diff is collapsed.
Click to expand it.
src/ImGuiManager.cpp
deleted
100644 → 0
+
0
−
156
View file @
a52cb577
// ImGuiManager.cpp
#include
"include/ImGuiManager.h"
#include
"imgui_impl_glfw.h"
#include
"imgui_impl_opengl3.h"
// Constructor: Initializes ImGui context and sets up backends
ImGuiManager
::
ImGuiManager
(
GLFWwindow
*
window
,
FluidConfig
&
config
)
:
fluidConfig
(
config
)
// Initialize the reference
{
// Setup Dear ImGui context
IMGUI_CHECKVERSION
();
ImGui
::
CreateContext
();
ImGuiIO
&
io
=
ImGui
::
GetIO
();
(
void
)
io
;
// Enable Docking
io
.
ConfigFlags
|=
ImGuiConfigFlags_DockingEnable
;
// Optional: Enable Multi-Viewport / Platform Windows
// io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable;
// Setup Dear ImGui style
ImGui
::
StyleColorsDark
();
// ImGui::StyleColorsClassic();
// Setup Platform/Renderer backends
ImGui_ImplGlfw_InitForOpenGL
(
window
,
true
);
ImGui_ImplOpenGL3_Init
(
"#version 330"
);
}
// Destructor: Cleans up ImGui resources
ImGuiManager
::~
ImGuiManager
()
{
// Cleanup ImGui backends
ImGui_ImplOpenGL3_Shutdown
();
ImGui_ImplGlfw_Shutdown
();
// Destroy ImGui context
ImGui
::
DestroyContext
();
}
// Starts a new ImGui frame
void
ImGuiManager
::
newFrame
()
{
// Start the Dear ImGui frame
ImGui_ImplOpenGL3_NewFrame
();
ImGui_ImplGlfw_NewFrame
();
ImGui
::
NewFrame
();
}
// Renders ImGui draw data
void
ImGuiManager
::
render
()
{
// Rendering
ImGui
::
Render
();
ImGui_ImplOpenGL3_RenderDrawData
(
ImGui
::
GetDrawData
());
// Update and Render additional Platform Windows (if enabled)
/*
ImGuiIO& io = ImGui::GetIO();
if (io.ConfigFlags & ImGuiConfigFlags_ViewportsEnable){
GLFWwindow* backup_current_context = glfwGetCurrentContext();
ImGui::UpdatePlatformWindows();
ImGui::RenderPlatformWindowsDefault();
glfwMakeContextCurrent(backup_current_context);
}
*/
}
// Provides access to ImGuiIO
ImGuiIO
&
ImGuiManager
::
getIO
()
{
return
ImGui
::
GetIO
();
}
void
ImGuiManager
::
createControlsWindow
()
{
ImGui
::
Begin
(
"Controls"
);
ImGui
::
Text
(
"Fluid Simulation Parameters"
);
ImGui
::
Separator
();
// Draw a horizontal line to separate sections
ImGui
::
Spacing
();
// Block: Fluid Properties
ImGui
::
Text
(
"Fluid Properties:"
);
ImGui
::
Spacing
();
ImGui
::
Text
(
"Viscosity:"
);
ImGui
::
SliderFloat
(
"##ViscositySlider"
,
&
fluidConfig
.
viscosity
,
0.0
f
,
5.0
f
,
"%.2f"
);
ImGui
::
Spacing
();
ImGui
::
Text
(
"Particle Mass:"
);
ImGui
::
SliderFloat
(
"##ParticleMassSlider"
,
&
fluidConfig
.
particleMass
,
0.0
f
,
2.0
f
,
"%.2f"
);
ImGui
::
Spacing
();
ImGui
::
Separator
();
// Separate sections visually
ImGui
::
Spacing
();
// Block: Simulation Settings
ImGui
::
Text
(
"Simulation Settings:"
);
ImGui
::
Spacing
();
ImGui
::
Text
(
"Rest Density:"
);
ImGui
::
SliderFloat
(
"##RestDensitySlider"
,
&
fluidConfig
.
restDensity
,
1000.0
f
,
5000.0
f
,
"%.0f"
);
ImGui
::
Spacing
();
ImGui
::
Text
(
"Smoothing Radius:"
);
ImGui
::
SliderFloat
(
"##SmoothingRadiusSlider"
,
&
fluidConfig
.
smoothingRadius
,
0.1
f
,
1.0
f
,
"%.2f"
);
ImGui
::
Spacing
();
ImGui
::
Separator
();
// Separate sections visually
ImGui
::
Spacing
();
// Additional blocks can be added as needed
// For example:
// ImGui::Text("Additional Settings:");
// ImGui::Spacing();
// ImGui::SliderFloat("SomeOtherParameter", &someConfigValue, min, max, "%.2f");
ImGui
::
End
();
}
// Creates the "Frame Stats" window with FPS graphs
void
ImGuiManager
::
createFrameStatsWindow
()
{
ImGui
::
Begin
(
"Frame Stats"
);
// Example implementation using plot lines
static
float
fpsHistory
[
120
]
=
{
0
};
static
float
frameTimeHistory
[
120
]
=
{
0
};
static
int
historyIndex
=
0
;
// Update history arrays (this should be called each frame)
ImGuiIO
&
io
=
ImGui
::
GetIO
();
float
currentFps
=
io
.
Framerate
;
float
currentFrameTime
=
1000.0
f
/
currentFps
;
// in ms
fpsHistory
[
historyIndex
%
120
]
=
currentFps
;
frameTimeHistory
[
historyIndex
%
120
]
=
currentFrameTime
;
historyIndex
++
;
// Plot FPS
ImGui
::
Text
(
"FPS"
);
ImGui
::
PlotLines
(
"##FPS"
,
fpsHistory
,
120
,
historyIndex
%
120
,
NULL
,
0.0
f
,
120.0
f
,
ImVec2
(
0
,
80
));
// Plot Frame Time
ImGui
::
Text
(
"Frame Time (ms)"
);
ImGui
::
PlotLines
(
"##FrameTime"
,
frameTimeHistory
,
120
,
historyIndex
%
120
,
NULL
,
0.0
f
,
50.0
f
,
ImVec2
(
0
,
80
));
ImGui
::
End
();
}
// Creates the "FBO Selection" window with a dropdown
void
ImGuiManager
::
createFBOSelectionWindow
()
{
ImGui
::
Begin
(
"FBO Selection"
);
static
int
selectedFBO
=
0
;
const
char
*
fboOptions
[]
=
{
"Stage 1"
,
"Stage 2"
,
"Stage 3"
,
"Stage 4"
};
int
numFBOs
=
sizeof
(
fboOptions
)
/
sizeof
(
fboOptions
[
0
]);
ImGui
::
Combo
(
"Select FBO to Render"
,
&
selectedFBO
,
fboOptions
,
numFBOs
);
// You can store 'selectedFBO' to use it later for rendering
// For now, as per your request, no functionality is implemented
ImGui
::
End
();
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment