用意するもの:NoVVest氏の
API定義ファイル集
これのglフォルダをABのincludeフォルダに入れる。
#include <gl/glut.sbp>
Const PI = 3.141592
'描写処理
Sub disp()
Dim x As Double, y As Double, z As Double
Dim th As Double
glClear(GL_COLOR_BUFFER_BIT)
glColor3f(0.0, 1.0, 0.0)'色RGB
glBegin (GL_LINES)
For th=0 To PI*2+0.01 Step PI*2/10
x = 0.2 * Cos(th) : y = 0.2 * Sin(th) : z = 0.0
glVertex3f(x, y, z)
x = 0.8 * Cos(th) : y = 0.8 * Sin(th) : z = 0.0
glVertex3f(x, y, z)
Next
glEnd()
glFlush()'描写
End Sub
'いつものmain
Sub main()
Dim argc As Long
Dim argv As **Byte
argc=1
argv = malloc(argc)
argv[0] = "test"
argv[1] = NULL
glutInit(VarPtr(argc), argv)
glutInitWindowPosition(100 , 100)
glutInitWindowSize(400 , 400)
glutInitDisplayMode(GLUT_SINGLE or GLUT_RGBA)
glutCreateWindow("test GLUT")
glutDisplayFunc(AddressOf(disp))
glutMainLoop()
free(argv)
End Sub
main()
最終更新:2010年12月02日 02:41