There's a bug in the Graphics class.
DxManager getD3DManager() { return this -> D3DManager; }
This method returns a copy of the D3DManager object. Because it's a (temporary) copy, its destructor is called causing the D3D device to be released.
You should return a pointer or a reference to the manager:
DxManager &getD3DManager() { return this -> D3DManager; }
(+1 for posting clean/readable code)
Show differencesHistory of post edits
#1eppo
Posted 01 February 2013 - 09:01 AM
There's a bug in the Graphics class.
DxManager getD3DManager() { return this -> D3DManager; }
This method returns a copy of the DxManager class. Because it's a copy, its destructor is called causing the D3D device to be released.
You should return a pointer or a reference to the manager:
DxManager &getD3DManager() { return this -> D3DManager; }
(+1 for posting clean/readable code)