Skip to content

Commit

Permalink
Merge pull request vurtun#817 from ccawley2011/sfml-fix
Browse files Browse the repository at this point in the history
Fix compilation of the SFML demos
  • Loading branch information
dumblob authored Jun 16, 2019
2 parents bb327b9 + 930ac1e commit 9854477
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
1 change: 0 additions & 1 deletion demo/sfml_opengl2/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ int main(void)

/* Draw */
win.setActive(true);
nk_color_fv(bg, background);
glClear(GL_COLOR_BUFFER_BIT);
glClearColor(bg.r, bg.g, bg.b, bg.a);
/* IMPORTANT: `nk_sfml_render` modifies some global OpenGL state
Expand Down
6 changes: 3 additions & 3 deletions demo/sfml_opengl2/nuklear_sfml_gl2.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ nk_sfml_render(enum nk_anti_aliasing AA)
glEnableClientState(GL_COLOR_ARRAY);
{
GLsizei vs = sizeof(struct nk_sfml_vertex);
size_t vp = offsetof(struct nk_sfml_vertex, position);
size_t vt = offsetof(struct nk_sfml_vertex, uv);
size_t vc = offsetof(struct nk_sfml_vertex, col);
size_t vp = NK_OFFSETOF(struct nk_sfml_vertex, position);
size_t vt = NK_OFFSETOF(struct nk_sfml_vertex, uv);
size_t vc = NK_OFFSETOF(struct nk_sfml_vertex, col);

/* convert from command queue into draw list and draw to screen */
const struct nk_draw_command* cmd;
Expand Down
2 changes: 0 additions & 2 deletions demo/sfml_opengl3/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,7 @@ int main(void)
/* ----------------------------------------- */

/* Draw */
float bg[4];
win.setActive(true);
nk_color_fv(bg, background);
glClear(GL_COLOR_BUFFER_BIT);
glClearColor(bg.r, bg.g, bg.b, bg.a);
/* IMPORTANT: `nk_sfml_render` modifies some global OpenGL state
Expand Down
6 changes: 3 additions & 3 deletions demo/sfml_opengl3/nuklear_sfml_gl3.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ nk_sfml_device_create(void)
{
/* buffer setup */
GLsizei vs = sizeof(struct nk_sfml_vertex);
size_t vp = offsetof(struct nk_sfml_vertex, position);
size_t vt = offsetof(struct nk_sfml_vertex, uv);
size_t vc = offsetof(struct nk_sfml_vertex, col);
size_t vp = NK_OFFSETOF(struct nk_sfml_vertex, position);
size_t vt = NK_OFFSETOF(struct nk_sfml_vertex, uv);
size_t vc = NK_OFFSETOF(struct nk_sfml_vertex, col);

glGenBuffers(1, &dev->vbo);
glGenBuffers(1, &dev->ebo);
Expand Down

0 comments on commit 9854477

Please sign in to comment.