Initial project scaffold for Dimma
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
// Odin build script for Dimma
|
||||
// Usage: odin build build.odin
|
||||
|
||||
package build
|
||||
|
||||
import "core:os"
|
||||
import "core:fmt"
|
||||
|
||||
const (
|
||||
OUTPUT_DIR = "../build/"
|
||||
APP_NAME = "dimma"
|
||||
)
|
||||
|
||||
main :: proc() {
|
||||
// Determine OS and architecture
|
||||
os_name := os.GetEnv("ODIN_OS")
|
||||
if os_name == "" {
|
||||
os_name = os.Environ()[0] // Fallback
|
||||
}
|
||||
|
||||
arch := os.GetEnv("ODIN_ARCH")
|
||||
if arch == "" {
|
||||
arch = "amd64" // Default
|
||||
}
|
||||
|
||||
output_path := OUTPUT_DIR + APP_NAME + "-" + os_name + "-" + arch
|
||||
|
||||
// Create build directory
|
||||
os.MkdirAll(OUTPUT_DIR, 0755)
|
||||
|
||||
fmt.printf("Building Dimma for %s/%s...\n", os_name, arch)
|
||||
fmt.printf("Output: %s\n", output_path)
|
||||
|
||||
// Build command would be:
|
||||
// odin build main.odin -out:%s -build-mode:exe -target:.)...
|
||||
// with appropriate raylib/raygui paths
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package main
|
||||
|
||||
import "core:fmt"
|
||||
import "core:os"
|
||||
import raylib "./raylib.odin"
|
||||
import raygui "./raygui.odin"
|
||||
|
||||
const (
|
||||
SCREEN_WIDTH = 800
|
||||
SCREEN_HEIGHT = 450
|
||||
APP_TITLE = "Dimma"
|
||||
CURRENT_VERSION = "v0.1.0"
|
||||
)
|
||||
|
||||
main :: proc() {
|
||||
raylib.InitWindow(SCREEN_WIDTH, SCREEN_HEIGHT, APP_TITLE)
|
||||
defer raylib.CloseWindow()
|
||||
|
||||
raylib.SetTargetFPS(60)
|
||||
|
||||
for !raylib.WindowShouldClose() {
|
||||
raylib.BeginDrawing()
|
||||
defer raylib.EndDrawing()
|
||||
|
||||
raylib.ClearBackground(raylib.RAYWHITE)
|
||||
|
||||
// Draw raygui
|
||||
raygui.Draw()
|
||||
}
|
||||
}
|
||||
|
||||
// GUI procedure to be called from main loop
|
||||
Draw :: proc() {
|
||||
// Draw version label
|
||||
pos := raylib.Vector2{10, 10}
|
||||
raygui.Label(pos, "Current Version: " + CURRENT_VERSION)
|
||||
|
||||
// Draw update button
|
||||
btn_pos := raylib.Vector2{10, 40}
|
||||
btn_size := raylib.Vector2{200, 30}
|
||||
if raygui.Button(btn_pos, btn_size, "Check for Updates") {
|
||||
fmt.println("Check for Updates clicked")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
// Placeholder for raygui C interop bindings
|
||||
// Assumes raygui headers are available system-wide
|
||||
package raygui
|
||||
|
||||
import raylib "../raylib.odin"
|
||||
|
||||
// GUI control functions
|
||||
Label :: proc(pos: raylib.Vector2, text: rawstring) #cdecl
|
||||
Button :: proc(pos: raylib.Vector2, size: raylib.Vector2, text: rawstring) -> bool #cdecl
|
||||
|
||||
// Layout functions
|
||||
GuiSetStyle :: proc(control: i32, property: i32, value: i32) #cdecl
|
||||
GuiLoadStyle :: proc(fileName: rawstring) -> bool #cdecl
|
||||
GuiEnable :: proc() #cdecl
|
||||
GuiDisable :: proc() #cdecl
|
||||
GuiLock :: proc() #cdecl
|
||||
GuiUnlock :: proc() #cdecl
|
||||
@@ -0,0 +1,25 @@
|
||||
// Placeholder for raylib C interop bindings
|
||||
// Assumes raylib headers are available system-wide
|
||||
package raylib
|
||||
|
||||
@(import_c)
|
||||
const (
|
||||
RAYWHITE = 0xF5F5F5FF
|
||||
)
|
||||
|
||||
// Window functions
|
||||
InitWindow :: proc(width: i32, height: i32, title: rawstring) #cdecl
|
||||
CloseWindow :: proc() #cdecl
|
||||
WindowShouldClose :: proc() -> bool #cdecl
|
||||
SetTargetFPS :: proc(fps: i32) #cdecl
|
||||
|
||||
// Drawing functions
|
||||
BeginDrawing :: proc() #cdecl
|
||||
EndDrawing :: proc() #cdecl
|
||||
ClearBackground :: proc(color: u32) #cdecl
|
||||
|
||||
// Vector2 type
|
||||
Vector2 :: struct {
|
||||
X: f32,
|
||||
Y: f32,
|
||||
}
|
||||
Reference in New Issue
Block a user