Skip to content

Commit 2cbf754

Browse files
committed
.
1 parent 8182e60 commit 2cbf754

File tree

80 files changed

+810
-107
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+810
-107
lines changed

Base/.vscode/Base.code-workspace

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@
1212
"**/.DS_Store": true,
1313
"**/Thumbs.db": true,
1414
// VSCODE FOLDERS --------
15-
"**/.vscode": true,
15+
"**/.vscode": false,
1616
"**/.code-workspace": true,
1717
// ZIG FOLDERS --------
18-
"**/zig-cache": true
18+
"**/zig-cache": true,
19+
"**/.zig-cache": true
1920
},
2021
"search.exclude": {
2122
"**/node_modules": true,
@@ -185,6 +186,11 @@
185186
"zig.zls.checkForUpdate": false,
186187
"zig.zls.enableInlayHints": false,
187188
"zig.zls.preferAstCheckAsChildProcess": false,
189+
"files.associations": {
190+
"raylib.h": "c",
191+
"rcamera.h": "c",
192+
"raymath.h": "c"
193+
},
188194
},
189195
"extensions": {
190196
"recommendations": [

Base/tools/buildReleaseStrip.bat

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
@ECHO OFF
2+
3+
REM Check if Tools folder, then go up to parent folder
4+
SET FolderName=
5+
FOR %%* IN (%CD%) DO SET FolderName=%%~n*
6+
IF /I "%FolderName%" == "tools" (
7+
FOR %%* IN (%CD%\..) DO SET FolderName=%%~n*
8+
CD ..
9+
)
10+
11+
REM EXTRA ARGS SHORTCUT
12+
REM ===================
13+
REM Linking system libraries (note: -l and library name all together):
14+
REM -lSDL2 -lOpenGL32
15+
REM Adding libraries DLL+LIB folders (note: -L SPACE "Dir"):
16+
REM -L %CD%\lib\SDL2
17+
REM Adding cImport .H include folders (note: -I"Dir", without spaces):
18+
REM -I%CD%\lib\microui -I%CD%\lib\SDL2\include
19+
REM
20+
REM Full extra_args sample of a project that use SDL3 + OpenGL :
21+
REM SET extra_args=-lSDL3 -lOpenGL32 -L "%CD%\lib\SDL3" -I"%CD%" -I"%CD%\lib" -I"%CD%\lib\SDL3"
22+
23+
SET extra_args=
24+
25+
26+
REM AddCSource
27+
REM ==========
28+
REM If your project use C Source Files, add here the list of files you want to add to your build.
29+
REM
30+
REM SET addCSourceFile="%CD%\lib\SDL3\glad.c"
31+
32+
SET addCSourceFile=
33+
34+
IF NOT EXIST %CD%\bin\ReleaseStrip (
35+
MKDIR %CD%\bin\ReleaseStrip
36+
)
37+
IF NOT EXIST %CD%\bin\ReleaseStrip\obj (
38+
MKDIR %CD%\bin\ReleaseStrip\obj
39+
)
40+
41+
REM GET CURRENT FOLDER NAME
42+
SET ProjectName=%FolderName%
43+
44+
SET rcmd=
45+
IF EXIST "*.rc" (
46+
SET rcmd=-rcflags /c65001 -- %CD%\%ProjectName%.rc
47+
)
48+
49+
SET singlethread=-fsingle-threaded
50+
SET libc=
51+
FINDSTR /L linkLibC build.zig > NUL && (
52+
SET libc=-lc
53+
)
54+
SET libcpp=
55+
FINDSTR /L linkLibCpp build.zig > NUL && (
56+
SET libcpp=-lc++
57+
SET singlethread=
58+
)
59+
60+
REM OUTPUT TO ZIG_REPORT.TXT
61+
> bin/ReleaseStrip/obj/zig_report.txt (
62+
zig build-exe -O ReleaseSmall %rcmd% %libc% %libcpp% %singlethread% -fstrip --color off -femit-bin=bin/ReleaseStrip/%ProjectName%.exe -femit-asm=bin/ReleaseStrip/obj/%ProjectName%.s -femit-llvm-ir=bin/ReleaseStrip/obj/%ProjectName%.ll -femit-llvm-bc=bin/ReleaseStrip/obj/%ProjectName%.bc -femit-h=bin/ReleaseStrip/obj/%ProjectName%.h -ftime-report -fstack-report %extra_args% --name %ProjectName% main.zig %addCSourceFile%
63+
) 2>&1
64+
65+
REM OUTPUT BUILD COMMAND LINE TO ZIG_BUILD_CMD.TXT
66+
> bin/ReleaseStrip/obj/zig_build_cmd.txt (
67+
zig build-exe -O ReleaseSmall %rcmd% %libc% %libcpp% %singlethread% -fstrip --color off -femit-bin=bin/ReleaseStrip/%ProjectName%.exe -femit-asm=bin/ReleaseStrip/obj/%ProjectName%.s -femit-llvm-ir=bin/ReleaseStrip/obj/%ProjectName%.ll -femit-llvm-bc=bin/ReleaseStrip/obj/%ProjectName%.bc -femit-h=bin/ReleaseStrip/obj/%ProjectName%.h -ftime-report -fstack-report %extra_args% --name %ProjectName% main.zig %addCSourceFile%
68+
) 2>&1
69+
70+
IF EXIST "%CD%\bin\ReleaseStrip\%ProjectName%.exe.obj" (
71+
MOVE %CD%\bin\ReleaseStrip\%ProjectName%.exe.obj %CD%\bin\ReleaseStrip\obj > NUL
72+
)
73+
74+
ECHO.
75+
ECHO Done!
76+
REM PAUSE

BaseDX11/.vscode/BaseDX11.code-workspace

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@
1212
"**/.DS_Store": true,
1313
"**/Thumbs.db": true,
1414
// VSCODE FOLDERS --------
15-
"**/.vscode": true,
15+
"**/.vscode": false,
1616
"**/.code-workspace": true,
1717
// ZIG FOLDERS --------
18-
"**/zig-cache": true
18+
"**/zig-cache": true,
19+
"**/.zig-cache": true
1920
},
2021
"search.exclude": {
2122
"**/node_modules": true,
@@ -185,6 +186,11 @@
185186
"zig.zls.checkForUpdate": false,
186187
"zig.zls.enableInlayHints": false,
187188
"zig.zls.preferAstCheckAsChildProcess": false,
189+
"files.associations": {
190+
"raylib.h": "c",
191+
"rcamera.h": "c",
192+
"raymath.h": "c"
193+
},
188194
},
189195
"extensions": {
190196
"recommendations": [

BaseDX11/.vscode/tasks.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,35 +43,35 @@
4343
},
4444
{
4545
"label": "Zig: Run main",
46-
"args": [ "run", "-lc++", "-lgdi32", "-ldwmapi", "-ld3d11", "-ld3dcompiler_47", "main.zig" ],
46+
"args": [ "run", "-lc++", "-lgdi32", "-ldwmapi", "-ld3d11", "-ld3dcompiler_47", "-I.", "main.zig" ],
4747
"detail": "zig run main.zig",
4848
"command": "zig", "type": "shell", "options": { "cwd": "${workspaceRoot}" }, "group": { "kind": "none", "isDefault": true },
4949
"presentation": { "group": "launch", "echo": true, "reveal": "always", "focus": false, "panel": "shared", "showReuseMessage": false, "clear": true, "close": false }, "problemMatcher": []
5050
},
5151
{
5252
"label": "Zig: Run main (With Args)",
53-
"args": [ "run", "-lc++", "-lgdi32", "-ldwmapi", "-ld3d11", "-ld3dcompiler_47", "main.zig", "--", "ArgsForYourProgram" ],
53+
"args": [ "run", "-lc++", "-lgdi32", "-ldwmapi", "-ld3d11", "-ld3dcompiler_47", "-I.", "main.zig", "--", "ArgsForYourProgram" ],
5454
"detail": "zig run main.zig -- ArgsForYourProgram",
5555
"command": "zig", "type": "shell", "options": { "cwd": "${workspaceRoot}" }, "group": { "kind": "none", "isDefault": false },
5656
"presentation": { "group": "launch", "echo": true, "reveal": "always", "focus": false, "panel": "shared", "showReuseMessage": false, "clear": true, "close": false }, "problemMatcher": []
5757
},
5858
{
5959
"label": "Zig: Run main (Fast)",
60-
"args": [ "run", "-lc++", "-lgdi32", "-ldwmapi", "-ld3d11", "-ld3dcompiler_47", "main.zig", "-O", "ReleaseFast" ],
60+
"args": [ "run", "-lc++", "-lgdi32", "-ldwmapi", "-ld3d11", "-ld3dcompiler_47", "-I.", "main.zig", "-O", "ReleaseFast" ],
6161
"detail": "zig run main.zig -O ReleaseFast",
6262
"command": "zig", "type": "shell", "options": { "cwd": "${workspaceRoot}" }, "group": { "kind": "none", "isDefault": false },
6363
"presentation": { "group": "launch", "echo": true, "reveal": "always", "focus": false, "panel": "shared", "showReuseMessage": false, "clear": true, "close": false }, "problemMatcher": []
6464
},
6565
{
6666
"label": "Zig: Run main (Safe)",
67-
"args": [ "run", "-lc++", "-lgdi32", "-ldwmapi", "-ld3d11", "-ld3dcompiler_47", "main.zig", "-O", "ReleaseSafe" ],
67+
"args": [ "run", "-lc++", "-lgdi32", "-ldwmapi", "-ld3d11", "-ld3dcompiler_47", "-I.", "main.zig", "-O", "ReleaseSafe" ],
6868
"detail": "zig run main.zig -O ReleaseSafe",
6969
"command": "zig", "type": "shell", "options": { "cwd": "${workspaceRoot}" }, "group": { "kind": "none", "isDefault": false },
7070
"presentation": { "group": "launch", "echo": true, "reveal": "always", "focus": false, "panel": "shared", "showReuseMessage": false, "clear": true, "close": false }, "problemMatcher": []
7171
},
7272
{
7373
"label": "Zig: Run main (Small)",
74-
"args": [ "run", "-lc++", "-lgdi32", "-ldwmapi", "-ld3d11", "-ld3dcompiler_47", "main.zig", "-O", "ReleaseSmall" ],
74+
"args": [ "run", "-lc++", "-lgdi32", "-ldwmapi", "-ld3d11", "-ld3dcompiler_47", "-I.", "main.zig", "-O", "ReleaseSmall" ],
7575
"detail": "zig run main.zig -O ReleaseSmall",
7676
"command": "zig", "type": "shell", "options": { "cwd": "${workspaceRoot}" }, "group": { "kind": "none", "isDefault": false },
7777
"presentation": { "group": "launch", "echo": true, "reveal": "always", "focus": false, "panel": "shared", "showReuseMessage": false, "clear": true, "close": false }, "problemMatcher": []
@@ -92,7 +92,7 @@
9292
},
9393
{
9494
"label": "Zig: Docs",
95-
"args": [ "run", "-femit-docs", "main.zig" ],
95+
"args": [ "run", "-femit-docs", "-I.", "main.zig" ],
9696
"detail": "Generate docs from source comments.",
9797
"command": "zig", "type": "shell", "options": { "cwd": "${workspaceRoot}" }, "group": { "kind": "none", "isDefault": false },
9898
"presentation": { "group": "docs", "echo": true, "reveal": "always", "focus": false, "panel": "shared", "showReuseMessage": false, "clear": true, "close": false }, "problemMatcher": []

BaseDX11/build.zig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ pub fn build(b: *std.Build) void {
2424
exe.linkSystemLibrary("d3d11");
2525
exe.linkSystemLibrary("d3dcompiler_47");
2626

27+
exe.addIncludePath( b.path(".") );
2728
exe.addIncludePath( b.path("lib/DX11") );
2829
b.installBinFile("shaders.hlsl", "shaders.hlsl");
2930

BaseDX11/main.zig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
//!zig-autodoc-section: BaseDX11.Main
2+
//! BaseDX11//main.zig :
3+
//! Template using DirectX 11.
4+
// Build using Zig 0.13.0
5+
16
const std = @import("std");
27
const win = struct {
38
usingnamespace std.os.windows;

BaseDX11/tools/buildReleaseStrip.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ REM
2020
REM Full extra_args sample of a project that use SDL2 + OpenGL + microui :
2121
REM SET extra_args=-lSDL2 -lOpenGL32 -L "%CD%\lib\SDL2" -I "%CD%\lib\microui" -I "%CD%\lib\SDL2\include"
2222

23-
SET extra_args=-lgdi32 -ldwmapi -ld3d11 -ld3dcompiler_47 -I "%CD%\lib\DX11"
23+
SET extra_args=-lgdi32 -ldwmapi -ld3d11 -ld3dcompiler_47 -I"%CD%" -I"%CD%\lib\DX11"
2424

2525

2626
REM AddCSource
@@ -69,4 +69,4 @@ IF EXIST "%CD%\bin\ReleaseStrip\%ProjectName%.exe.obj" (
6969

7070
ECHO.
7171
ECHO Done!
72-
PAUSE
72+
REM PAUSE

BaseEx/.vscode/BaseEx.code-workspace

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@
1212
"**/.DS_Store": true,
1313
"**/Thumbs.db": true,
1414
// VSCODE FOLDERS --------
15-
"**/.vscode": true,
15+
"**/.vscode": false,
1616
"**/.code-workspace": true,
1717
// ZIG FOLDERS --------
18-
"**/zig-cache": true
18+
"**/zig-cache": true,
19+
"**/.zig-cache": true
1920
},
2021
"search.exclude": {
2122
"**/node_modules": true,
@@ -185,6 +186,11 @@
185186
"zig.zls.checkForUpdate": false,
186187
"zig.zls.enableInlayHints": false,
187188
"zig.zls.preferAstCheckAsChildProcess": false,
189+
"files.associations": {
190+
"raylib.h": "c",
191+
"rcamera.h": "c",
192+
"raymath.h": "c"
193+
},
188194
},
189195
"extensions": {
190196
"recommendations": [

BaseEx/main.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//!zig-autodoc-section: BaseEx\\main.zig
22
//! main.zig :
33
//! Template for a console program that hide the console window.
4-
// Build using Zig 0.12.0
4+
// Build using Zig 0.13.0
55

66
const std = @import("std");
77
const win = struct {

BaseEx/tools/buildReleaseStrip.bat

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
@ECHO OFF
2+
3+
REM Check if Tools folder, then go up to parent folder
4+
SET FolderName=
5+
FOR %%* IN (%CD%) DO SET FolderName=%%~n*
6+
IF /I "%FolderName%" == "tools" (
7+
FOR %%* IN (%CD%\..) DO SET FolderName=%%~n*
8+
CD ..
9+
)
10+
11+
REM EXTRA ARGS SHORTCUT
12+
REM ===================
13+
REM Linking system libraries (note: -l and library name all together):
14+
REM -lSDL2 -lOpenGL32
15+
REM Adding libraries DLL+LIB folders (note: -L SPACE "Dir"):
16+
REM -L %CD%\lib\SDL2
17+
REM Adding cImport .H include folders (note: -I"Dir", without spaces):
18+
REM -I%CD%\lib\microui -I%CD%\lib\SDL2\include
19+
REM
20+
REM Full extra_args sample of a project that use SDL3 + OpenGL :
21+
REM SET extra_args=-lSDL3 -lOpenGL32 -L "%CD%\lib\SDL3" -I"%CD%" -I"%CD%\lib" -I"%CD%\lib\SDL3"
22+
23+
SET extra_args=
24+
25+
26+
REM AddCSource
27+
REM ==========
28+
REM If your project use C Source Files, add here the list of files you want to add to your build.
29+
REM
30+
REM SET addCSourceFile="%CD%\lib\SDL3\glad.c"
31+
32+
SET addCSourceFile=
33+
34+
IF NOT EXIST %CD%\bin\ReleaseStrip (
35+
MKDIR %CD%\bin\ReleaseStrip
36+
)
37+
IF NOT EXIST %CD%\bin\ReleaseStrip\obj (
38+
MKDIR %CD%\bin\ReleaseStrip\obj
39+
)
40+
41+
REM GET CURRENT FOLDER NAME
42+
SET ProjectName=%FolderName%
43+
44+
SET rcmd=
45+
IF EXIST "*.rc" (
46+
SET rcmd=-rcflags /c65001 -- %CD%\%ProjectName%.rc
47+
)
48+
49+
SET singlethread=-fsingle-threaded
50+
SET libc=
51+
FINDSTR /L linkLibC build.zig > NUL && (
52+
SET libc=-lc
53+
)
54+
SET libcpp=
55+
FINDSTR /L linkLibCpp build.zig > NUL && (
56+
SET libcpp=-lc++
57+
SET singlethread=
58+
)
59+
60+
REM OUTPUT TO ZIG_REPORT.TXT
61+
> bin/ReleaseStrip/obj/zig_report.txt (
62+
zig build-exe -O ReleaseSmall %rcmd% %libc% %libcpp% %singlethread% -fstrip --color off -femit-bin=bin/ReleaseStrip/%ProjectName%.exe -femit-asm=bin/ReleaseStrip/obj/%ProjectName%.s -femit-llvm-ir=bin/ReleaseStrip/obj/%ProjectName%.ll -femit-llvm-bc=bin/ReleaseStrip/obj/%ProjectName%.bc -femit-h=bin/ReleaseStrip/obj/%ProjectName%.h -ftime-report -fstack-report %extra_args% --name %ProjectName% main.zig %addCSourceFile%
63+
) 2>&1
64+
65+
REM OUTPUT BUILD COMMAND LINE TO ZIG_BUILD_CMD.TXT
66+
> bin/ReleaseStrip/obj/zig_build_cmd.txt (
67+
zig build-exe -O ReleaseSmall %rcmd% %libc% %libcpp% %singlethread% -fstrip --color off -femit-bin=bin/ReleaseStrip/%ProjectName%.exe -femit-asm=bin/ReleaseStrip/obj/%ProjectName%.s -femit-llvm-ir=bin/ReleaseStrip/obj/%ProjectName%.ll -femit-llvm-bc=bin/ReleaseStrip/obj/%ProjectName%.bc -femit-h=bin/ReleaseStrip/obj/%ProjectName%.h -ftime-report -fstack-report %extra_args% --name %ProjectName% main.zig %addCSourceFile%
68+
) 2>&1
69+
70+
IF EXIST "%CD%\bin\ReleaseStrip\%ProjectName%.exe.obj" (
71+
MOVE %CD%\bin\ReleaseStrip\%ProjectName%.exe.obj %CD%\bin\ReleaseStrip\obj > NUL
72+
)
73+
74+
ECHO.
75+
ECHO Done!
76+
REM PAUSE

0 commit comments

Comments
 (0)