mirror of
https://github.com/Kiritow/MiniEngine.git
synced 2024-03-22 13:11:22 +08:00
Fix bugs in SDLSystem. Update MiniEngine
This commit is contained in:
parent
46204ba517
commit
2fdf701703
|
@ -74,31 +74,6 @@ namespace MiniEngine
|
||||||
delete pimpl;
|
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)
|
bool GetScanKeyState(SDL_Scancode code)
|
||||||
{
|
{
|
||||||
return SDL_GetKeyboardState(NULL)[code];
|
return SDL_GetKeyboardState(NULL)[code];
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include "SDLWrapper/IncludeAll.h"
|
#include "SDLWrapper/IncludeAll.h"
|
||||||
|
|
||||||
|
|
||||||
namespace MiniEngine
|
namespace MiniEngine
|
||||||
{
|
{
|
||||||
class StringEngine
|
class StringEngine
|
||||||
|
@ -24,10 +23,6 @@ namespace MiniEngine
|
||||||
impl* pimpl;
|
impl* pimpl;
|
||||||
};
|
};
|
||||||
|
|
||||||
int SetClipboardText(const std::string& str);
|
|
||||||
std::string GetClipboardText();
|
|
||||||
bool HasClipboardText();
|
|
||||||
|
|
||||||
/// Experimental - For Experts: Use SDL ScanCode
|
/// Experimental - For Experts: Use SDL ScanCode
|
||||||
bool GetScanKeyState(SDL_Scancode);
|
bool GetScanKeyState(SDL_Scancode);
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ SDLSystem::SDLSystem(const std::initializer_list<SDLInitFlag>& flag_sdl,
|
||||||
}
|
}
|
||||||
|
|
||||||
ret=IMG_Init(img_flag);
|
ret=IMG_Init(img_flag);
|
||||||
if(ret!=0)
|
if(ret!=img_flag) /// IMG_Init returns its parameter on success.
|
||||||
{
|
{
|
||||||
ErrorViewer e;
|
ErrorViewer e;
|
||||||
e.fetch();
|
e.fetch();
|
||||||
|
@ -39,7 +39,7 @@ SDLSystem::SDLSystem(const std::initializer_list<SDLInitFlag>& flag_sdl,
|
||||||
}
|
}
|
||||||
|
|
||||||
ret=Mix_Init(mix_flag);
|
ret=Mix_Init(mix_flag);
|
||||||
if(ret!=0)
|
if(ret!=mix_flag) /// Mix_Init returns its parameter on success.
|
||||||
{
|
{
|
||||||
ErrorViewer e;
|
ErrorViewer e;
|
||||||
e.fetch();
|
e.fetch();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user