Files
glest-source/source/shared_lib/include/graphics/d3d9/d3d9_util.h
Mark Vejvoda ee2c02610d - updated copyright headers is some files that had them missing
- added a new language string for battle end screen
2012-08-02 00:57:28 +00:00

34 lines
844 B
C++

// ==============================================================
// This file is part of MegaGlest Shared Library (www.megaglest.org)
//
// Copyright (C) 2012 Mark Vejvoda, Titus Tscharntke
// The Megaglest Team, under GNU GPL v3.0
// ==============================================================
#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