remove unnecessary SDL2 include
[skip ci]
This commit is contained in:
parent
d577a98980
commit
463205c09c
@ -54,6 +54,7 @@ public:
|
||||
virtual bool openAudioInputDevice(const char* name, int freq, int channels, void* userdata, AudioCallback callback) = 0;
|
||||
virtual bool closeAudioInputDevice() = 0;
|
||||
|
||||
virtual bool hasClipboard() = 0;
|
||||
virtual void setClipboard(String text) = 0;
|
||||
virtual Maybe<String> getClipboard() = 0;
|
||||
|
||||
|
@ -481,6 +481,10 @@ private:
|
||||
Controller(SdlPlatform* parent)
|
||||
: parent(parent) {}
|
||||
|
||||
bool hasClipboard() override {
|
||||
return SDL_HasClipboardText();
|
||||
}
|
||||
|
||||
Maybe<String> getClipboard() override {
|
||||
Maybe<String> string;
|
||||
if (SDL_HasClipboardText()) {
|
||||
|
@ -1,14 +1,14 @@
|
||||
#include "StarClipboardLuaBindings.hpp"
|
||||
#include "StarLuaConverters.hpp"
|
||||
|
||||
#include "SDL2/SDL.h"
|
||||
|
||||
namespace Star {
|
||||
|
||||
LuaCallbacks LuaBindings::makeClipboardCallbacks(ApplicationControllerPtr appController) {
|
||||
LuaCallbacks callbacks;
|
||||
|
||||
callbacks.registerCallback("hasText", []() -> bool { return SDL_HasClipboardText() == SDL_TRUE;});
|
||||
callbacks.registerCallback("hasText", [appController]() -> bool {
|
||||
return appController->hasClipboard();
|
||||
});
|
||||
|
||||
callbacks.registerCallback("getText", [appController]() -> Maybe<String> {
|
||||
return appController->getClipboard();
|
||||
@ -21,4 +21,4 @@ LuaCallbacks LuaBindings::makeClipboardCallbacks(ApplicationControllerPtr appCon
|
||||
return callbacks;
|
||||
};
|
||||
|
||||
}// namespace Star
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user