/*#include "gear/camera.h"
#include "gear/graphics/color.h"
#include "gear/graphics/models.h"
#include <gear/images.h>
#include <gear/graphics/textures.h>
#include <gear/graphics/renderer.h>
#include <gear/graphics/pipeline.h>

#include <sokol/sokol_app.h>
#include <sokol/sokol_gfx.h>
#include <sokol/sokol_log.h>
#include <sokol/sokol_glue.h>
#include <slibs/slibs.h>
#include <HandmadeMath/HandmadeMath.h>

#include <shaders/transform.glsl.h>

g_renderer* renderer;
g_camera* camera;
g_model* cube;
g_renderer_object obj;

static void init(void) {
    sg_setup(&(sg_desc){
        .environment = sglue_environment(),
        .logger.func = slog_func,
    });

    renderer = g_renderer_create(G_CYAN);
    camera = g_camera_create(HMM_V3(0.0f, 0.0f, -5.0f), HMM_V3(0.0f, 0.0f, 0.0f), 45.0f);

    obj.bind.vertex_buffers[0] = cube->vertex_buffer;
    obj.bind.index_buffer = cube->index_buffer;

    g_texture* texture = g_texture_create_filtered(g_image_load("happi.jpg"), SG_FILTER_NEAREST, SG_FILTER_NEAREST);
    obj.bind.fs.images[SLOT_tex] = texture->image;
    obj.bind.fs.samplers[SLOT_smp] = texture->sampler;

    sg_shader shd = sg_make_shader(transform_shader_desc(sg_query_backend()));

    obj.pipeline = g_pipeline_create(shd, (sg_vertex_layout_state){
        .attrs = {
            [ATTR_vs_pos].format = SG_VERTEXFORMAT_FLOAT3,
            [ATTR_vs_color0].format = SG_VERTEXFORMAT_UBYTE4N,
            [ATTR_vs_texcoord0].format = SG_VERTEXFORMAT_SHORT2N,
        }
    });
}

float t = 0.0f;

void frame(void) {
    t += sapp_frame_duration();

    mat4 view_proj = g_camera_matrix(camera);

    g_renderer_begin(renderer);
    mat4 model = HMM_Rotate_RH(HMM_AngleDeg(0.0f), HMM_V3(1.0f, 0.0f, 0.0f));
    model = HMM_Mul(model, HMM_Rotate_RH(HMM_AngleDeg(t * 10), HMM_V3(0.0f, 1.0f, 0.0f)));
    mat4 mvp = HMM_Mul(view_proj, model);

    vs_params_t params = {
        .mvp = mvp,
        .texture_scale = HMM_V2(1.0f, 1.0f),
    };

    g_pipeline_bind(renderer, obj.pipeline);
    sg_apply_bindings(&obj.bind);
    sg_apply_uniforms(SG_SHADERSTAGE_VS, SLOT_vs_params, SG_RANGE_REF(params));
    g_renderer_draw(renderer, obj, cube->indices.size);
    g_renderer_end(renderer);
}

void cleanup(void) {
    sg_shutdown();
}

sapp_desc sokol_main(int argc, char* argv[]) {
    (void)argc; (void)argv;
    return (sapp_desc){
        .init_cb = init,
        .frame_cb = frame,
        .cleanup_cb = cleanup,
        .width = 640,
        .height = 480,
        .window_title = "Gear",
        .icon.sokol_default = true,
        .logger.func = slog_func,
        .swap_interval = 0
    };
}*/
