//
// Created by Vicente Ferrari Smith on 26.02.26.
//

#ifndef V_GRAPHICS_H
#define V_GRAPHICS_H


#ifdef __EMSCRIPTEN__
#include "webgpu/renderer.h"
#elifdef __APPLE__
#include "metal/renderer.h"
#elifdef _WIN32
#include "vulkan/init.h"
#include "vulkan/renderer.h"
#endif

#ifdef __EMSCRIPTEN__
#include <GLFW/emscripten_glfw3.h>
#else
#include <GLFW/glfw3.h>
#endif
#include <glm/glm.hpp>

#ifndef __EMSCRIPTEN__
#include <slang.h>
#include <slang-com-ptr.h>
inline Slang::ComPtr<slang::IGlobalSession> slangGlobalSession;
inline Slang::ComPtr<slang::ISession> slangSession;
#endif

#include "sprite.h"

void graphics_init(GLFWwindow *window);
void graphics_deinit();
void begin_frame();
void end_frame(GLFWwindow *window);

void submit_quad(glm::vec2 pos, glm::vec2 scale);
void submit_sprite(glm::vec2 pos, const sprite_t &sprite);

void upload_texture(
    int w,
    int h,
    const void* pixels,
    Texture *texture);

#endif //V_GRAPHICS_H