-
Pascal Engeler authoredPascal Engeler authored
FocusTerra Realtime Wave Simulator
This repository contains all files that make up the realtime wave simulator exhibit at FocusTerra.
While the project was originally developed on macOS, it was later ported to Windows (Visual Studio 2019).
Dependencies are OpenGL, ImGui and SDL, and all of them are contained in this repository.
Table of Contents
- FocusTerra Realtime Wave Simulator
- Table of Contents
- Project Organization
- Resources
- Building the Project
- User Manual
-
Documentation
- Architecture
-
Classes
- Drawer (drawer.hpp, drawer.cpp)
- DrawingHandler (drawing_handler.hpp, drawing_handler.cpp)
- EfficientBlock (efficient_block.hpp, efficient_block.cpp)
- EventLogger (event_logger.hpp, event_logger.cpp)
- GuiHandler (gui_handler.hpp, gui_handler.cpp)
- Infrastructure (infrastructure.hpp, infrastructure.cpp)
- InputHandler (input_handler.hpp, input_handler.cpp)
- Message (message.hpp, message.cpp)
- PatternHandler (pattern_handler.hpp, pattern_handler.cpp)
- Pevent (pevent.hpp, pevent.cpp)
- PeventFactory (pevent.hpp, pevent.cpp)
- Shader (shader.hpp, shader.cpp)
- SlimBlockchainHandler (slim_blockchain_handler.hpp, slim_blockchain_handler.cpp)
- TimeoutHandler (timeout_handler.hpp, timeout_handler.cpp)
- Toolbox (toolbox.hpp, toolbox.cpp)
- WaveHandler (wave_handler.hpp, wave_handler.cpp)
- Enums (enums.hpp)
- ImGui Customization
- GLSL Shaders
- Workflow: Sample main function
Project Organization
The repo is organized in the following folders:
-
src
(and subfolders) contains all.cpp
-
include
(and subfolders) contains all headers -
shaders
contains all GLSL shaders -
lib
contains libraries -
FocusTerra
contains the Visual Studio project file -
FocusTerra\x64\Release
andFocusTerra\x64\Debug
contain the executables -
build
is left over from the macOS days (contains a currently brokenMakefile
)
Resources
Resources are organized in a single folder called ft_top
. It contains the following:
- A folder
bin
that contains the executable andSDL2.dll
- A folder
fonts
that contains the font used by the GUI, namelyCousine-Regular.ttf
- A folder
resource
that contains- The colour palette in
ft_palette.conf
,ft_palette.texture
- The Image Button images in the folder
images
- A folder
textures
that contains the predefined structure textures. There are two versions, one for the FocusTerra resolution (inrocket
), and one for Pascal's resolution (inhome
).
- The colour palette in
- A folder
shaders
that contains the used GLSL shaders.
The program accesses these resources at runtime.
File Formats
This section describes the file formats external files are expected to follow.
GUI Images
Gui Images, such as the button textures, are loaded using stbi
. The exact calls can be found in GuiHandler::load_image_to_texture_
. The important parts are
data = stbi_load(file.c_str(), &width, &height, &nrChannels, STBI_rgb_alpha);
//...
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
Images are expected to be RGBA, i.e. to have an alpha channel. Not being very fluent in image formats, I believe this is the only limitation. To be save, I'll state that images are expected to be loadable with the above calls.