Have you ever seen the DVD logo screensaver that bounces around the screen and changes color upon collision? When I was a child, I did, and I had no clue how it worked until many years later, when I embarked on my first graphics project, which reminds me a lot of the DVD screensaver because the program functionality is pretty much the same: generate colorful primitive shapes that bounce off the edges of the screen, living in harmony and peace forever. Was it a simple project looking back? Yes. Was it the same when I did it? No, I was intimidated. If you’re curious about more details, read on below.
Project objetive
Create a program that allows to implement concepts as: collisions, primitives, textures, movement, rendering, graphics API, etc.
Technology
- Programing lenguage : C++17
- External libraries : SFML
- Build system generator: Make
Creation process
- Define the project goals and gather necessary documentation and basic concepts to start programming.
- Set up the development environment with the chosen technologies.
- Configure the graphics library and ensure proper functionality. Key settings include display, drawing, and clearing.
- Define data structures to store information about the primitives.
- Implement essential functions: reading files, parsing data, initializing the program with desired textures, automatically configuring primitive settings, and drawing the primitives on screen.
Lessons Learned
- Never Underestimate Complexity: “Simple” tasks can hide unexpected challenges. Approach problems with curiosity rather than assumptions to navigate complexities effectively.
- Debugging is Essential: A robust debugging toolkit is invaluable. It’s your ally in identifying and resolving issues promptly.
- Data Import/Export Vigilance: Importing and exporting data can derail projects due to minor errors like a misplaced character or incorrect path references. Rigorous validation during parsing and storage is critical for stable implementations.
- Modular Design for Maintainability: Embrace modular programming for improved program design and maintenance. Modular code not only enhances readability but also simplifies updates and debugging.
References
Ref[1] = https://www.sfml-dev.org/