const std = @import("std");
const rl = @import("raylib");

var _alloc: std.mem.Allocator = undefined;

pub const RenderMode = enum {
    twoD,
    threeD
};

pub fn Init(Allocator: std.mem.Allocator, renderMode: RenderMode, targetFPS: i32, width: i32, height: i32, gameTitle: []const u8) void {
    _alloc = Allocator;
    rl.setTargetFPS(targetFPS);
    rl.initWindow(width, height, gameTitle);
    if (renderMode == .twoD ){
        while(!rl.windowShouldClose()){
            PhysicsUpdate();
            rl.beginDrawing();
            rl.beginMode2D();   // Needs 2D Camera input
            Render3D();
            rl.endMode2D();
            RenderUI();
            rl.endDrawing();
        }
    }else if (renderMode == .threeD){
        while(!rl.windowShouldClose()){
            PhysicsUpdate();
            rl.beginDrawing();
            rl.beginMode3D();   // Needs 3D Camera input
            Render3D();
            rl.endMode3D();
            RenderUI();
            rl.endDrawing();
        }
    }
}

fn PhysicsUpdate() void {
    
}

fn Render3D() void {

}

fn RenderUI() void {

}


pub fn Destroy() void {
    rl.closeWindow();
}