Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Mastering C++ Game Animation Programming

You're reading from   Mastering C++ Game Animation Programming Enhance your skills with advanced game animation techniques in C++, OpenGL, and Vulkan

Arrow left icon
Product type Paperback
Published in Mar 2025
Publisher Packt
ISBN-13 9781835881927
Length 544 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Author (1):
Arrow left icon
Michael Dunsky Michael Dunsky
Author Profile Icon Michael Dunsky
Michael Dunsky
Arrow right icon
View More author details
Toc

Table of Contents (21) Chapters Close

Preface 1. Part 1: Populating the World with the Game Character Models
2. Working with Open Asset Import Library FREE CHAPTER 3. Moving Animation Calculations from CPU to GPU 4. Adding a Visual Selection 5. Part 2: Transforming the Model Viewer into an Animation Editor
6. Enhancing Application Handling 7. Saving and Loading the Configuration 8. Extending Camera Handling 9. Part 3: Tuning Character Animations
10. Enhancing Animation Controls 11. An Introduction to Collision Detection 12. Adding Behavior and Interaction 13. Advanced Animation Blending 14. Part 4: Enhancing Your Virtual World
15. Loading a Game Map 16. Advanced Collision Detection 17. Adding Simple Navigation 18. Creating Immersive Interactive Worlds 19. Other Books You May Enjoy
20. Index

Extending the UI with an Open File dialog

ImGui can be used to create simple UIs like in our animation application, but the code can be also extended to build different kinds of tools. For our application, a dialog to choose a file on the system is helpful to load models at runtime, freeing us of hardcoding the model names in the code or using models as command-line parameters when starting the application.

Various ImGui-based file dialogs exist; a nice and easy-to-integrate file dialog can be found in the GitHub repository of Stephane Cuillerdier at https://github.com/aiekick/ImGuiFileDialog.

For a simple integration of the file dialog, we will use CMake’s FetchContent to download and build the code.

Integrating the file dialog into CMakeLists.txt

First, we add a new FetchContent block into the CMakeLists.txt file, right below the end of the ImGui fetching:

FetchContent_Declare(
  filedialog
  GIT_REPOSITORY https://github.com/aiekick/ImGuiFileDialog
 ...
You have been reading a chapter from
Mastering C++ Game Animation Programming
Published in: Mar 2025
Publisher: Packt
ISBN-13: 9781835881927
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime