Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualeppo

Posted 01 February 2013 - 09:08 AM

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)

#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)


PARTNERS