Original Post
1) Do any DirecX functions use exceptions? 2) If so... where can I find documentation as to which functions throw which exceptions?
void IntializeD3D() throw() // nothrowunexpected will be executed which will cause the program to abort (with no doubt several memory leaks).
Quote:
Original post by JClayton
Well granted... however when writing functions in C++ if you define a function such as this:void IntializeD3D() throw() // nothrow
And you call a DirectX function within the funciton above that throws an exception it contradicts the definition of the function because it is not allowed to throw... thus the exception either has to be caught in InitializeD3D orwill be executed which will cause the program to abort (with no doubt several memory leaks).unexpected
Quote:
Original post by JClayton
Ok... I'm clear on that now. As a client of DirectX I don't care if the API throws and catches exceptions internally (as long as they are caught :P ). All I wanted to know is if the DX functions threw exceptions that were meant to be handled by clients similar to std functions/operators.
Renderer* pRender = new Renderer(...);if(pRenderer->Init() == false) {/*something's amiss*/}// the Renderer::Init() is a superfluous method in my opinionRenderer* pRender = new Renderer(...);// this is teh shit - the pRenderer is constructed AND initializedQuote:
Can someone elaborate why not to use exceptions with DirectX?
Quote:
Original post by Metus
Can someone elaborate why not to use exceptions with DirectX?
Quote:
Original post by Becko
exception-handling is slowing down your code, i think this is the reason why there is no exception thrown by DX, cause games need faster code than an office application
Quote:
also i think the exception handling in c++ is poorly solved, best exception handling i've ever work with was the ada exception handling
This topic has been locked by a moderator. New replies are not allowed.
With your permission, GameDev.net uses analytics cookies to understand how people use the platform. You can accept analytics or continue with necessary cookies only. Learn more