#ifndef _DEBUGUTIL_H_
#define _DEBUGUTIL_H_

#include <stdio.h>
#include <stdarg.h>

#ifdef _WIN32
	#include <Windows.h>
#endif

class DebugUtil
{
	public:
	DebugUtil() {}
	~DebugUtil() {}

	static void outputDebugText(const char *str, ...)
	{
#ifdef _DEBUG
		char* pBuf = 0;

		va_list args;
		va_start(args,str);

#ifdef _WIN32
		size_t len = _vscprintf( str, args ) + 1; 
		pBuf = new char[len];
		vsprintf_s( pBuf, len, str, args );
		OutputDebugStringA(pBuf);
#else
		pBuf = new char[2048];
		vsprintf(pBuf,str,args);
		printf(pBuf);
#endif //#ifdef _WIN32

#endif //#ifdef _DEBUG
	}
};

#endif
