From cf34a3dda6805e8466d3045589b9560e995daa5d Mon Sep 17 00:00:00 2001 From: LinlyBoi Date: Thu, 1 Aug 2024 11:11:44 +0300 Subject: [PATCH] the begining --- Makefile | 13 +++++++++++++ pog.cpp | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 Makefile create mode 100644 pog.cpp diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f1d291c --- /dev/null +++ b/Makefile @@ -0,0 +1,13 @@ +## +# OpenGL Tutorial +# +# @file +# @version 0.1 + +build: + g++ -o pog pog.cpp -lglfw -lGLESv2 -lm -lGL +run: build + ./pog + + +# end diff --git a/pog.cpp b/pog.cpp new file mode 100644 index 0000000..f3043dc --- /dev/null +++ b/pog.cpp @@ -0,0 +1,33 @@ +#include +#include +#include +#include +#include +int main() { + int x; + glfwInit(); + glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); + glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3); + glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); + // glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); + GLFWwindow *window; + window = glfwCreateWindow(1920, 1080, "Test Window", NULL, NULL); + if (window == NULL) { + // error handling + std::cout << "AH HECK INIT FAILED BRUV" << std::endl; + } + glViewport(0, 0, 1920, 1080); + glfwMakeContextCurrent(window); + float vertices[] = { + -0.5f, -0.5f, 0.0f, + 0.5f, -0.5f, 0.0f, + 0.0f, 0.5f, 0.0f + }; + + unsigned int VBO; + glGenBuffers(1, &VBO); + glBindBuffer(GL_ARRAY_BUFFER, VBO); + glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW); + std::cin >> x; + return 0; +}