IT WORKS!!!
This commit is contained in:
parent
e2f3f1b09f
commit
4926cce7f1
6 changed files with 52 additions and 8 deletions
34
src/main.cpp
34
src/main.cpp
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue