创建一个OpenGL窗口
#include <Windows.h>
#include <stdio.h>
#include <tchar.h>
#include "gl3w.h"
#include "glfw3.h"
#pragma comment(lib,"glfw3.lib")
static void error_callback(int error, const char* description);
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
//////////////////////////////////////////////////////////////////////////
glfwSetErrorCallback(error_callback);
if (!glfwInit())
return 1;
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
GLFWwindow* window = glfwCreateWindow(1280, 720, "ImGui OpenGL3 example", NULL, NULL);
glfwMakeContextCurrent(window);
gl3wInit();
while (!glfwWindowShouldClose(window))
{
glfwPollEvents();
int display_w, display_h;
glfwGe

本文介绍了如何在Visual Studio 2010中设置OpenGL的开发环境,包括添加OpenGL头文件和库路径,设置多线程DLL编译选项,以及静态编译所需的预处理器定义和附加依赖项。
最低0.47元/天 解锁文章
969

被折叠的 条评论
为什么被折叠?



