Trying to hook up the first native function!
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
#ifndef LIME_UI_DISPLAY_H
|
||||
#define LIME_UI_DISPLAY_H
|
||||
|
||||
#include <SDL.h>
|
||||
#include <ui/Gamepad.h>
|
||||
#include <map>
|
||||
|
||||
namespace lime {
|
||||
|
||||
|
||||
class Display {
|
||||
|
||||
public:
|
||||
|
||||
static int GetNumDevices ();
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <graphics/ImageBuffer.h>
|
||||
#include <graphics/Renderer.h>
|
||||
#include <graphics/RenderEvent.h>
|
||||
#include <system/Display.h>
|
||||
#include <system/System.h>
|
||||
#include <text/Font.h>
|
||||
#include <text/TextLayout.h>
|
||||
@@ -390,6 +391,11 @@ namespace lime {
|
||||
|
||||
}
|
||||
|
||||
value lime_display_get_num_devices () {
|
||||
|
||||
return alloc_int (Display::GetNumDevices());
|
||||
|
||||
}
|
||||
|
||||
value lime_gamepad_add_mappings (value mappings) {
|
||||
|
||||
@@ -1172,6 +1178,7 @@ namespace lime {
|
||||
DEFINE_PRIM (lime_font_render_glyph, 3);
|
||||
DEFINE_PRIM (lime_font_render_glyphs, 3);
|
||||
DEFINE_PRIM (lime_font_set_size, 2);
|
||||
DEFINE_PRIM (lime_display_get_num_devices, 0);
|
||||
DEFINE_PRIM (lime_gamepad_add_mappings, 1);
|
||||
DEFINE_PRIM (lime_gamepad_event_manager_register, 2);
|
||||
DEFINE_PRIM (lime_gamepad_get_device_guid, 1);
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
#include <system/Display.h>
|
||||
|
||||
|
||||
namespace lime {
|
||||
|
||||
|
||||
int SDLDisplay::GetNumDevices() {
|
||||
|
||||
return SDL_GetNumVideoDisplays();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user