🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Scene loading and unloading in DirectX

Started by
2 comments, last by KielanT 3 years, 2 months ago

Hi, I'm still new to graphics programming, but I want to have ago at loading and unloading levels/scenes. I have no idea where to start is there any resources that could be helpful that anyone knows off? Or any tips or advice to send me down the right path?

None

Advertisement

Create a scene class that contains lists for your meshes, lights, etc… and also other information such as the scene name, skybox texture, fog configuration and whatever else you might have in your engine. In your main renderer class make a ‘currentScene’ variable that stores a reference to the current scene that is meant to be running. Then in your update and rendering loops you can simply update/render objects from scene that is stored in the ‘currentScene’ variable. For saving and loading look into serialization which allows you to write the state of an object(s) to a file and retrieve it later. Alternatively, you may also want to use your own format for storing scene data in a file.

@adam7 Thank you that makes sense

None

This topic is closed to new replies.

Advertisement