hs

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | LICENSE

hs_nuklear.h (1215B)


      1 #ifndef HS_NUKLEAR_H_
      2 #include "hs_graphics.h"
      3 
      4 #define NK_INCLUDE_FIXED_TYPES
      5 #define NK_INCLUDE_STANDARD_IO
      6 #define NK_INCLUDE_STANDARD_VARARGS
      7 #define NK_INCLUDE_DEFAULT_ALLOCATOR
      8 #define NK_INCLUDE_VERTEX_BUFFER_OUTPUT
      9 #define NK_INCLUDE_FONT_BAKING
     10 #define NK_INCLUDE_DEFAULT_FONT
     11 #define NK_IMPLEMENTATION
     12 #define NK_GLFW_GL3_IMPLEMENTATION
     13 #define NK_KEYSTATE_BASED_INPUT
     14 #include "external/nuklear/nuklear.h"
     15 #include "external/nuklear_glfw_gl3.h"
     16 
     17 #ifndef NO_STBI
     18 extern struct nk_image hs_nk_image_load(const char *filename);
     19 extern struct nk_image hs_nk_image_load_size_info(const char *filename, int* width, int* height);
     20 #endif // NO_STBI
     21 
     22 #ifdef HS_IMPL
     23 #define HS_NUKLEAR_IMPL
     24 #endif //HS_IMPL
     25 
     26 #ifdef HS_NUKLEAR_IMPL
     27 
     28 #ifndef NO_STBI
     29 inline struct nk_image
     30 hs_nk_image_load(const char *filename)
     31 {
     32     return nk_image_id(hs_tex2d_create(filename, GL_RGBA, GL_CLAMP_TO_EDGE, GL_NEAREST));
     33 }
     34 
     35 inline struct nk_image
     36 hs_nk_image_load_size_info(const char *filename, int* width, int* height)
     37 {
     38     return nk_image_id(hs_tex2d_create_size_info(filename, GL_RGBA, GL_CLAMP_TO_EDGE, GL_NEAREST, width, height));
     39 }
     40 #endif // NO_STBI
     41 
     42 #endif // HS_NUKLEAR_IMPL
     43 
     44 #define HS_NUKLEAR_H_
     45 #endif // HS_NUKLEAR_H_