2024-05-05 14:25:05 +12:00
|
|
|
#include <gearlib.h>
|
|
|
|
|
|
|
|
int main() {
|
2024-05-05 14:29:37 +12:00
|
|
|
Window window = create_window(800, 600, "test");
|
2024-05-05 14:25:05 +12:00
|
|
|
glfwSwapInterval(0); // fps unlock
|
|
|
|
enable_debugging();
|
|
|
|
setup_textures();
|
|
|
|
|
|
|
|
Camera* camera = create_camera(vec2(0.0f, 0.0f));
|
|
|
|
UniformBuffer* camera_buffer = create_uniform_buffer(sizeof(CameraMatrices));
|
|
|
|
|
|
|
|
Texture cat = load_texture("assets/cat.png");
|
|
|
|
|
|
|
|
while (!glfwWindowShouldClose(window)) {
|
|
|
|
process_input(window);
|
|
|
|
update_camera(camera, window);
|
|
|
|
set_uniform_data(camera_buffer, camera->m);
|
|
|
|
|
|
|
|
glClearColor(vec4_spread(BLACK));
|
|
|
|
glClear(GL_COLOR_BUFFER_BIT);
|
|
|
|
|
|
|
|
for(int i = 0; i < 32; i++) {
|
|
|
|
draw_texture(cat, vec2(rand() % 600, rand() % 600), vec2(500.0f, 500.0f), WHITE);
|
|
|
|
}
|
|
|
|
|
|
|
|
flush();
|
|
|
|
|
|
|
|
glfwSwapBuffers(window);
|
|
|
|
glfwPollEvents();
|
|
|
|
}
|
|
|
|
|
|
|
|
glfwDestroyWindow(window);
|
|
|
|
glfwTerminate();
|
|
|
|
return 0;
|
|
|
|
}
|