Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <glad/glad.h>
- #include <GLFW/glfw3.h>
- #include <iostream>
- int main() {
- glfwInit();
- glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
- glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
- glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
- GLFWwindow* window = glfwCreateWindow(800, 600, "this is NOT a window!", NULL, NULL);
- if (window == NULL) {
- std::cout << "Failed to create GLFW window" << std::endl;
- glfwTerminate();
- return -1;
- }
- glfwMakeContextCurrent(window);
- if (!gladLoadGLLoader((GLADloadproc)glfwGetProcAddress)) {
- std::cout << "Failed to initialize GLAD" << std::endl;
- return -1;
- }
- while (!glfwWindowShouldClose(window)) {
- glfwPollEvents();
- glClearColor(0.1f, 0.1f, 0.1f, 1.0f);
- glClear(GL_COLOR_BUFFER_BIT);
- glfwSwapBuffers(window);
- }
- glfwTerminate();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment