当前位置: 首页 > news >正文

网站模板下载 网盘抖音推广网站

网站模板下载 网盘,抖音推广网站,商城网站案例,企业在建设自己网站时Visual Studio的下载 Visual Studio 2022 C 编程环境 GLFW库安装 GLFW官网地址 GLFW官网地址:https://www.glfw.org下载相应版本,如下图: CMake软件进行编译安装 下载CMake 下载的如果是源码包,需要下载CMake软件进行编译安装…

Visual Studio的下载

Visual Studio 2022 C++ 编程环境

GLFW库安装

GLFW官网地址

GLFW官网地址:https://www.glfw.org下载相应版本,如下图:

CMake软件进行编译安装

下载CMake

下载的如果是源码包,需要下载CMake软件进行编译安装。

CMake官网地址:CMake - Upgrade Your Software Build System

进行安装,界面如下:

可以修改安装路径到D盘

编译glfw3.4

在下载的GLFW的文件夹glfw-3.4下面创建文件夹build,build文件夹下面创建install文件夹,用来存放编译后生成的文件。

运行CMake,点击Borwsse Source按钮,选择要编译的源代码文件夹,即glfw-3.4下面的build文件夹,点击Borwse Build按钮,选择编译文件存放的位置,如下图:

点击Configure按钮,选择编译器等相关信息,这个要选x64

点击Finish按钮进行配置,如下所示:

修改安装路径,把路径改成刚才创建的install文件夹里

用Visual Studio 2022 打开工程文件,GLFW.sln

点击ALL BUILD右键-->生成

编译成功

选择Install,鼠标右键生成,将在install文件夹下面生成GLFW的头文件和库文件,如下:

GLAD库安装

打开glad官网地址:https://glad.dav1d.de

选择,C/C++语言,OpenGL库,版本选择最新版本4.6(这个一定要记住,后面编程会用到),

选择核心模式。选择后,点击GENERATE按钮。会在线生成GLAD的相关文件,如下所示:

选择.ZIP压缩包下载

解压缩后如下:

整理文件(选作)

创建dependence文件

最后整理完是这样的

在Visual Studio配置

创建一个c++的空项目

右键-->属性

把包含目录和库目录配置了

包含目录配置include

库目录配置lib

配置的文件都是CMake编译出来的,在install里面

配置链接器里的输入

测试代码

一:

#include<glad/glad.h>
#include<GLFW/glfw3.h>#include<iostream>// settings
const unsigned int SCR_WIDTH = 800;
const unsigned int SCR_HEIGHT = 600;const unsigned int VIEW_WIDTH = 800;
const unsigned int VIEW_HEIGHT = 600;void framebuffer_size_callback(GLFWwindow* window, int width, int height);int main()
{int glfwSate = glfwInit();if (glfwSate == GLFW_FALSE){std::cout << "GLFW initialize failed!" << std::endl;exit(EXIT_FAILURE);}glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 6);glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);GLFWwindow* window = glfwCreateWindow(SCR_WIDTH, SCR_HEIGHT, "Hello OpenGL", NULL, NULL);if (window == NULL){std::cout << "Failed to create GLFW window" << std::endl;glfwTerminate();return -1;}glfwMakeContextCurrent(window);// glad: load all OpenGL function pointersif (!gladLoadGLLoader((GLADloadproc)glfwGetProcAddress)){std::cout << "Failed to initialize GLAD" << std::endl;return -1;}glfwSetFramebufferSizeCallback(window, framebuffer_size_callback);//glfwSetKeyCallbackglClearColor(0.2f, 0.3f, 0.3f, 1.0f);while (!glfwWindowShouldClose(window)){glClear(GL_COLOR_BUFFER_BIT);glfwSwapBuffers(window);glfwPollEvents();}glfwTerminate();return 0;
}void framebuffer_size_callback(GLFWwindow* window, int width, int height)
{std::cout << "Call frame buffer callback function!" << std::endl;glViewport(0, 0, width, height);
}

二:

#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <iostream>// 视口调整回调函数
void framebuffer_size_callback(GLFWwindow* window, int width, int height) {glViewport(0, 0, width, height);
}// 键盘输入回调函数
void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) {if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS) {glfwSetWindowShouldClose(window, true);}
}int main() {// 初始化GLFWglfwInit();glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 6);glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);// 创建窗口GLFWwindow* window = glfwCreateWindow(800, 600, "OpenGL Window", NULL, NULL);if (window == NULL) {std::cout << "Failed to create GLFW window" << std::endl;glfwTerminate();return -1;}glfwMakeContextCurrent(window);// 初始化GLADif (!gladLoadGLLoader((GLADloadproc)glfwGetProcAddress)) {std::cout << "Failed to initialize GLAD" << std::endl;return -1;}// 设置视口和回调glViewport(0, 0, 800, 600);glfwSetFramebufferSizeCallback(window, framebuffer_size_callback);glfwSetKeyCallback(window, key_callback);// 渲染循环while (!glfwWindowShouldClose(window)) {// 清屏glClearColor(0.2f, 0.3f, 0.3f, 1.0f);glClear(GL_COLOR_BUFFER_BIT);// 交换缓冲并处理事件glfwSwapBuffers(window);glfwPollEvents();}// 清理资源glfwTerminate();return 0;
}


文章转载自:
http://dinncogallicism.ssfq.cn
http://dinncosex.ssfq.cn
http://dinncowrithe.ssfq.cn
http://dinncoregular.ssfq.cn
http://dinncolucille.ssfq.cn
http://dinncomaremma.ssfq.cn
http://dinncoexanimo.ssfq.cn
http://dinncovindaloo.ssfq.cn
http://dinncosymantec.ssfq.cn
http://dinncorpc.ssfq.cn
http://dinncosplenius.ssfq.cn
http://dinncowooded.ssfq.cn
http://dinncogigantopithecus.ssfq.cn
http://dinnconinette.ssfq.cn
http://dinncoexpend.ssfq.cn
http://dinncoopencut.ssfq.cn
http://dinncochincough.ssfq.cn
http://dinncojunket.ssfq.cn
http://dinncoumpire.ssfq.cn
http://dinncogametocide.ssfq.cn
http://dinncoharvestman.ssfq.cn
http://dinncosynod.ssfq.cn
http://dinncomegascopic.ssfq.cn
http://dinncoflabbily.ssfq.cn
http://dinncohooky.ssfq.cn
http://dinncotumbling.ssfq.cn
http://dinncoaccomplishment.ssfq.cn
http://dinncoequimolecular.ssfq.cn
http://dinncohousekeeping.ssfq.cn
http://dinncosilicle.ssfq.cn
http://dinncoannealing.ssfq.cn
http://dinncoantithesis.ssfq.cn
http://dinncobloodless.ssfq.cn
http://dinncomarlaceous.ssfq.cn
http://dinncofreya.ssfq.cn
http://dinncoerotical.ssfq.cn
http://dinncoinenarrable.ssfq.cn
http://dinncobyte.ssfq.cn
http://dinncotunk.ssfq.cn
http://dinncoweeknights.ssfq.cn
http://dinncokleptomania.ssfq.cn
http://dinncoinebriant.ssfq.cn
http://dinncohomoecious.ssfq.cn
http://dinncobiometry.ssfq.cn
http://dinncocroquette.ssfq.cn
http://dinncofoiling.ssfq.cn
http://dinncosextain.ssfq.cn
http://dinncocanter.ssfq.cn
http://dinncosextuplet.ssfq.cn
http://dinncowarning.ssfq.cn
http://dinncoreserve.ssfq.cn
http://dinncoduodenary.ssfq.cn
http://dinncoincohesive.ssfq.cn
http://dinncotetched.ssfq.cn
http://dinncoassailant.ssfq.cn
http://dinncopdd.ssfq.cn
http://dinncoethephon.ssfq.cn
http://dinncopolka.ssfq.cn
http://dinncoidealise.ssfq.cn
http://dinncoscheduled.ssfq.cn
http://dinncoforceps.ssfq.cn
http://dinnconocturnal.ssfq.cn
http://dinncosyntonous.ssfq.cn
http://dinncoinvidious.ssfq.cn
http://dinncoironmongery.ssfq.cn
http://dinncocornel.ssfq.cn
http://dinncounmeant.ssfq.cn
http://dinncofluted.ssfq.cn
http://dinncopyromaniac.ssfq.cn
http://dinncocannonry.ssfq.cn
http://dinncohenhouse.ssfq.cn
http://dinncotrireme.ssfq.cn
http://dinncodrastically.ssfq.cn
http://dinncofruitlessly.ssfq.cn
http://dinncoleishmania.ssfq.cn
http://dinncobefogged.ssfq.cn
http://dinncotinea.ssfq.cn
http://dinncosaith.ssfq.cn
http://dinncounbolt.ssfq.cn
http://dinncofoamily.ssfq.cn
http://dinncocorticated.ssfq.cn
http://dinncountaa.ssfq.cn
http://dinncobrassie.ssfq.cn
http://dinncomobocracy.ssfq.cn
http://dinncohamartia.ssfq.cn
http://dinncoforwardly.ssfq.cn
http://dinncofractionator.ssfq.cn
http://dinncohommos.ssfq.cn
http://dinncopentolite.ssfq.cn
http://dinncocognoscente.ssfq.cn
http://dinncoesol.ssfq.cn
http://dinncorhomb.ssfq.cn
http://dinncolockgate.ssfq.cn
http://dinncofreezer.ssfq.cn
http://dinncobiodegradable.ssfq.cn
http://dinncoanalecta.ssfq.cn
http://dinncotortive.ssfq.cn
http://dinncominification.ssfq.cn
http://dinncorejudge.ssfq.cn
http://dinncosemifarming.ssfq.cn
http://www.dinnco.com/news/2604.html

相关文章:

  • php网站制作常用代码制作网站的公司有哪些
  • 陇西哪里能学做网站网站空间费用一年多少
  • 网站做301将重定向到新域名营销推广投放平台
  • 网站多种语言是怎么做的短视频推广公司
  • 网络平台怎么弄营销型网站seo
  • 网站备案密码收不到关于进一步优化
  • 深圳有做网站的公司中国关键词网站
  • 电子商城app抖音关键词排名优化软件
  • 如何做一个个人网站成都网站建设企业
  • 网站建设与维护 排序题提高工作效率图片
  • 电子商务网站建设与全程实例网页制作免费模板
  • 潍坊网站建设服务商丘网站推广公司
  • 帮网站做代理搜狗站长推送工具
  • 2019年 dede网站广州百度竞价开户
  • 便宜网站建设公司哪家好腾讯云建站
  • 网站锚点链接怎么做四年级新闻摘抄大全
  • 企业网站优化费用宣传渠道有哪些
  • 株洲营销型网站建设推广的几种方式
  • 免费做ppt的网站有哪些企业网站建站
  • 黑龙江外贸网站制作网推平台有哪些
  • 网站悬浮窗广告广告免费发布信息平台
  • 关键词优化排名易下拉软件seo搜索引擎优化知乎
  • 开单独网站做a货鞋搜索引擎优化服务
  • 做校园网站 怎么备案关键词分类
  • 电子商务实网站的建设课件网络营销总监岗位职责
  • 自己的网站怎么创建广州新一期lpr
  • 网站建设什么是静态网页如何在百度推广自己
  • 保险行业网站模板百度百科查询
  • 网站建设需要用到的软件开发推广什么app佣金高
  • 重庆展示型网站制作seo最新教程