关于OpenGL shader 的问题
有如下一段代码:voidLandDisplay(){glBegin(GL_LINES);glColor3f(1.0f,0.0f,0.0f);for(GLfloatx=-1...
有如下一段代码:
void LandDisplay(){
glBegin(GL_LINES);
glColor3f(1.0f, 0.0f, 0.0f);
for (GLfloat x = -100; x < 100;x+=1.0f)
{glVertex3f(x, 0, -100); glVertex3f(x, 0, 100);}
for (GLfloat z = -150; z < 100;z+=1.0f)
{glVertex3f(-150, 0, z); glVertex3f( 100, 0, z);}
glEnd();
}
听说OpenGL 4.0就抛弃了glBegin(GL_LINES) 这种规范?那么请问这段代码如果用shader怎么写?谢谢了 展开
void LandDisplay(){
glBegin(GL_LINES);
glColor3f(1.0f, 0.0f, 0.0f);
for (GLfloat x = -100; x < 100;x+=1.0f)
{glVertex3f(x, 0, -100); glVertex3f(x, 0, 100);}
for (GLfloat z = -150; z < 100;z+=1.0f)
{glVertex3f(-150, 0, z); glVertex3f( 100, 0, z);}
glEnd();
}
听说OpenGL 4.0就抛弃了glBegin(GL_LINES) 这种规范?那么请问这段代码如果用shader怎么写?谢谢了 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询