소스 검색

Reorganize external libraries - BREAKING CHANGE -

Moved all external libraries used by raylib to external folder inside
raylib src. Makefile has already been update and also the different
includes in raylib modules.
Ray 9 년 전
부모
커밋
29d505c98e
39개의 변경된 파일28개의 추가작업 그리고 27개의 파일을 삭제
  1. BIN
      external/glfw3/glfw3.dll
  2. BIN
      external/openal_soft/openal32.dll
  3. 15 15
      src/Makefile
  4. 3 3
      src/audio.c
  5. 2 2
      src/core.c
  6. 0 0
      src/external/glad.c
  7. 0 0
      src/external/glad.h
  8. 0 0
      src/external/glfw3/COPYING.txt
  9. 0 0
      src/external/glfw3/include/GLFW/glfw3.h
  10. 0 0
      src/external/glfw3/include/GLFW/glfw3native.h
  11. 0 0
      src/external/glfw3/lib/linux/libglfw3.a
  12. 0 0
      src/external/glfw3/lib/osx/libglfw.3.0.dylib
  13. 0 0
      src/external/glfw3/lib/osx/libglfw.3.dylib
  14. 0 0
      src/external/glfw3/lib/osx/libglfw.dylib
  15. 0 0
      src/external/glfw3/lib/win32/libglfw3.a
  16. 0 0
      src/external/glfw3/lib/win32/libglfw3dll.a
  17. 0 0
      src/external/jar_mod.h
  18. 0 0
      src/external/jar_xm.h
  19. 0 0
      src/external/openal_soft/COPYING
  20. 0 0
      src/external/openal_soft/include/AL/al.h
  21. 0 0
      src/external/openal_soft/include/AL/alc.h
  22. 0 0
      src/external/openal_soft/include/AL/alext.h
  23. 0 0
      src/external/openal_soft/include/AL/efx-creative.h
  24. 0 0
      src/external/openal_soft/include/AL/efx-presets.h
  25. 0 0
      src/external/openal_soft/include/AL/efx.h
  26. 0 0
      src/external/openal_soft/lib/win32/libOpenAL32.dll.a
  27. 0 0
      src/external/stb_image.h
  28. 0 0
      src/external/stb_image_resize.h
  29. 0 0
      src/external/stb_image_write.h
  30. 0 0
      src/external/stb_rect_pack.h
  31. 0 0
      src/external/stb_truetype.h
  32. 0 0
      src/external/stb_vorbis.c
  33. 0 0
      src/external/stb_vorbis.h
  34. 0 0
      src/external/tinfl.c
  35. BIN
      src/libraylib.bc
  36. 1 1
      src/rlgl.c
  37. 1 1
      src/text.c
  38. 3 3
      src/textures.c
  39. 3 2
      src/utils.c

BIN
external/glfw3/glfw3.dll


BIN
external/openal_soft/openal32.dll


+ 15 - 15
src/Makefile

@@ -81,14 +81,14 @@ CFLAGS = -O1 -Wall -std=gnu99 -fgnu89-inline -Wno-missing-braces
 
 # define any directories containing required header files
 ifeq ($(PLATFORM),PLATFORM_RPI)
-    INCLUDES = -I. -I/opt/vc/include -I/opt/vc/include/interface/vmcs_host/linux -I/opt/vc/include/interface/vcos/pthreads
+    INCLUDES = -I. -Iexternal -I/opt/vc/include -I/opt/vc/include/interface/vmcs_host/linux -I/opt/vc/include/interface/vcos/pthreads
 else
-    INCLUDES = -I. -I../src
-# external libraries headers
-# GLFW3
-    INCLUDES += -I../external/glfw3/include
-# OpenAL Soft
-    INCLUDES += -I../external/openal_soft/include
+# STB libraries and others
+    INCLUDES = -I. -Iexternal
+# GLFW3 library
+    INCLUDES += -Iexternal/glfw3/include
+# OpenAL Soft library
+    INCLUDES += -Iexternal/openal_soft/include
 endif
 
 # define all object files required
@@ -121,10 +121,6 @@ core.o: core.c
 rlgl.o: rlgl.c
 	$(CC) -c rlgl.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS)
 
-# compile glad module
-glad.o: glad.c
-	$(CC) -c glad.c $(CFLAGS) $(INCLUDES)
-
 # compile shapes module
 shapes.o: shapes.c
 	$(CC) -c shapes.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(GRAPHICS)
@@ -145,10 +141,6 @@ models.o: models.c
 audio.o: audio.c
 	$(CC) -c audio.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM)
 
-# compile stb_vorbis library
-stb_vorbis.o: stb_vorbis.c
-	$(CC) -c stb_vorbis.c -O1 $(INCLUDES) -D$(PLATFORM)
-
 # compile utils module
 utils.o: utils.c
 	$(CC) -c utils.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM)
@@ -161,6 +153,14 @@ camera.o: camera.c
 gestures.o: gestures.c
 	$(CC) -c gestures.c $(CFLAGS) $(INCLUDES) -D$(PLATFORM)
 
+# compile glad module
+glad.o: external/glad.c
+	$(CC) -c external/glad.c $(CFLAGS) $(INCLUDES)
+
+# compile stb_vorbis library
+stb_vorbis.o: external/stb_vorbis.c
+	$(CC) -c external/stb_vorbis.c -O1 $(INCLUDES) -D$(PLATFORM)
+
 # clean everything
 clean:
 ifeq ($(PLATFORM),PLATFORM_DESKTOP)

+ 3 - 3
src/audio.c

@@ -51,13 +51,13 @@
 #endif
 
 //#define STB_VORBIS_HEADER_ONLY
-#include "stb_vorbis.h"         // OGG loading functions
+#include "external/stb_vorbis.h"    // OGG loading functions
 
 #define JAR_XM_IMPLEMENTATION
-#include "jar_xm.h"             // XM loading functions
+#include "external/jar_xm.h"        // XM loading functions
 
 #define JAR_MOD_IMPLEMENTATION
-#include "jar_mod.h"            // MOD loading functions
+#include "external/jar_mod.h"       // MOD loading functions
 
 //----------------------------------------------------------------------------------
 // Defines and Macros

+ 2 - 2
src/core.c

@@ -55,11 +55,11 @@
 #include <errno.h>          // Macros for reporting and retrieving error conditions through error codes
 
 #if defined(PLATFORM_OCULUS)
-    #define PLATFORM_DESKTOP    // Enable PLATFORM_DESKTOP code-base
+    #define PLATFORM_DESKTOP      // Enable PLATFORM_DESKTOP code-base
 #endif
 
 #if defined(PLATFORM_DESKTOP)
-    #include "glad.h"           // GLAD library: Manage OpenGL headers and extensions
+    #include "external/glad.h"    // GLAD library: Manage OpenGL headers and extensions
 #endif
 
 #if defined(PLATFORM_OCULUS)

+ 0 - 0
src/glad.c → src/external/glad.c


+ 0 - 0
src/glad.h → src/external/glad.h


+ 0 - 0
external/glfw3/COPYING.txt → src/external/glfw3/COPYING.txt


+ 0 - 0
external/glfw3/include/GLFW/glfw3.h → src/external/glfw3/include/GLFW/glfw3.h


+ 0 - 0
external/glfw3/include/GLFW/glfw3native.h → src/external/glfw3/include/GLFW/glfw3native.h


+ 0 - 0
external/glfw3/lib/linux/libglfw3.a → src/external/glfw3/lib/linux/libglfw3.a


+ 0 - 0
external/glfw3/lib/osx/libglfw.3.0.dylib → src/external/glfw3/lib/osx/libglfw.3.0.dylib


+ 0 - 0
external/glfw3/lib/osx/libglfw.3.dylib → src/external/glfw3/lib/osx/libglfw.3.dylib


+ 0 - 0
external/glfw3/lib/osx/libglfw.dylib → src/external/glfw3/lib/osx/libglfw.dylib


+ 0 - 0
external/glfw3/lib/win32/libglfw3.a → src/external/glfw3/lib/win32/libglfw3.a


+ 0 - 0
external/glfw3/lib/win32/libglfw3dll.a → src/external/glfw3/lib/win32/libglfw3dll.a


+ 0 - 0
src/jar_mod.h → src/external/jar_mod.h


+ 0 - 0
src/jar_xm.h → src/external/jar_xm.h


+ 0 - 0
external/openal_soft/COPYING → src/external/openal_soft/COPYING


+ 0 - 0
external/openal_soft/include/AL/al.h → src/external/openal_soft/include/AL/al.h


+ 0 - 0
external/openal_soft/include/AL/alc.h → src/external/openal_soft/include/AL/alc.h


+ 0 - 0
external/openal_soft/include/AL/alext.h → src/external/openal_soft/include/AL/alext.h


+ 0 - 0
external/openal_soft/include/AL/efx-creative.h → src/external/openal_soft/include/AL/efx-creative.h


+ 0 - 0
external/openal_soft/include/AL/efx-presets.h → src/external/openal_soft/include/AL/efx-presets.h


+ 0 - 0
external/openal_soft/include/AL/efx.h → src/external/openal_soft/include/AL/efx.h


+ 0 - 0
external/openal_soft/lib/win32/libOpenAL32.dll.a → src/external/openal_soft/lib/win32/libOpenAL32.dll.a


+ 0 - 0
src/stb_image.h → src/external/stb_image.h


+ 0 - 0
src/stb_image_resize.h → src/external/stb_image_resize.h


+ 0 - 0
src/stb_image_write.h → src/external/stb_image_write.h


+ 0 - 0
src/stb_rect_pack.h → src/external/stb_rect_pack.h


+ 0 - 0
src/stb_truetype.h → src/external/stb_truetype.h


+ 0 - 0
src/stb_vorbis.c → src/external/stb_vorbis.c


+ 0 - 0
src/stb_vorbis.h → src/external/stb_vorbis.h


+ 0 - 0
src/tinfl.c → src/external/tinfl.c


BIN
src/libraylib.bc


+ 1 - 1
src/rlgl.c

@@ -48,7 +48,7 @@
     #ifdef __APPLE__ 
         #include <OpenGL/gl3.h>     // OpenGL 3 library for OSX
     #else
-        #include "glad.h"           // GLAD library, includes OpenGL headers
+        #include "external/glad.h"  // GLAD library, includes OpenGL headers
     #endif
 #endif
 

+ 1 - 1
src/text.c

@@ -34,7 +34,7 @@
 
 // Following libs are used on LoadTTF()
 #define STB_TRUETYPE_IMPLEMENTATION
-#include "stb_truetype.h"   // Required for: stbtt_BakeFontBitmap()
+#include "external/stb_truetype.h"   // Required for: stbtt_BakeFontBitmap()
 
 // Rectangle packing functions (not used at the moment)
 //#define STB_RECT_PACK_IMPLEMENTATION

+ 3 - 3
src/textures.c

@@ -40,12 +40,12 @@
                                 // NOTE: Includes Android fopen function map
 
 #define STB_IMAGE_IMPLEMENTATION
-#include "stb_image.h"          // Required for: stbi_load()
+#include "external/stb_image.h" // Required for: stbi_load()
                                 // NOTE: Used to read image data (multiple formats support)
 
 #define STB_IMAGE_RESIZE_IMPLEMENTATION
-#include "stb_image_resize.h"   // Required for: stbir_resize_uint8() 
-                                // NOTE: Used for image scaling on ImageResize()
+#include "external/stb_image_resize.h"  // Required for: stbir_resize_uint8() 
+                                        // NOTE: Used for image scaling on ImageResize()
 
 //----------------------------------------------------------------------------------
 // Defines and Macros

+ 3 - 2
src/utils.c

@@ -42,10 +42,11 @@
 
 #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI)
     #define STB_IMAGE_WRITE_IMPLEMENTATION
-    #include "stb_image_write.h"    // Required for: stbi_write_png()
+    #include "external/stb_image_write.h"    // Required for: stbi_write_png()
 #endif
 
-#include "tinfl.c"
+#include "external/tinfl.c"         // Required for: tinfl_decompress_mem_to_mem()
+                                    // NOTE: Deflate algorythm data decompression
 
 //----------------------------------------------------------------------------------
 // Global Variables Definition