#include <gl/glew.h>
#include <glfw/glfw3.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <iostream>
#include "ourProgram.h"
#include "SOIL.h"
using namespace std;
int main()
{
glfwInit();
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_RESIZABLE, GL_FALSE);
GLFWwindow *window = glfwCreateWindow(800, 600, "opengl", nullptr, nullptr);
if (window == NULL)
{
cerr << "Failed to create window" << endl;
glfwTerminate();
exit(-1);
}
glfwMakeContextCurrent(window);
glewExperimental = GL_TRUE;
GLenum err = glewInit();
if (err != GLEW_OK)
{
cerr << "Failed to init glew : " << glewGetErrorString(err) << endl;
exit(-1);
}
opengl 绘制简单的带纹理贴图的立方体
最新推荐文章于 2022-03-23 15:16:34 发布