Browse Source

init data in image, meson cleanup

Kajetan Johannes Hammerle 2 years ago
parent
commit
c9721ffa91
3 changed files with 8 additions and 2 deletions
  1. 3 0
      images/ImageReader.cpp
  2. 1 0
      images/ImageReader.h
  3. 4 2
      meson.build

+ 3 - 0
images/ImageReader.cpp

@@ -11,6 +11,9 @@ static void cleanState(LodePNGState& state) {
     lodepng_state_cleanup(&state);
 }
 
+ImageReader::Image::Image() : data(nullptr) {
+}
+
 Error ImageReader::load(Image& image, const char* path) {
     Cleaner<ColorChannel*, cleanRawData> rawData(nullptr);
     size_t rawSize;

+ 1 - 0
images/ImageReader.h

@@ -12,6 +12,7 @@ namespace ImageReader {
         }
 
     public:
+        Image();
         Cleaner<ColorChannel*, clean> data;
         unsigned int width;
         unsigned int height;

+ 4 - 2
meson.build

@@ -68,10 +68,12 @@ args = compiler.get_supported_arguments(['-Wall', '-Wextra', '-pedantic', '-Werr
 
 cmake = import('cmake')
 glfw_proj = cmake.subproject('glfw')
+glfw_includes = glfw_proj.include_directories('glfw')
 glfw_dep = glfw_proj.dependency('glfw')
 
 glew_proj = subproject('glew', default_options: 'default_library=static')
-glew_dep = glew_proj.get_variable('glew_dep')
+glew_includes = glew_proj.get_variable('glew_include')
+glew_dep = dependency('glew')
 
 thread_dep = dependency('threads', static: true)
 gl_dep = dependency('GL')
@@ -81,7 +83,7 @@ winmm_dep = compiler.find_library('winmm', required: false)
 glu_dep = compiler.find_library('glu32', required: false)
 dl_dep = compiler.find_library('dl', required: false)
 
-libgamingcore_include = include_directories('.', 'subprojects/glfw/include')
+libgamingcore_include = ['.', glfw_includes, glew_includes]
 
 libgamingcore = static_library('gamingcore', 
     sources: src,