在VB.net中使用OpenGL [英] Using OpenGL with VB.net

查看:332
本文介绍了在VB.net中使用OpenGL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用VB开发OpenGL应用程序.我曾经使用C ++ WinApi编程来做到这一点.在VB中使用它的问题是:如何在VB中插入OpenGL视图端口.我用Tao制作了一个View端口.我初始化了它的上下文.一切都很好,除非输出非常可笑.
例如:如果我给出一个简单的代码:

I would like to Develop OpenGL Applications with VB. I used to do it with C++WinApi Programming. The Problem with using it with VB is: How will i insert an OpenGL view port in VB. I used Tao to Make a View port. I initialized its Contexts. Everything was fine Except the Output Was Terrifically Ridiculous.
for Eg: if I give a simple code:

glClearColor(0.0, 0.0, 0.0, 0.0)
glClear(GL_COLOR_BUFFER_BIT)
glColor3f(1.0, 1.0, 1.0)
glOrtho(−1.0, 1.0, −1.0, 1.0, −1.0, 1.0)
glBegin(GL_POLYGON)
glVertex2f(−0.5, −0.5)
glVertex2f(−0.5, 0.5)
glVertex2f(0.5, 0.5)
glVertex2f(0.5, −0.5)
glEnd()
glFlush()


正常的输出必须像白色的矩形,输出就像一些变形的多边形.
我知道Tao通常与C#一起使用.我将如何使用VB.在此先谢谢!!


the normal output must be like a White Rectangle, the output is like some Deformed Polygon.
I know Tao is Usually used with C#.What will I do with VB. thanks IN advance!!

推荐答案

我认为glBegin(GL_POLYGON)是错误的.将其更改为glBegin(GL_TRIANGLES)
I think the glBegin(GL_POLYGON) is wrong. Change it into glBegin(GL_TRIANGLES)


这篇关于在VB.net中使用OpenGL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆