IT WORKS!!!

This commit is contained in:
Benjamin Palko 2024-08-07 00:10:57 -04:00
parent e2f3f1b09f
commit 4926cce7f1
6 changed files with 52 additions and 8 deletions

View file

@ -1,6 +1,38 @@
#include <fmt/core.h>
#include <glad/glad.h>
#include <GLFW/glfw3.h>
int main() {
fmt::print("Hello world!\n");
if (!glfwInit()) {
const char *description;
int code = glfwGetError(&description);
fmt::print("GLFW failed to init! {}", code);
return -1;
}
GLFWwindow *window =
glfwCreateWindow(640, 480, "HELLO WORLD!", glfwGetPrimaryMonitor(), NULL);
if (!window) {
glfwTerminate();
fmt::print("Window or OpenGL context creation failed");
return -1;
}
glfwMakeContextCurrent(window);
/* Loop until the user closes the window */
while (!glfwWindowShouldClose(window)) {
/* Render here */
/* Swap front and back buffers */
glfwSwapBuffers(window);
/* Poll for and process events */
glfwPollEvents();
}
glfwTerminate();
return 0;
}