Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
DarknessFX committed Jan 11, 2025
1 parent 4b52cd3 commit fba2731
Show file tree
Hide file tree
Showing 23 changed files with 83 additions and 36 deletions.
4 changes: 4 additions & 0 deletions BaseAllegro/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
// Build using Zig 0.13.0

const std = @import("std");

// NOTE ABOUT VSCODE + ZLS:
// Use full path for all cIncludes:
// @cInclude("C:/zig_workbench/BaseAllegro/lib/allegro5/allegro.h");
const all = @cImport({
// Necessary to fix :
// error: cannot combine with previous
Expand Down
4 changes: 4 additions & 0 deletions BaseBox2D/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
// Build using Zig 0.13.0

const std = @import("std");

// NOTE ABOUT VSCODE + ZLS:
// Use full path for all cIncludes:
// @cInclude("C:/zig_workbench/BaseBox2D/lib/box2d/box2d.h");
const box = @cImport({
@cInclude("lib/box2d/box2d.h");
});
Expand Down
4 changes: 4 additions & 0 deletions BaseChipmunk2D/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
// Build using Zig 0.13.0

const std = @import("std");

// NOTE ABOUT VSCODE + ZLS:
// Use full path for all cIncludes:
// @cInclude("C:/zig_workbench/BaseChipmunk/lib/chipmunk/include/chipmunk.h");
const cp = @cImport({
@cInclude("lib/chipmunk/include/chipmunk.h");
});
Expand Down
2 changes: 1 addition & 1 deletion BaseDX11/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const L = std.unicode.utf8ToUtf16LeStringLiteral;

// NOTE ABOUT VSCODE + ZLS:
// Use full path for all cIncludes:
// @cInclude("C:/zig_workbench/lib/DX11/DX11.h");
// @cInclude("C:/zig_workbench/BaseDX11/lib/DX11/DX11.h");
const dx = @cImport({
@cInclude("lib/DX11/DX11.h");
});
Expand Down
5 changes: 5 additions & 0 deletions BaseDuckDB/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
// Build using Zig 0.13.0

const std = @import("std");


// NOTE ABOUT VSCODE + ZLS:
// Use full path for all cIncludes:
// @cInclude("C:/zig_workbench/BaseDuckDB/lib/DuckDB/duckdb.h");
const duk = @cImport({
@cInclude("lib/DuckDB/duckdb.h");
});
Expand Down
6 changes: 4 additions & 2 deletions BaseGLFW/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ const win = struct {
usingnamespace std.os.windows.kernel32;
};

// Remember to copy lib/GLFW/glfw3.dll to Zig.exe Folder PATH
// Change @cInclude to full path

// NOTE ABOUT VSCODE + ZLS:
// Use full path for all cIncludes:
// @cInclude("C:/zig_workbench/BaseGLFW/lib/glad/include/glfw3.h");
const glfw = @cImport({
@cInclude("lib/glad/include/glad.h");
@cInclude("lib/glfw/include/glfw3.h");
Expand Down
4 changes: 4 additions & 0 deletions BaseLMDB/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
// Build using Zig 0.13.0

const std = @import("std");

// NOTE ABOUT VSCODE + ZLS:
// Use full path for all cIncludes:
// @cInclude("C:/zig_workbench/BaseLMDB/lib/LMDB/lmdb.h");
const lmdb = @cImport({
@cInclude("lib/LMDB/lmdb.h");
});
Expand Down
4 changes: 3 additions & 1 deletion BaseLVGL/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

const std = @import("std");

// NOTE: Need full path to lib/lvgl
// NOTE ABOUT VSCODE + ZLS:
// Use full path for all cIncludes:
// @cInclude("C:/zig_workbench/BaseLVGL/lib/lvgl/lvgl.h");
pub const lv = @cImport({
@cInclude("lib/lvgl/lvgl.h");
@cInclude("lib/lvgl_drv/win32drv.h");
Expand Down
4 changes: 4 additions & 0 deletions BaseLua/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
// Build using Zig 0.13.0

const std = @import("std");

// NOTE ABOUT VSCODE + ZLS:
// Use full path for all cIncludes:
// @cInclude("C:/zig_workbench/BaseLua/lib/lua/lua.h");
const lua = @cImport({
@cInclude("lib/lua/lua.h");
@cInclude("lib/lua/lualib.h");
Expand Down
5 changes: 3 additions & 2 deletions BaseNanoVG/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@

const std = @import("std");

// Remember to copy lib/GLFW/glfw3.dll to Zig.exe Folder PATH
// Change @cInclude to full path
// NOTE ABOUT VSCODE + ZLS:
// Use full path for all cIncludes:
// @cInclude("C:/zig_workbench/BaseNanoVG/lib/nanovg/nanovg.h");
const nvg = @cImport({
@cDefine("GLFW_INCLUDE_NONE", "1"); // ? Must have, without it the template crashes.
@cInclude("lib/glad/include/glad.h");
Expand Down
4 changes: 4 additions & 0 deletions BaseNuklear/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
const std = @import("std");
const win = std.os.windows;
pub inline fn fmt(comptime format: []const u8, args: anytype) []u8 { return std.fmt.allocPrint(std.heap.page_allocator, format, args) catch unreachable; }

// NOTE ABOUT VSCODE + ZLS:
// Use full path for all cIncludes:
// @cInclude("C:/zig_workbench/BaseNuklear/lib/nuklear/nuklear.h");
const nk = @cImport({
@cDefine("NK_INCLUDE_FIXED_TYPES", "");
@cDefine("NK_INCLUDE_STANDARD_IO", "");
Expand Down
4 changes: 4 additions & 0 deletions BaseODE/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
// Build using Zig 0.13.0

const std = @import("std");

// NOTE ABOUT VSCODE + ZLS:
// Use full path for all cIncludes:
// @cInclude("C:/zig_workbench/BaseODE/lib/ode/ode.h");
const ode = @cImport({
@cInclude("lib/ode/ode.h");
});
Expand Down
3 changes: 3 additions & 0 deletions BaseOpenGL/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ const win = struct {
const WINAPI = win.WINAPI;
const L = std.unicode.utf8ToUtf16LeStringLiteral;

// NOTE ABOUT VSCODE + ZLS:
// Use full path for all cIncludes:
// @cInclude("C:/zig_workbench/BaseOpenGL/lib/opengl/gl.h");
const gl = @cImport({
@cInclude("lib/opengl/gl.h");
@cInclude("lib/opengl/glu.h");
Expand Down
3 changes: 3 additions & 0 deletions BaseOpenGL/main_minimal.zig
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ const win = struct {
const WINAPI = win.WINAPI;
const L = std.unicode.utf8ToUtf16LeStringLiteral;

// NOTE ABOUT VSCODE + ZLS:
// Use full path for all cIncludes:
// @cInclude("C:/zig_workbench/BaseOpenGL/lib/opengl/gl.h");
const gl = @cImport({
@cInclude("lib/opengl/gl.h");
@cInclude("lib/opengl/glu.h");
Expand Down
4 changes: 3 additions & 1 deletion BaseSDL2/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ const win = struct {
};
const WINAPI = win.WINAPI;

// NOTE ABOUT VSCODE + ZLS:
// Use full path for all cIncludes:
// @cInclude("C:/zig_workbench/BaseSDL2/lib/SDL2/include/SDL.h");
pub const sdl = @cImport({
// NOTE: Need full path to SDL2/include
@cInclude("SDL.h");
});

Expand Down
5 changes: 3 additions & 2 deletions BaseSDL3/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
const std = @import("std");
pub extern fn main() void; // Zig Main, ignored, using SDL3

// NOTE ABOUT VSCODE + ZLS:
// Use full path for all cIncludes:
// @cInclude("C:/zig_workbench/BaseSDL3/lib/SDL3/include/SDL.h");
const sdl = @cImport({
// NOTE: Need full path to SDL3/include
// Remember to copy SDL3.dll to Zig.exe folder PATH
@cDefine("SDL_MAIN_USE_CALLBACKS", "1");
@cInclude("SDL.h");
@cInclude("SDL_main.h");
Expand Down
5 changes: 3 additions & 2 deletions BaseSFML2/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@

const std = @import("std");

// Remember to copy lib/GLFW/glfw3.dll to Zig.exe Folder PATH
// Change @cInclude to full path
// NOTE ABOUT VSCODE + ZLS:
// Use full path for all cIncludes:
// @cInclude("C:/zig_workbench/BaseCSFML2/lib/CSFML2/include/graphics.h");
const sfml = @cImport({
@cInclude("lib/CSFML2/include/Graphics.h");
@cInclude("lib/CSFML2/include/Window.h");
Expand Down
4 changes: 4 additions & 0 deletions BaseSQLite/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
// Build using Zig 0.13.0

const std = @import("std");

// NOTE ABOUT VSCODE + ZLS:
// Use full path for all cIncludes:
// @cInclude("C:/zig_workbench/BaseSQLite/lib/sqlite/sqlite3.h");
const sqlite = @cImport({
@cInclude("sqlite3.h");
});
Expand Down
3 changes: 3 additions & 0 deletions BaseSokol/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
const std = @import("std");
pub extern fn main() void; // Skip Zig Maig in favor of Sokol_Main.

// NOTE ABOUT VSCODE + ZLS:
// Use full path for all cIncludes:
// @cInclude("C:/zig_workbench/BaseSokol/lib/sokol/include/sokol_app.h");
const sk = @cImport({
@cDefine("SOKOL_GLCORE", "");
@cInclude("sokol_app.h");
Expand Down
3 changes: 3 additions & 0 deletions BaseSokol/main_imgui.zig
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
const std = @import("std");
pub extern fn main() void; // Skip Zig Maig in favor of Sokol_Main.

// NOTE ABOUT VSCODE + ZLS:
// Use full path for all cIncludes:
// @cInclude("C:/zig_workbench/BaseSokol/lib/sokol/include/sokol_app.h");
const sk = @cImport({
@cInclude("sokol_app.h");
@cInclude("sokol_gfx.h");
Expand Down
3 changes: 3 additions & 0 deletions BaseSokol/main_nuklear.zig
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
const std = @import("std");
pub extern fn main() void; // Skip Zig Maig in favor of Sokol_Main.

// NOTE ABOUT VSCODE + ZLS:
// Use full path for all cIncludes:
// @cInclude("C:/zig_workbench/BaseSokol/lib/sokol/include/sokol_app.h");
const sk = @cImport({
@cDefine("SOKOL_GLCORE", "");
@cInclude("sokol_app.h");
Expand Down
4 changes: 4 additions & 0 deletions BaseWebview/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
// Build using Zig 0.13.0

const std = @import("std");

// NOTE ABOUT VSCODE + ZLS:
// Use full path for all cIncludes:
// @cInclude("C:/zig_workbench/BaseWebview/lib/webview/include/webview.h");
const web = @cImport({
@cInclude("lib/webview/include/webview.h");
});
Expand Down
32 changes: 7 additions & 25 deletions BaseZstd/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@
//! Template for a console program.

const std = @import("std");

// NOTE ABOUT VSCODE + ZLS:
// Use full path for all cIncludes:
// @cInclude("C:/zig_workbench/BaseZstd/lib/zstd/zstd.h");
const zst = @cImport({
@cInclude("lib/zstd/zstd.h");
});

pub fn main() !void {

// Allocate memory for the source data
// Long text to be compressed as sample
const src =
\\In the quiet of early morning, the town awakens slowly, like a flower unfurling under the first
\\light of dawn. The baker, with flour-dusted hands, kneads dough for the day's first loaves,
Expand All @@ -22,31 +28,7 @@ pub fn main() !void {
\\the comfort of shared silence. In this town, life is woven from simple, yet profound moments,
\\where each day is an opportunity to live, love, and learn.
;
// \\Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut
// \\labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
// \\laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
// \\voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
// \\non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Sed ut perspiciatis
// \\unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam,
// \\eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.
// \\Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur
// \\magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem
// \\ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora
// \\incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam,
// \\quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi
// \\consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil
// \\molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur? At vero
// \\eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum
// \\deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate
// \\non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et
// \\dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore,
// \\cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat
// \\facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem
// \\quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates
// \\repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente
// \\delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus
// \\asperiores repellat.
// ;

std.debug.print("Original size: {d}\n\n", .{ src.len });

const srcSize = src.len;
Expand Down

0 comments on commit fba2731

Please sign in to comment.