From 930ac1e8883790056b4133960bd0235524dac46f Mon Sep 17 00:00:00 2001 From: Cameron Cawley Date: Thu, 28 Feb 2019 00:10:42 +0000 Subject: [PATCH] Fix compilation of the SFML demos --- demo/sfml_opengl2/main.cpp | 1 - demo/sfml_opengl2/nuklear_sfml_gl2.h | 6 +++--- demo/sfml_opengl3/main.cpp | 2 -- demo/sfml_opengl3/nuklear_sfml_gl3.h | 6 +++--- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/demo/sfml_opengl2/main.cpp b/demo/sfml_opengl2/main.cpp index 805c1f8..bc7104f 100644 --- a/demo/sfml_opengl2/main.cpp +++ b/demo/sfml_opengl2/main.cpp @@ -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 diff --git a/demo/sfml_opengl2/nuklear_sfml_gl2.h b/demo/sfml_opengl2/nuklear_sfml_gl2.h index 9649ec0..6857ecf 100644 --- a/demo/sfml_opengl2/nuklear_sfml_gl2.h +++ b/demo/sfml_opengl2/nuklear_sfml_gl2.h @@ -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; diff --git a/demo/sfml_opengl3/main.cpp b/demo/sfml_opengl3/main.cpp index 5dc2a6e..455387b 100644 --- a/demo/sfml_opengl3/main.cpp +++ b/demo/sfml_opengl3/main.cpp @@ -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 diff --git a/demo/sfml_opengl3/nuklear_sfml_gl3.h b/demo/sfml_opengl3/nuklear_sfml_gl3.h index 40b390e..fa2bc7e 100644 --- a/demo/sfml_opengl3/nuklear_sfml_gl3.h +++ b/demo/sfml_opengl3/nuklear_sfml_gl3.h @@ -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);