Skip to content

Commit

Permalink
Fix sfml_opengl3 demo
Browse files Browse the repository at this point in the history
  • Loading branch information
Hejsil committed May 8, 2020
1 parent 4db1516 commit 74c8398
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions demo/sfml_opengl3/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,35 +123,35 @@ int main(void)
nk_input_end(ctx);

/* GUI */
if (nk_begin(ctx, "Demo", nk_rect(50, 50, 230, 250),
if (nk_begin(ctx, nk_slicez("Demo"), nk_rect(50, 50, 230, 250),
NK_WINDOW_BORDER|NK_WINDOW_MOVABLE|NK_WINDOW_SCALABLE|
NK_WINDOW_MINIMIZABLE|NK_WINDOW_TITLE))
{
enum {EASY, HARD};
static int op = EASY;
static int property = 20;
nk_layout_row_static(ctx, 30, 80, 1);
if (nk_button_label(ctx, "button"))
if (nk_button_label(ctx, nk_slicez("button")))
fprintf(stdout, "button pressed\n");

nk_layout_row_dynamic(ctx, 30, 2);
if (nk_option_label(ctx, "easy", op == EASY)) op = EASY;
if (nk_option_label(ctx, "hard", op == HARD)) op = HARD;
if (nk_option_label(ctx, nk_slicez("easy"), op == EASY)) op = EASY;
if (nk_option_label(ctx, nk_slicez("hard"), op == HARD)) op = HARD;

nk_layout_row_dynamic(ctx, 25, 1);
nk_property_int(ctx, "Compression:", 0, &property, 100, 10, 1);
nk_property_int(ctx, nk_slicez("Compression:"), 0, &property, 100, 10, 1);

nk_layout_row_dynamic(ctx, 20, 1);
nk_label(ctx, "background:", NK_TEXT_LEFT);
nk_label(ctx, nk_slicez("background:"), NK_TEXT_LEFT);
nk_layout_row_dynamic(ctx, 25, 1);
if (nk_combo_begin_color(ctx, nk_rgb_cf(bg), nk_vec2(nk_widget_width(ctx),400))) {
nk_layout_row_dynamic(ctx, 120, 1);
bg = nk_color_picker(ctx, bg, NK_RGBA);
nk_layout_row_dynamic(ctx, 25, 1);
bg.r = nk_propertyf(ctx, "#R:", 0, bg.r, 1.0f, 0.01f,0.005f);
bg.g = nk_propertyf(ctx, "#G:", 0, bg.g, 1.0f, 0.01f,0.005f);
bg.b = nk_propertyf(ctx, "#B:", 0, bg.b, 1.0f, 0.01f,0.005f);
bg.a = nk_propertyf(ctx, "#A:", 0, bg.a, 1.0f, 0.01f,0.005f);
bg.r = nk_propertyf(ctx, nk_slicez("#R:"), 0, bg.r, 1.0f, 0.01f,0.005f);
bg.g = nk_propertyf(ctx, nk_slicez("#G:"), 0, bg.g, 1.0f, 0.01f,0.005f);
bg.b = nk_propertyf(ctx, nk_slicez("#B:"), 0, bg.b, 1.0f, 0.01f,0.005f);
bg.a = nk_propertyf(ctx, nk_slicez("#A:"), 0, bg.a, 1.0f, 0.01f,0.005f);
nk_combo_end(ctx);
}
}
Expand Down
2 changes: 1 addition & 1 deletion demo/sfml_opengl3/nuklear_sfml_gl3.h
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ nk_sfml_clipboard_paste(nk_handle usr, struct nk_text_edit* edit)
#endif
}
static void
nk_sfml_clipboard_copy(nk_handle usr, const char* text, int len)
nk_sfml_clipboard_copy(nk_handle usr, struct nk_slice text)
{
#if 0
char* str = 0;
Expand Down

0 comments on commit 74c8398

Please sign in to comment.