#ifndef __MglException_H__
#define __MglException_H__

/*#include "MglCommonException.h"

//	クラス宣言
class CMglException : public MglCommonException
{
public:

private:

};*/


/*#define MGL_H_ASSERT(CALL)	\
	MyuAssert( CALL, S_OK,	\
		"%s", typeid (*this).name());*/

#define MGL_H_ASSERT(CALL)	\
	MglAssert2( __FILE__, __LINE__, CALL, S_OK,	\
		"%s に失敗。", # CALL );

#define MGL_H_ASSERT2(CALL,FROM)	\
	MglAssert2( CALL, S_OK,	\
		"%s  %s に失敗。"	\
		"\r\n%s:%d", FROM, # CALL, __FILE__, __LINE__);

/*
#define MGL_H_ASSERT(CALL)	\
	MyuAssert( CALL, S_OK,	\
		"%s に失敗。"	\
		"\r\n%s:%d", # CALL, __FILE__, __LINE__);

#define MGL_H_ASSERT2(CALL,FROM)	\
	MyuAssert( CALL, S_OK,	\
		"%s  %s に失敗。"	\
		"\r\n%s:%d", FROM, # CALL, __FILE__, __LINE__);
*/

inline void MglDxAssert( long nResult, const char* szCurClass, const char* szCurMethod, const char* szFunc, const char* szAppend, ... )
{
	char appendFormatted[1024];
	va_list vl;
	va_start( vl, appendFormatted );
	vsnprintf( appendFormatted, sizeof(appendFormatted), appendFormatted, vl );
	va_end( vl );

	char msg[1024];
	snprintf(msg, sizeof(msg), "%s::%s  %s() に失敗。%s", appendFormatted );
	MyuAssert( nResult, D3D_OK, msg );
}

inline void MglDxAssert( long nResult, const char* szCurClass, const char* szCurMethod, const char* szFunc )
{
	MglDxAssert( nResult, szCurClass, szCurMethod, "" );
}

#endif//__MglException_H__
