2017-06-18 20:37:45 +08:00
|
|
|
#pragma once
|
|
|
|
#include "include.h"
|
|
|
|
#include <cstdio>
|
|
|
|
#include <string>
|
|
|
|
#include <memory>
|
2017-07-01 17:11:06 +08:00
|
|
|
#include "__Plugin.h"
|
2017-07-31 00:18:10 +08:00
|
|
|
namespace MiniEngine
|
|
|
|
{
|
2017-06-18 20:37:45 +08:00
|
|
|
class RWOP
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
RWOP(FILE* fp,bool autoclose);
|
|
|
|
RWOP(const std::string& filename,const std::string& openmode);
|
|
|
|
RWOP(const void* mem,int size);
|
|
|
|
RWOP(void* mem,int size);
|
|
|
|
RWOP()=default;
|
|
|
|
~RWOP()=default;
|
|
|
|
|
|
|
|
void release();
|
|
|
|
private:
|
|
|
|
std::shared_ptr<SDL_RWops> _op;
|
|
|
|
SDL_RWops* _get() const;
|
|
|
|
void _clear();
|
|
|
|
void _set(SDL_RWops*);
|
|
|
|
friend class Surface;
|
|
|
|
friend class Renderer;
|
2017-07-04 22:38:33 +08:00
|
|
|
friend class Sound;
|
|
|
|
friend class Music;
|
2017-07-01 17:11:06 +08:00
|
|
|
|
|
|
|
friend class _internal::Plugin;
|
2017-06-18 20:37:45 +08:00
|
|
|
};
|
2017-07-31 00:18:10 +08:00
|
|
|
} /// End of namespace MiniEngine
|
|
|
|
|