Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 有人能告诉我这是什么版本的opengl吗?_C++_Opengl - Fatal编程技术网

C++ 有人能告诉我这是什么版本的opengl吗?

C++ 有人能告诉我这是什么版本的opengl吗?,c++,opengl,C++,Opengl,你能告诉我这段代码是用什么版本的opengl编写的吗 //The triangles to the highest and deepest vertices: for (j = 0; j< (PointsPerRow-1); j++) { IndexVect.push_back(j); IndexVect.push_back(j+1); IndexVect.push_back((PointRows-2)*PointsPerRow); } IndexVect.push

你能告诉我这段代码是用什么版本的opengl编写的吗

//The triangles to the highest and deepest vertices:
for (j = 0; j< (PointsPerRow-1); j++)
{
    IndexVect.push_back(j);
    IndexVect.push_back(j+1);
    IndexVect.push_back((PointRows-2)*PointsPerRow);
}
IndexVect.push_back(j);
IndexVect.push_back(0);
IndexVect.push_back((PointRows-2)*PointsPerRow);

for (j = 0; j< (PointsPerRow-1); j++)
{
    IndexVect.push_back((PointRows-3)*PointsPerRow+j);
    IndexVect.push_back((PointRows-3)*PointsPerRow+j+1);
    IndexVect.push_back((PointRows-2)*PointsPerRow+1);
}
IndexVect.push_back((PointRows-3)*PointsPerRow+j);
IndexVect.push_back((PointRows-3)*PointsPerRow);
IndexVect.push_back((PointRows-2)*PointsPerRow+1);
Indices = new GLuint[IndexVect.size()];  //allocate the required memory
for (i = 0; i < IndexVect.size(); i++)
{
    Indices[i] = IndexVect[i];
}
NumIndices = IndexVect.size();
IndexVect.clear();  //no longer needed, takes only memory
//最高和最深顶点的三角形:
对于(j=0;j<(点箭头-1);j++)
{
指数矢量推回(j);
指数矢量推回(j+1);
索引向量推回((点行-2)*点箭头);
}
指数矢量推回(j);
索引向量推回(0);
索引向量推回((点行-2)*点箭头);
对于(j=0;j<(点箭头-1);j++)
{
索引向量推回((点行-3)*点箭头+j);
索引向量推回((点行-3)*点箭头+j+1);
索引向量推回((点行-2)*点箭头+1);
}
索引向量推回((点行-3)*点箭头+j);
索引向量推回((点行-3)*点箭头);
索引向量推回((点行-2)*点箭头+1);
索引=新的GLuint[IndexVect.size()]//分配所需的内存
对于(i=0;i
}


这是一个顶点数组核心,告诉我它是在哪个版本写的?

< p>第一个代码没有特定的OpenGL版本,除了GLINIT所有的东西都是标准C++(索引xxt看起来像一个STD::vector),Galint是一个基本的数字类型(比如无符号int,unSealStand,…),在每个OpenGL版本中使用。p> 代码没有OpenGL调用的原因是,它只定义CPU上对象的结构,不将数据复制到GPU,也不渲染任何内容

void Display(void) { 
       glClear(GL_COLOR_BUFFER_BIT); 
       glLoadIdentity();
       glTranslatef(0.0,0.0,-4.0);
       glRotatef(yRotated, 0.0, 1.0, 0.0);
       DrawSphere();
       glFlush();
       //Finish rendering
       glutSwapBuffers(); } 

这就是OpenGL,我在这里没有看到OpenGL特定的代码。。。。我的猜测是4.x,因为他们似乎在为IBO使用索引向量?根据您发布的代码,首先很难将其识别为OpenGL,更不用说给出它的具体版本了。你能试着用最新的OpenGL库来构建它,看看它是否有效吗。。。在OpenGL中非常常见。如果您试图检索代码运行的版本,可以尝试:glGetString(GL_版本);这将告诉你哪个版本的OpenGL正在运行。如果你想知道你需要运行哪个版本的代码,答案是我知道的OpenGL版本。抱歉,但是PuxEnCurb是C++的方法,而不是OpenGL方法,它看起来像OpenGL 2.1,可能是因为使用了<代码> GLD(T/D)/<代码>和<代码> GLTSLAFTFE()。
但也有可能是任何版本,因为这些函数已被弃用,但仍在几乎任何版本中受支持。