aboutsummaryrefslogtreecommitdiff
path: root/src/main.odin
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.odin')
-rw-r--r--src/main.odin31
1 files changed, 30 insertions, 1 deletions
diff --git a/src/main.odin b/src/main.odin
index 541046b..508f97c 100644
--- a/src/main.odin
+++ b/src/main.odin
@@ -28,6 +28,33 @@ state: struct {
platform_list: Entity_List(Platform),
}
+logger: log.Logger
+
+// raylib_log :: proc "c" (
+// msg_type: rl.TraceLogLevel,
+// fmt: cstring,
+// args: ^c.va_list,
+// ) {
+// context = runtime.default_context()
+// context.logger = logger
+//
+// fmt_len := libc.vsnprintf(nil, 0, fmt, args)
+//
+// msg_bytes := make([]u8, fmt_len + 1, allocator = context.temp_allocator)
+// log.info(len(msg_bytes), raw_data(msg_bytes))
+// log.info(libc.vsnprintf(raw_data(msg_bytes), len(msg_bytes), fmt, args))
+//
+// msg := string(msg_bytes)
+//
+// #partial switch msg_type {
+// case .DEBUG: log.debug(msg)
+// case .INFO: log.info(msg)
+// case .WARNING: log.warn(msg)
+// case .ERROR: log.error(msg)
+// case .FATAL: log.fatal(msg)
+// }
+// }
+
init :: proc() {
state.camera.zoom = 1
// state.camera.offset = {draw.SCREEN_WIDTH/2, draw.SCREEN_HEIGHT/2}
@@ -109,10 +136,12 @@ main :: proc() {
}
}
- logger := log.create_console_logger()
+ logger = log.create_console_logger()
context.logger = logger
defer log.destroy_console_logger(logger)
+ // rl.SetTraceLogCallback(raylib_log)
+
rl.InitWindow(480 * 2, 360 * 2, "Demonchime")
rl.SetWindowState({.WINDOW_RESIZABLE})