minimal!
This commit is contained in:
parent
ee6cba4be7
commit
3025671f4f
4 changed files with 13 additions and 16 deletions
14
src/main.cpp
14
src/main.cpp
|
|
@ -1,29 +1,33 @@
|
|||
#include <fmt/core.h>
|
||||
#include <glad/glad.h>
|
||||
#include <GLFW/glfw3.h>
|
||||
#include <fmt/core.h>
|
||||
|
||||
int main() {
|
||||
|
||||
int supported = glfwPlatformSupported(GLFW_PLATFORM_WAYLAND);
|
||||
fmt::print("Wayland support: {}\n", supported == GLFW_TRUE);
|
||||
|
||||
if (!glfwInit()) {
|
||||
const char *description;
|
||||
int code = glfwGetError(&description);
|
||||
fmt::print("GLFW failed to init! {}", code);
|
||||
fmt::print("GLFW failed to init! {} - {}\n", code, description);
|
||||
return -1;
|
||||
}
|
||||
GLFWwindow *window =
|
||||
glfwCreateWindow(640, 480, "HELLO WORLD!", glfwGetPrimaryMonitor(), NULL);
|
||||
glfwCreateWindow(640, 480, "GLFW", glfwGetPrimaryMonitor(), NULL);
|
||||
|
||||
if (!window) {
|
||||
glfwTerminate();
|
||||
fmt::print("Window or OpenGL context creation failed");
|
||||
fmt::print("Window or OpenGL context creation failed\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
glfwMakeContextCurrent(window);
|
||||
glClearColor(0.4f, 0.3f, 0.4f, 0.0f);
|
||||
|
||||
/* Loop until the user closes the window */
|
||||
while (!glfwWindowShouldClose(window)) {
|
||||
/* Render here */
|
||||
// glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
/* Swap front and back buffers */
|
||||
glfwSwapBuffers(window);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue