mirror of
https://github.com/glest/glest-source.git
synced 2025-09-26 07:28:59 +02:00
//#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!
26 lines
543 B
C++
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 |