From fb474874db084d6ba7009c148fe8a9fcfdd3034e Mon Sep 17 00:00:00 2001 From: b-aaz <85005689+b-aaz@users.noreply.github.com> Date: Sat, 20 Jan 2024 16:16:45 +0330 Subject: [PATCH] Added required includes to the platform headers . Added missing include decelerations and in one case removed an unnecessary one form the platform headers in the demo/ directory . --- demo/allegro5/nuklear_allegro5.h | 1 + demo/d3d11/nuklear_d3d11.h | 1 + demo/d3d12/nuklear_d3d12.h | 1 + demo/d3d9/nuklear_d3d9.h | 1 + demo/gdi/nuklear_gdi.h | 2 +- demo/gdi_native_nuklear/nuklear_gdi.h | 2 +- demo/glfw_opengl2/nuklear_glfw_gl2.h | 2 ++ demo/glfw_opengl3/nuklear_glfw_gl3.h | 3 +++ demo/glfw_opengl4/nuklear_glfw_gl4.h | 3 +++ demo/glfw_vulkan/nuklear_glfw_vulkan.h | 2 ++ demo/glfw_vulkan/src/nuklear_glfw_vulkan.in.h | 2 ++ demo/sdl2surface_rawfb/sdl2surface_rawfb.h | 4 ++++ demo/sdl_opengl2/nuklear_sdl_gl2.h | 2 ++ demo/sdl_opengl3/nuklear_sdl_gl3.h | 2 ++ demo/sdl_opengles2/nuklear_sdl_gles2.h | 3 ++- demo/sdl_renderer/nuklear_sdl_renderer.h | 4 ++-- demo/sfml_opengl2/nuklear_sfml_gl2.h | 2 ++ demo/sfml_opengl3/nuklear_sfml_gl3.h | 3 ++- demo/wayland_rawfb/nuklear_raw_wayland.h | 4 ++++ demo/x11/nuklear_xlib.h | 3 +++ demo/x11_opengl3/nuklear_xlib_gl3.h | 1 + demo/x11_rawfb/nuklear_rawfb.h | 4 ++++ demo/x11_rawfb/nuklear_xlib.h | 3 +++ demo/x11_xft/nuklear_xlib.h | 3 +++ 24 files changed, 52 insertions(+), 6 deletions(-) diff --git a/demo/allegro5/nuklear_allegro5.h b/demo/allegro5/nuklear_allegro5.h index 0e980c7cc..0e72f16a4 100644 --- a/demo/allegro5/nuklear_allegro5.h +++ b/demo/allegro5/nuklear_allegro5.h @@ -46,6 +46,7 @@ NK_API void nk_allegro5_font_set_font(NkAllegro5Font *font); * =============================================================== */ #ifdef NK_ALLEGRO5_IMPLEMENTATION +#include #ifndef NK_ALLEGRO5_TEXT_MAX #define NK_ALLEGRO5_TEXT_MAX 256 diff --git a/demo/d3d11/nuklear_d3d11.h b/demo/d3d11/nuklear_d3d11.h index 27fa2c1f3..c62be5685 100644 --- a/demo/d3d11/nuklear_d3d11.h +++ b/demo/d3d11/nuklear_d3d11.h @@ -41,6 +41,7 @@ NK_API void nk_d3d11_shutdown(void); #define COBJMACROS #include +#include #include #include #include diff --git a/demo/d3d12/nuklear_d3d12.h b/demo/d3d12/nuklear_d3d12.h index 5b86ea1fd..03560a213 100644 --- a/demo/d3d12/nuklear_d3d12.h +++ b/demo/d3d12/nuklear_d3d12.h @@ -88,6 +88,7 @@ NK_API void nk_d3d12_shutdown(void); #define COBJMACROS #include +#include #include #include #include diff --git a/demo/d3d9/nuklear_d3d9.h b/demo/d3d9/nuklear_d3d9.h index f9676783e..8af027f3a 100644 --- a/demo/d3d9/nuklear_d3d9.h +++ b/demo/d3d9/nuklear_d3d9.h @@ -41,6 +41,7 @@ NK_API void nk_d3d9_shutdown(void); #define COBJMACROS #include +#include #include #include diff --git a/demo/gdi/nuklear_gdi.h b/demo/gdi/nuklear_gdi.h index 6bbedb632..ff2ff1964 100644 --- a/demo/gdi/nuklear_gdi.h +++ b/demo/gdi/nuklear_gdi.h @@ -38,7 +38,7 @@ NK_API void nk_gdi_set_font(GdiFont *font); * =============================================================== */ #ifdef NK_GDI_IMPLEMENTATION - +#include #include #include diff --git a/demo/gdi_native_nuklear/nuklear_gdi.h b/demo/gdi_native_nuklear/nuklear_gdi.h index 5c2f1f803..aa91740f5 100644 --- a/demo/gdi_native_nuklear/nuklear_gdi.h +++ b/demo/gdi_native_nuklear/nuklear_gdi.h @@ -50,7 +50,7 @@ NK_API void nk_gdi_set_font(nk_gdi_ctx gdi, GdiFont* font); * =============================================================== */ #ifdef NK_GDI_IMPLEMENTATION - +#include #include #include diff --git a/demo/glfw_opengl2/nuklear_glfw_gl2.h b/demo/glfw_opengl2/nuklear_glfw_gl2.h index fb8b31e5f..d74b4f21d 100644 --- a/demo/glfw_opengl2/nuklear_glfw_gl2.h +++ b/demo/glfw_opengl2/nuklear_glfw_gl2.h @@ -40,6 +40,8 @@ NK_API void nk_gflw3_scroll_callback(GLFWwindow *win, double xof * =============================================================== */ #ifdef NK_GLFW_GL2_IMPLEMENTATION +#include +#include #ifndef NK_GLFW_TEXT_MAX #define NK_GLFW_TEXT_MAX 256 diff --git a/demo/glfw_opengl3/nuklear_glfw_gl3.h b/demo/glfw_opengl3/nuklear_glfw_gl3.h index cef59e58e..8ba361c87 100644 --- a/demo/glfw_opengl3/nuklear_glfw_gl3.h +++ b/demo/glfw_opengl3/nuklear_glfw_gl3.h @@ -78,6 +78,9 @@ NK_API void nk_glfw3_mouse_button_callback(GLFWwindow *win, int * =============================================================== */ #ifdef NK_GLFW_GL3_IMPLEMENTATION +#include +#include +#include #ifndef NK_GLFW_DOUBLE_CLICK_LO #define NK_GLFW_DOUBLE_CLICK_LO 0.02 diff --git a/demo/glfw_opengl4/nuklear_glfw_gl4.h b/demo/glfw_opengl4/nuklear_glfw_gl4.h index 781bfc3c6..b4df9900f 100644 --- a/demo/glfw_opengl4/nuklear_glfw_gl4.h +++ b/demo/glfw_opengl4/nuklear_glfw_gl4.h @@ -50,6 +50,9 @@ NK_API void nk_glfw3_destroy_texture(int tex_index); */ #ifdef NK_GLFW_GL4_IMPLEMENTATION #undef NK_GLFW_GL4_IMPLEMENTATION +#include +#include +#include #ifndef NK_GLFW_TEXT_MAX #define NK_GLFW_TEXT_MAX 256 diff --git a/demo/glfw_vulkan/nuklear_glfw_vulkan.h b/demo/glfw_vulkan/nuklear_glfw_vulkan.h index f41187226..3c1e35817 100644 --- a/demo/glfw_vulkan/nuklear_glfw_vulkan.h +++ b/demo/glfw_vulkan/nuklear_glfw_vulkan.h @@ -247,6 +247,7 @@ unsigned char nuklearshaders_nuklear_frag_spv[] = { }; unsigned int nuklearshaders_nuklear_frag_spv_len = 860; +#include #include #include #define GLFW_INCLUDE_VULKAN @@ -294,6 +295,7 @@ NK_API void nk_glfw3_mouse_button_callback(GLFWwindow *win, int button, */ #ifdef NK_GLFW_VULKAN_IMPLEMENTATION #undef NK_GLFW_VULKAN_IMPLEMENTATION +#include #ifndef NK_GLFW_TEXT_MAX #define NK_GLFW_TEXT_MAX 256 diff --git a/demo/glfw_vulkan/src/nuklear_glfw_vulkan.in.h b/demo/glfw_vulkan/src/nuklear_glfw_vulkan.in.h index 78a1f6c76..ea86e5b53 100644 --- a/demo/glfw_vulkan/src/nuklear_glfw_vulkan.in.h +++ b/demo/glfw_vulkan/src/nuklear_glfw_vulkan.in.h @@ -71,6 +71,8 @@ NK_API void nk_glfw3_mouse_button_callback(GLFWwindow *win, int button, */ #ifdef NK_GLFW_VULKAN_IMPLEMENTATION #undef NK_GLFW_VULKAN_IMPLEMENTATION +#include +#include #ifndef NK_GLFW_TEXT_MAX #define NK_GLFW_TEXT_MAX 256 diff --git a/demo/sdl2surface_rawfb/sdl2surface_rawfb.h b/demo/sdl2surface_rawfb/sdl2surface_rawfb.h index 6e2eb59c3..7b4b1cfb2 100644 --- a/demo/sdl2surface_rawfb/sdl2surface_rawfb.h +++ b/demo/sdl2surface_rawfb/sdl2surface_rawfb.h @@ -49,6 +49,10 @@ void nk_sdlsurface_shutdown(struct sdlsurface_context *sdlsurfa * =============================================================== */ #ifdef NK_SDLSURFACE_IMPLEMENTATION +#include +#include +#include + struct sdlsurface_context { struct nk_context ctx; struct nk_rect scissors; diff --git a/demo/sdl_opengl2/nuklear_sdl_gl2.h b/demo/sdl_opengl2/nuklear_sdl_gl2.h index 0c6a2fb80..819723c83 100644 --- a/demo/sdl_opengl2/nuklear_sdl_gl2.h +++ b/demo/sdl_opengl2/nuklear_sdl_gl2.h @@ -30,6 +30,8 @@ NK_API void nk_sdl_shutdown(void); * =============================================================== */ #ifdef NK_SDL_GL2_IMPLEMENTATION +#include +#include struct nk_sdl_device { struct nk_buffer cmds; diff --git a/demo/sdl_opengl3/nuklear_sdl_gl3.h b/demo/sdl_opengl3/nuklear_sdl_gl3.h index cac862980..4e7df6bb4 100644 --- a/demo/sdl_opengl3/nuklear_sdl_gl3.h +++ b/demo/sdl_opengl3/nuklear_sdl_gl3.h @@ -36,6 +36,8 @@ NK_API void nk_sdl_device_create(void); */ #ifdef NK_SDL_GL3_IMPLEMENTATION +#include +#include #include struct nk_sdl_device { diff --git a/demo/sdl_opengles2/nuklear_sdl_gles2.h b/demo/sdl_opengles2/nuklear_sdl_gles2.h index 595d7a7b3..39a444dbd 100644 --- a/demo/sdl_opengles2/nuklear_sdl_gles2.h +++ b/demo/sdl_opengles2/nuklear_sdl_gles2.h @@ -38,7 +38,8 @@ NK_API void nk_sdl_device_create(void); * =============================================================== */ #ifdef NK_SDL_GLES2_IMPLEMENTATION - +#include +#include #include struct nk_sdl_device { diff --git a/demo/sdl_renderer/nuklear_sdl_renderer.h b/demo/sdl_renderer/nuklear_sdl_renderer.h index 672b81bc8..fbea3cf64 100644 --- a/demo/sdl_renderer/nuklear_sdl_renderer.h +++ b/demo/sdl_renderer/nuklear_sdl_renderer.h @@ -39,8 +39,8 @@ NK_API void nk_sdl_shutdown(void); * =============================================================== */ #ifdef NK_SDL_RENDERER_IMPLEMENTATION - -#include +#include +#include struct nk_sdl_device { struct nk_buffer cmds; diff --git a/demo/sfml_opengl2/nuklear_sfml_gl2.h b/demo/sfml_opengl2/nuklear_sfml_gl2.h index f168babd7..56774053e 100644 --- a/demo/sfml_opengl2/nuklear_sfml_gl2.h +++ b/demo/sfml_opengl2/nuklear_sfml_gl2.h @@ -31,6 +31,8 @@ NK_API void nk_sfml_shutdown(void); * =============================================================== */ #ifdef NK_SFML_GL2_IMPLEMENTATION +#include +#include struct nk_sfml_device { struct nk_buffer cmds; diff --git a/demo/sfml_opengl3/nuklear_sfml_gl3.h b/demo/sfml_opengl3/nuklear_sfml_gl3.h index 286cfc1cf..c58bde722 100644 --- a/demo/sfml_opengl3/nuklear_sfml_gl3.h +++ b/demo/sfml_opengl3/nuklear_sfml_gl3.h @@ -38,7 +38,8 @@ NK_API void nk_sfml_device_destroy(void); * =============================================================== */ #ifdef NK_SFML_GL3_IMPLEMENTATION - +#include +#include #include struct nk_sfml_device { diff --git a/demo/wayland_rawfb/nuklear_raw_wayland.h b/demo/wayland_rawfb/nuklear_raw_wayland.h index 49082c556..1a465fcdc 100644 --- a/demo/wayland_rawfb/nuklear_raw_wayland.h +++ b/demo/wayland_rawfb/nuklear_raw_wayland.h @@ -1,6 +1,10 @@ #ifndef NK_RAW_WAYLAND_H_ #define NK_RAW_WAYLAND_H_ +#include +#include +#include + #define WIDTH 800 #define HEIGHT 600 diff --git a/demo/x11/nuklear_xlib.h b/demo/x11/nuklear_xlib.h index 9b3a861ee..28fb4ccce 100644 --- a/demo/x11/nuklear_xlib.h +++ b/demo/x11/nuklear_xlib.h @@ -44,6 +44,9 @@ NK_API void nk_xfont_del(Display *dpy, XFont *font); * =============================================================== */ #ifdef NK_XLIB_IMPLEMENTATION +#include +#include +#include #include #include #include diff --git a/demo/x11_opengl3/nuklear_xlib_gl3.h b/demo/x11_opengl3/nuklear_xlib_gl3.h index 9dd0181d6..c343bb5d2 100644 --- a/demo/x11_opengl3/nuklear_xlib_gl3.h +++ b/demo/x11_opengl3/nuklear_xlib_gl3.h @@ -32,6 +32,7 @@ NK_API void nk_x11_device_destroy(void); * =============================================================== */ #ifdef NK_XLIB_GL3_IMPLEMENTATION +#include #include #include #include diff --git a/demo/x11_rawfb/nuklear_rawfb.h b/demo/x11_rawfb/nuklear_rawfb.h index ce842228b..6aece67c5 100644 --- a/demo/x11_rawfb/nuklear_rawfb.h +++ b/demo/x11_rawfb/nuklear_rawfb.h @@ -55,6 +55,10 @@ NK_API void nk_rawfb_resize_fb(struct rawfb_context *rawfb, voi * =============================================================== */ #ifdef NK_RAWFB_IMPLEMENTATION +#include +#include +#include + struct rawfb_image { void *pixels; int w, h, pitch; diff --git a/demo/x11_rawfb/nuklear_xlib.h b/demo/x11_rawfb/nuklear_xlib.h index 0d23135d3..3174e2411 100644 --- a/demo/x11_rawfb/nuklear_xlib.h +++ b/demo/x11_rawfb/nuklear_xlib.h @@ -49,6 +49,9 @@ NK_API void nk_xlib_shutdown(void); * =============================================================== */ #ifdef NK_XLIBSHM_IMPLEMENTATION +#include +#include +#include #include #include #include diff --git a/demo/x11_xft/nuklear_xlib.h b/demo/x11_xft/nuklear_xlib.h index 9526e3e33..f0fb07498 100644 --- a/demo/x11_xft/nuklear_xlib.h +++ b/demo/x11_xft/nuklear_xlib.h @@ -48,6 +48,9 @@ NK_API void nk_xfont_del(Display *dpy, XFont *font); * =============================================================== */ #ifdef NK_XLIB_IMPLEMENTATION +#include +#include +#include #include #include #include