|
@@ -323,6 +323,7 @@ nk_sfml_clipboard_paste(nk_handle usr, struct nk_text_edit* edit)
|
|
static void
|
|
static void
|
|
nk_sfml_clipboard_copy(nk_handle usr, const char* text, int len)
|
|
nk_sfml_clipboard_copy(nk_handle usr, const char* text, int len)
|
|
{
|
|
{
|
|
|
|
+ /*
|
|
char* str = 0;
|
|
char* str = 0;
|
|
(void)usr;
|
|
(void)usr;
|
|
if(!len)
|
|
if(!len)
|
|
@@ -333,12 +334,12 @@ nk_sfml_clipboard_copy(nk_handle usr, const char* text, int len)
|
|
memcpy(str, text, (size_t)len);
|
|
memcpy(str, text, (size_t)len);
|
|
str[len] = '\0';
|
|
str[len] = '\0';
|
|
|
|
|
|
- /* Not Implemented in SFML
|
|
|
|
|
|
+ Not Implemented in SFML
|
|
sf::Clipboard clipboard(sfml.window);
|
|
sf::Clipboard clipboard(sfml.window);
|
|
clipboard.setText(str);
|
|
clipboard.setText(str);
|
|
- */
|
|
|
|
-
|
|
|
|
|
|
+
|
|
free(str);
|
|
free(str);
|
|
|
|
+ */
|
|
}
|
|
}
|
|
|
|
|
|
NK_API struct nk_context*
|
|
NK_API struct nk_context*
|
|
@@ -349,7 +350,6 @@ nk_sfml_init(sf::Window* window)
|
|
sfml.ctx.clip.copy = nk_sfml_clipboard_copy;
|
|
sfml.ctx.clip.copy = nk_sfml_clipboard_copy;
|
|
sfml.ctx.clip.paste = nk_sfml_clipboard_paste;
|
|
sfml.ctx.clip.paste = nk_sfml_clipboard_paste;
|
|
sfml.ctx.clip.userdata = nk_handle_ptr(0);
|
|
sfml.ctx.clip.userdata = nk_handle_ptr(0);
|
|
- //nk_buffer_init_default(&sfml.ogl.cmds);
|
|
|
|
nk_sfml_device_create();
|
|
nk_sfml_device_create();
|
|
return &sfml.ctx;
|
|
return &sfml.ctx;
|
|
}
|
|
}
|
|
@@ -389,6 +389,7 @@ nk_sfml_handle_event(sf::Event* event)
|
|
{
|
|
{
|
|
int x = (int)ctx->input.mouse.prev.x;
|
|
int x = (int)ctx->input.mouse.prev.x;
|
|
int y = (int)ctx->input.mouse.prev.y;
|
|
int y = (int)ctx->input.mouse.prev.y;
|
|
|
|
+
|
|
sfml.window->setMouseCursorGrabbed(false);
|
|
sfml.window->setMouseCursorGrabbed(false);
|
|
sf::Mouse::setPosition(sf::Vector2i(x, y));
|
|
sf::Mouse::setPosition(sf::Vector2i(x, y));
|
|
ctx->input.mouse.ungrab = 0;
|
|
ctx->input.mouse.ungrab = 0;
|
|
@@ -478,15 +479,7 @@ nk_sfml_handle_event(sf::Event* event)
|
|
}
|
|
}
|
|
else if(event->type == sf::Event::MouseMoved)
|
|
else if(event->type == sf::Event::MouseMoved)
|
|
{
|
|
{
|
|
- if(ctx->input.mouse.grabbed)
|
|
|
|
- {
|
|
|
|
- int x = (int)ctx->input.mouse.prev.x + event->mouseMove.x;
|
|
|
|
- int y = (int)ctx->input.mouse.prev.y + event->mouseMove.y;
|
|
|
|
-
|
|
|
|
- nk_input_motion(ctx, x, y);
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- nk_input_motion(ctx, event->mouseMove.x, event->mouseMove.y);
|
|
|
|
|
|
+ nk_input_motion(ctx, event->mouseMove.x, event->mouseMove.y);
|
|
|
|
|
|
return 1;
|
|
return 1;
|
|
}
|
|
}
|