Fix bugs in SDLSystem. Update MiniEngine

This commit is contained in:
Kirigaya Kazuto 2017-07-01 15:46:42 +08:00
parent 46204ba517
commit 2fdf701703
3 changed files with 2 additions and 32 deletions

View File

@ -74,31 +74,6 @@ namespace MiniEngine
delete pimpl;
}
int SetClipboardText(const std::string& str)
{
return SDL_SetClipboardText(str.c_str());
}
std::string GetClipboardText()
{
char* pstr=SDL_GetClipboardText();
if(pstr==nullptr)
{
return std::string();
}
else
{
std::string s(pstr);
SDL_free(pstr);
return s;
}
}
bool HasClipboardText()
{
return SDL_HasClipboardText()==SDL_TRUE;
}
bool GetScanKeyState(SDL_Scancode code)
{
return SDL_GetKeyboardState(NULL)[code];

View File

@ -4,7 +4,6 @@
#include <functional>
#include "SDLWrapper/IncludeAll.h"
namespace MiniEngine
{
class StringEngine
@ -24,10 +23,6 @@ namespace MiniEngine
impl* pimpl;
};
int SetClipboardText(const std::string& str);
std::string GetClipboardText();
bool HasClipboardText();
/// Experimental - For Experts: Use SDL ScanCode
bool GetScanKeyState(SDL_Scancode);

View File

@ -31,7 +31,7 @@ SDLSystem::SDLSystem(const std::initializer_list<SDLInitFlag>& flag_sdl,
}
ret=IMG_Init(img_flag);
if(ret!=0)
if(ret!=img_flag) /// IMG_Init returns its parameter on success.
{
ErrorViewer e;
e.fetch();
@ -39,7 +39,7 @@ SDLSystem::SDLSystem(const std::initializer_list<SDLInitFlag>& flag_sdl,
}
ret=Mix_Init(mix_flag);
if(ret!=0)
if(ret!=mix_flag) /// Mix_Init returns its parameter on success.
{
ErrorViewer e;
e.fetch();