2017-01-03 23:32:35 +08:00
|
|
|
#pragma once
|
|
|
|
|
2017-01-04 00:19:46 +08:00
|
|
|
#ifdef __C4DROID__
|
|
|
|
#define _WINDOW_PROGRAM
|
|
|
|
#endif // __C4DROID__
|
|
|
|
|
2017-01-03 23:32:35 +08:00
|
|
|
#include <cstdio>
|
|
|
|
#include <cstdlib>
|
|
|
|
#include <cstring>
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
/// If you have configured SDL2 header files,
|
|
|
|
/// they will be used first.
|
|
|
|
|
|
|
|
#include "SDL2/SDL.h"
|
|
|
|
#undef main
|
|
|
|
|
|
|
|
#include "SDL2/SDL_ttf.h"
|
|
|
|
#include "SDL2/SDL_image.h"
|
2017-01-03 23:47:41 +08:00
|
|
|
#include "SDL2/SDL_mixer.h"
|
2017-01-03 23:32:35 +08:00
|
|
|
|
|
|
|
class NonCopyable
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NonCopyable()=default;
|
|
|
|
~NonCopyable()=default;
|
|
|
|
NonCopyable(const NonCopyable&)=delete;
|
|
|
|
NonCopyable& operator = (const NonCopyable&)=delete;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern FILE* _log_fp;
|
|
|
|
|
|
|
|
#ifdef _WINDOW_PROGRAM
|
|
|
|
#define mlog_init() _log_fp=fopen("mini_engine_log.txt","w")
|
|
|
|
#define mlog(fmt,args...) do {if(_log_fp) {fprintf(_log_fp,fmt,##args);fprintf(_log_fp,"\n");fflush(_log_fp);} }while(0)
|
|
|
|
#else
|
|
|
|
#define mlog_init()
|
|
|
|
#define mlog(fmt,args...) printf(fmt,##args);printf("\n")
|
|
|
|
#endif
|