mirror of
https://github.com/Kiritow/MiniEngine.git
synced 2024-03-22 13:11:22 +08:00
37 lines
794 B
C++
37 lines
794 B
C++
#pragma once
|
|
|
|
#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"
|
|
#include "SDL2/SDL_Mixer.h"
|
|
|
|
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
|