Selaa lähdekoodia

split all_vendor.odin

create 3 files:
- all_vendor.odin : no specific OS
- all_vendor_directx.odin : directx vendor, windows-only
- all_vendor_stb.odin : stb vendor, windows and linux only

stb could technically be used on others OS. but it is shipped upstream as set of c-files without unified library name.
Sébastien Marie 3 vuotta sitten
vanhempi
commit
562901aedf

+ 1 - 22
examples/all/all_vendor.odin

@@ -1,4 +1,3 @@
-//+build windows
 package all
 
 import botan     "vendor:botan"
@@ -16,24 +15,12 @@ import IMG    "vendor:sdl2/image"
 import MIX    "vendor:sdl2/mixer"
 import TTF    "vendor:sdl2/ttf"
 
-import stb_easy_font "vendor:stb/easy_font"
-import stbi          "vendor:stb/image"
-import stbrp         "vendor:stb/rect_pack"
-import stbtt         "vendor:stb/truetype"
-import stb_vorbis    "vendor:stb/vorbis"
-
 import vk "vendor:vulkan"
 
-import D3D11 "vendor:directx/d3d11"
-import D3D12 "vendor:directx/d3d12"
-import DXGI  "vendor:directx/dxgi"
-
-// note these are technicaly darwin only but they are added to aid with documentation generation
 import NS  "vendor:darwin/Foundation"
 import MTL "vendor:darwin/Metal"
 import CA  "vendor:darwin/QuartzCore"
 
-
 _ :: botan
 _ :: ENet
 _ :: gl
@@ -47,15 +34,7 @@ _ :: SDLNet
 _ :: IMG
 _ :: MIX
 _ :: TTF
-_ :: stb_easy_font
-_ :: stbi
-_ :: stbrp
-_ :: stbtt
-_ :: stb_vorbis
 _ :: vk
-_ :: D3D11
-_ :: D3D12
-_ :: DXGI
 _ :: NS
 _ :: MTL
-_ :: CA
+_ :: CA

+ 10 - 0
examples/all/all_vendor_directx.odin

@@ -0,0 +1,10 @@
+//+build windows
+package all
+
+import D3D11 "vendor:directx/d3d11"
+import D3D12 "vendor:directx/d3d12"
+import DXGI  "vendor:directx/dxgi"
+
+_ :: D3D11
+_ :: D3D12
+_ :: DXGI

+ 15 - 0
examples/all/all_vendor_stl.odin

@@ -0,0 +1,15 @@
+//+build windows, linux
+package all
+
+import stb_easy_font "vendor:stb/easy_font"
+import stbi          "vendor:stb/image"
+import stbrp         "vendor:stb/rect_pack"
+import stbtt         "vendor:stb/truetype"
+import stb_vorbis    "vendor:stb/vorbis"
+
+_ :: stb_easy_font
+_ :: stbi
+_ :: stbrp
+_ :: stbtt
+_ :: stb_vorbis
+