OpenGL底层深度解密
文章平均质量分 55
揭开OpenGL的神秘面纱。
爱书网-上海
上海四庸教育科技有限公司
展开
-
OpenGL•PBO: glGenBuffers&glBindBuffer
PART ONEcodes.cpp#include <stdio.h>#include <GL/glew.h>#include <GL/freeglut.h>#define width 222#define height 207GLubyte image[height][width][4];void initImage(){ for (int h = 0; h < height; h++) { for (int w = 0; w原创 2022-04-28 14:51:07 · 369 阅读 · 0 评论 -
OpenGL: Colorful Line(CR)
PART ONEcodes.cpp#include <stdio.h>#include <GL/glew.h>#include <GL/freeglut.h>#include <iostream>using namespace std;#define width 222#define height 207#define num 2 //计数器struct Vector3f { GLfloat x; GLfloat y;原创 2022-05-01 10:12:16 · 454 阅读 · 0 评论 -
OpenGL: Wireframe Rectangle(CR)
PART ONEcodes.cpp#include <stdio.h>#include <GL/glew.h>#include <GL/freeglut.h>#include <iostream>using namespace std;#define width 222#define height 207#define point_num 4 //顶点计数器#define triangle_num 2 //三角形计数器.原创 2022-04-30 21:07:56 · 246 阅读 · 0 评论 -
OpenGL: Wireframe Triangle(CR)
PART ONEcodes.cpp#include <stdio.h>#include <GL/glew.h>#include <GL/freeglut.h>#include <iostream>using namespace std;#define width 222#define height 207#define num 3 //顶点计数器struct Vector3f { GLfloat x; GLfloat原创 2022-04-30 17:59:36 · 264 阅读 · 0 评论 -
OpenGL: Points to Lines(CR)
PART ONEcodes.cpp#include <stdio.h>#include <GL/glew.h>#include <GL/freeglut.h>#include <iostream>using namespace std;#define width 222#define height 207#define num 3 //顶点计数器struct Vector3f { GLfloat x; GLfloat原创 2022-04-30 17:18:15 · 199 阅读 · 0 评论 -
OpenGL: Slope-ALGO(1)
PART ONEcodes.cpp#include <stdio.h>#include <GL/glew.h>#include <GL/freeglut.h>#include <iostream>using namespace std;#define width 222#define height 207#define num 2 //计数器struct Vector3f { GLfloat x; GLfloat y;原创 2022-04-30 16:43:00 · 303 阅读 · 0 评论 -
OpenGL: Points(CR)
PART ONEcodes.cpp#include <stdio.h>#include <GL/glew.h>#include <GL/freeglut.h>#define width 222#define height 207#define num 2 //计数器struct Vector3f { GLfloat x; GLfloat y; GLfloat z;};struct Color { int r; int g;原创 2022-04-30 12:50:26 · 141 阅读 · 0 评论 -
OpenGL: Point(CR)
PART ONEcode.cpp#include <stdio.h>#include <GL/glew.h>#include <GL/freeglut.h>#define width 222#define height 207struct Color { int r; int g; int b; int a;}color{255,0,0,255};GLubyte point[height][width][4];void initPoint原创 2022-04-30 09:46:54 · 174 阅读 · 0 评论 -
OpenGL: glDrawPixels&GLubyte
利用OpenGL在像素级别直接控制数据。原创 2022-04-28 13:50:00 · 507 阅读 · 0 评论