#require <gl/gl.sbp>

Namespace ActiveBasic
Namespace OpenGL

	'ディスプレイリストを扱うためのクラス
	Class DisplayList
	Public
		Sub DisplayList(size As Long)
			This.size = size
			list = glGenLists(size)
		End Sub
		Sub ~DisplayList()
			glDeleteLists(list, size)
		End Sub

	Public
		Sub Call()
			Call(0)
		End Sub
		Sub Call(index As Long)
			If index < size Then
				glCallList(list+index)
			End If
		End Sub
		Sub EndList()
			glEndList()
		End Sub
		Sub NewList(index As Long)
			glNewList(list+index,GL_COMPILE)
		End Sub
		Sub NewListExecute(index As Long)
			glNewList(list+index,GL_COMPILE_AND_EXECUTE)
		End Sub
	Private
		list As DWord
		size As Long
	End Class

End Namespace
End Namespace
