You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
VAOs are used as a shorthand for setting the state of the vertex processor, and, once the vertex attributes and pointers are set while a VAO is bound, subsequently binding the VAO does not require setting the vertex attribute buffers and pointers.
Right now, in the single triangle example, we access VAOs using the low-level OpenGL API:
have a foreach and a macro associated, just like with other kinds of using objects - it sets and unsets the VAO
add a def vertexArrayObject(vao: VertexArrayObject) = VertexArrayObjectObject
This should allow the following syntax:
val vao = new VertexArrayObject
vao.acquire()
// loop
for {
_ <- using.vertexArrayObject(vao)
... all the rest ...
} {
// rendering
}
// later
vao.release()
Then, I would create a lazy default VAO lying somewhere in package.scala:
Default.VAO
So that the developers can fetch it immediately without creating it:
for {
_ <- using.vertexArrayObject(Default.VAO)
} {
The text was updated successfully, but these errors were encountered:
VAOs are used as a shorthand for setting the state of the vertex processor, and, once the vertex attributes and pointers are set while a VAO is bound, subsequently binding the VAO does not require setting the vertex attribute buffers and pointers.
Right now, in the single triangle example, we access VAOs using the low-level OpenGL API:
https://github.com/storm-enroute/macrogl/blob/master/src/test/scala/org/macrogl/examples/SingleTriangle.scala#L14
We need a better support for VAOs.
We must do the following:
VertexArrayObject.scala
, which extendsHandle
, and itsacquire
generates a name, just likeProgram
,Texture
,RenderBuffer
and othersobject VertexArrayObjectObject { def foreach = ... }
inusing
: https://github.com/storm-enroute/macrogl/blob/master/src/main/scala/org/macrogl/package.scala#L115foreach
and a macro associated, just like with other kinds ofusing
objects - it sets and unsets the VAOdef vertexArrayObject(vao: VertexArrayObject) = VertexArrayObjectObject
This should allow the following syntax:
Then, I would create a lazy default VAO lying somewhere in
package.scala
:So that the developers can fetch it immediately without creating it:
The text was updated successfully, but these errors were encountered: