Files
glest-source/source/shared_lib/include/graphics/d3d9/d3d9_util.h
Mark Vejvoda 8c0bf75bf5 - got built in memory leak working. Just edit leak_dumper.h and uncomment:
//#define SL_LEAK_DUMP
- got better / more accurate stack dumps when we detect errors in game.
- Both of these need to be worked on in windows next, win32 may not compile for now until i fix it on that platform.
- BE VERY CAREFUL when working in leak_dumper.* it may cause GCC and your system to crash if you don't know what you are doing!
2012-04-14 21:21:09 +00:00

26 lines
543 B
C++

#ifndef _SHARED_D3D9_D3D9UTIL_H_
#define _SHARED_D3D9_D3D9UTIL_H_
#include <d3d9.h>
#include <string>
#include <stdexcept>
#define D3DCALL(X) checkResult(X, #X);
using std::string;
using std::runtime_error;
namespace Shared{ namespace Graphics{ namespace D3d9{
string d3dErrorToStr(HRESULT result);
inline void checkResult(HRESULT result, const string &functionCall){
if(result!=D3D_OK){
throw megaglest_runtime_error("Direct3D Error\nCode: " + d3dErrorToStr(result) + "\nFunction: " + functionCall);
}
}
}}}//end namespace
#endif