OpenGL Programming Guide 9th Edition以及随书源代码

OpenGL Programming Guide 9th Edition以及随书源代码

阅读OpenGL程序指导的书,没得代码很头疼,于是在网上找了一个。
下面是编译过程
下载opengl的环境:

sudo apt-get install build-essential libgl1-mesa-dev
sudo apt install libglu1-mesa-dev 
sudo apt install libopengl0 
sudo apt install mesa-common-dev 
sudo apt install libgl1-mesa-dev 
sudo apt install libglu1-mesa-dev 
sudo apt install freeglut3-dev  # 没有找到 gl/glut.h 头文件

代码在编译的时候出现的错误

undefined reference to symbol ‘XConvertSelection’ to solve
参考:
undefined reference to symbol ‘XConvertSelection’ to solve
在cmake里面添加这个博客的内容解决

find_package( X11 REQUIRED )
list( APPEND GLSLCOOKBOOK_LIBS ${X11_Xrandr_LIB} ${X11_Xi_LIB} ${X11_Xrender_LIB} ${X11_Xdamage_LIB} ${X11_Xxf86vm_LIB} ${X11_Xext_LIB}  ${X11_X11_LIB} ${X11_Xinerama_LIB}  ${X11_Xcursor_LIB})

各种memcpy未定义:
在相应的文件中添加 #include <string.h> 即可。

 #include <string.h>
 //或者
  #include <cstring>
  //上面两个在c++中是一个意思。

vdds.cpp 中报一个goto错误:
说的是goto后面不能定义变量,讲那些定义变量的语句copy到前面去就好了。

至于修改后的报,我上传到百度云盘,供大家参考。
链接: https://pan.baidu.com/s/15n0t0pMNPzz8bF5BBPkRbg 提取码: w23m 复制这段内容后打开百度网盘手机App,操作更方便哦

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
前言 第1章OpenGL简介 1.1什么是OpenGL? 1.2一段简单的OpenGL代码 1.3OpenGL函数的语法 1.4OpenGL是个状态机 1.5OpenGL渲染管线 1.5.1显示列表 1.5.2求值器 1.5.3基于顶点的操作 1.5.4图元装配 1.5.5像素操作 1.5.6纹理装配 1.5.7光栅化 1.5.8片断操作 1.6与OpenGL相关的函数库 1.6.1包含文件 1.6.2GLUT,OpenGL实用工具包 1.7动画 1.7.1暂停刷新 1.7.2动画=重绘+交换 第2章状态管理和绘制几何物体 2.1绘图工具箱 2.1.1清除窗口 2.1.2指定颜色 2.1.3强制完成绘图操作 2.1.4坐标系统工具箱 2.2描述点、直线和多边形 2.2.1什么是点、直线和多边形? 2.2.2指定顶点 2.2.3OpenGL几何图元 2.3基本状态管理 2.4显示点、直线和多边形 2.4.1点的细节 2.4.2直线的细节 2.4.3多边形的细节 2.5法线向量 2.6顶点数组 2.6.1步骤1:启用数组 2.6.2步骤2:指定数组的数据 2.6.3步骤3:解引用和渲染 2.7缓冲区对象 2.7.1创建缓冲区对象 2.7.2激活缓冲区对象 2.7.3用数据分配和初始化缓冲区对象 2.7.4更新缓冲区对象的数据值 2.7.5清除缓冲区对象 2.7.6使用缓冲区对象存储顶点数据数据 2.8属性组 2.9关于创建多边形表面模型的一些提示 2.9.1例子:创建一个二十面体 第3章视图 3.1简介:照相机比喻 3.2.1一个简单的例子:绘制立方体 3.1.2通用的变换函数 3.2视图和模型变换 3.2.1对变换进行思考 3.2.2模型变换 3.2.3视图变换 3.3投影变换 3.3.1透视投影 …… 第4章颜色 第5章光照 第6章混合、抗锯齿、雾和多边形偏移 第7章显示列表 第8章绘制像素、位图、字体和图像 第9章纹理贴图 第10章帧缓冲区 第11章分格化和二次方程表面 第12章求值器和NURBS 第13章选择和反馈 第14章OpenGL高级技巧 第15章OpenGL着色语言 附录A操作顺序 附录B状态变量 附录COpenGL和窗口系统 附录DGLUT(OpenGL实用工具库)基础知识 附录E计算法线向量 附录F齐次坐标和变换矩阵 附录G编程提示 附录HOpenGL的不变性规则 附录IOpenGL着色语言内置的变量和函数 术语表
OpenGL开发指南英文第九 What This Guide Contains This guide contains the following chapters: • Chapter 1 , “Introduction to OpenGL ,” provides a glimpse into what OpenGL can do. It also presents a simple OpenGL programand explains the essential programming details you need to know for the subsequent chapters. • Chapter 2 , “Shader Fundamentals ,” discusses the major features of the OpenGL Shading Language and SPIR-V, demonstrating how to initialize and use themwithin an application. • Chapter 3 , “Drawing with OpenGL ,” describes the various methods for rendering geometry using OpenGL, as well as some optimization techniques for making rendering more efficient. • Chapter 4 , “Color, Pixels, and Fragments ,” explains OpenGL’s processing of color, including how pixels are processed, how buffers are managed, and rendering techniques focused on pixel processing. • Chapter 5 , “Viewing Transformations, Culling, Clipping, and Feedback ,” details the operations for presenting a three-dimensional scene on a two-dimensional computer screen, including the mathematics and shader operations for the various types of geometric projection. • Chapter 6 , “Textures and Framebuffers ,” discusses combining geometric model s and imagery for creating realistic, highly detailed three-dimensional models. • Chapter 7 , “Light and Shadow ,” describes simulating illumination effects for computer graphics, focusing on implementing those techniques in programmable shaders. • Chapter 8 , “Procedural Texturing ,” details the generation of textures and other surface effects using programmable shaders for inc reased realismand other rendering effects. • Chapter 9 , “Tessellation Shaders ,” explains OpenGL’s shader facility for managing and tessellating geometric surfaces. • Chapter 10 , “Geometry Shaders ,” describe an additional technique for modifying geometric primitives within the OpenGL rendering pipeline using shaders. • Chapter 11 , “Memory ,” demonstrates techniques using OpenGL’s framebuffer and buffer memories for advanced rendering techniques and nongraphical uses. • Chapter 12 , “Compute Shaders ,” introduces the newest shader stage, which integrates general computation into the OpenGL rendering pipeline.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值