47 lines
1.1 KiB
C++
47 lines
1.1 KiB
C++
#include <glad/glad.h>
|
|
#include <GLFW/glfw3.h>
|
|
|
|
#include <iostream>
|
|
|
|
#include "funcs.h"
|
|
#include "shader.h"
|
|
|
|
|
|
int main() {
|
|
std::cout << "Hello World!\n";
|
|
glfwInit();
|
|
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
|
|
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 4);
|
|
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
|
|
|
|
GLFWwindow* window = glfwCreateWindow(800, 600, "Howdy!", NULL, NULL);
|
|
if (window == NULL) {
|
|
std::cout << "Could not open window!\n";
|
|
glfwTerminate();
|
|
return -1;
|
|
}
|
|
glfwMakeContextCurrent(window);
|
|
|
|
if (!gladLoadGLLoader((GLADloadproc) glfwGetProcAddress)) {
|
|
std::cout << "Could not initialize GLAD!\n";
|
|
return -1;
|
|
}
|
|
|
|
glViewport(0, 0, 800, 600);
|
|
glfwSetFramebufferSizeCallback(window, framebuffer_callback);
|
|
|
|
while(!glfwWindowShouldClose(window)) {
|
|
processInputs(window);
|
|
|
|
glClearColor(0.2f, 0.3f, 0.3f, 1.0f);
|
|
glClear(GL_COLOR_BUFFER_BIT);
|
|
|
|
|
|
|
|
glfwPollEvents();
|
|
glfwSwapBuffers(window);
|
|
}
|
|
|
|
glfwTerminate();
|
|
return 0;
|
|
} |