opengl开发环境搭建

一,下载Virtual Studio Community 2017

https://my.visualstudio.com/Downloads/Featured?mkt=zh-cn

二,下载GLFW(32-bits Windows binaries)

https://www.glfw.org/download.html

三,下载GLEW(Binaries Windows 32 bits and 64 bits)

http://glew.sourceforge.net/

四,用VS新建一个控制台的工程

       配置项目熟悉

    1. 配置属性 --> C/C++ --> 常规 --> 附加包含目录
    2. 配置属性 --> 链接器 --> 常规 --> 附加库目录
    3. 配置属性 --> 链接器 --> 输入 --> 附加依赖项

 

opengl32.lib
glfw3.lib
glew32s.lib

main.cpp

// ConsoleApplication2.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>

#define GLEW_STATIC
#include<GL/glew.h>
#include <GLFW/glfw3.h>
 
int main()
{
    std::cout << "Hello World!\n";
}

// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
// Debug program: F5 or Debug > Start Debugging menu

// Tips for Getting Started: 
//   1. Use the Solution Explorer window to add/manage files
//   2. Use the Team Explorer window to connect to source control
//   3. Use the Output window to see build output and other messages
//   4. Use the Error List window to view errors
//   5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project
//   6. In the future, to open this project again, go to File > Open > Project and select the .sln file

 

posted @ 2022-04-29 08:49  maxiongying  阅读(198)  评论(0编辑  收藏  举报