#include "debug.h"
-/// ***** Private Method Headers *****
-/// ***** Private Variables *****
+#include <iostream>
+using std::cerr;
+using std::cout;
+using std::endl;
+
+#include <SDL/SDL.h>
/// ***** Public Methods *****
+SDL_mutex* muDPF = NULL;
+
void DPF(int level, const char* pstr)
{
- cout << pstr << endl;
+ // lock
+ SDL_mutexP( muDPF );
+
+ cout << pstr << endl;
+
+ //unlock
+ SDL_mutexV( muDPF );
+}
+
+void debug::init()
+{
+ muDPF = SDL_CreateMutex();
+}
+
+void debug::clean()
+{
+ SDL_DestroyMutex( muDPF );
}
/// ***** Private Methods *****