Create repository.

This commit is contained in:
KikooDX 2021-01-24 19:22:48 +01:00
commit e8c5a3f39e
4 changed files with 75 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
zig-cache/

16
README.md Normal file
View File

@ -0,0 +1,16 @@
# KBLE, a KeyBoard driven Level Editor
A work in progress level editor with extensive keyboard support.
Designed for tile based 2D platformers.
# Short term design decisions
Subject to change.
* Fully keyboard driven modal editing. Mouse support is secondary.
* GUI application made in [Zig](https://ziglang.org/) with [raylib](https://raylib.com/).
* Configurable (format unknown).
* [LDtk](https://ldtk.io/) inspired tiling rulesets.
# License
Copyright (C) 2021 KikooDX
This project is under the MIT license.
See LICENSE for more details.

35
build.zig Normal file
View File

@ -0,0 +1,35 @@
const Builder = @import("std").build.Builder;
pub fn build(b: *Builder) void {
// Standard target options allows the person running `zig build` to choose
// what target to build for. Here we do not override the defaults, which
// means any target is allowed, and the default is native. Other options
// for restricting supported target set are available.
const target = b.standardTargetOptions(.{});
// Standard release options allow the person running `zig build` to select
// between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall.
const mode = b.standardReleaseOptions();
const exe = b.addExecutable("zigraylib", "src/main.zig");
exe.setTarget(target);
exe.setBuildMode(mode);
exe.install();
const run_cmd = exe.run();
run_cmd.step.dependOn(b.getInstallStep());
if (b.args) |args| {
run_cmd.addArgs(args);
}
const run_step = b.step("run", "Run the app");
run_step.dependOn(&run_cmd.step);
exe.linkSystemLibrary("raylib");
exe.linkSystemLibrary("GL");
exe.linkSystemLibrary("m");
exe.linkSystemLibrary("pthread");
exe.linkSystemLibrary("dl");
exe.linkSystemLibrary("rt");
exe.linkSystemLibrary("X11");
}

23
src/main.zig Normal file
View File

@ -0,0 +1,23 @@
const ray = @cImport({
@cInclude("raylib.h");
});
pub fn main() void {
const screenWidth = 640;
const screenHeight = 480;
ray.SetConfigFlags(ray.FLAG_WINDOW_RESIZABLE);
ray.InitWindow(screenWidth, screenHeight, "KBLE");
defer ray.CloseWindow();
ray.SetTargetFPS(60);
while(!ray.WindowShouldClose()) {
ray.BeginDrawing();
defer ray.EndDrawing();
ray.ClearBackground(ray.RAYWHITE);
ray.DrawText("Hello, World!", 190, 200, 20, ray.LIGHTGRAY);
}
}