mirror of
https://github.com/bloeys/nmage.git
synced 2025-12-29 13:28:20 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b44b00d7e2 |
@ -7,10 +7,13 @@ import (
|
|||||||
|
|
||||||
type Buffer struct {
|
type Buffer struct {
|
||||||
VAOID uint32
|
VAOID uint32
|
||||||
//BufID is the ID of the VBO
|
// BufID is the ID of the VBO
|
||||||
BufID uint32
|
BufID uint32
|
||||||
//IndexBufID is the ID of the index/element buffer
|
// IndexBufID is the ID of the index/element buffer
|
||||||
IndexBufID uint32
|
IndexBufID uint32
|
||||||
|
// IndexBufCount is the number of elements in the index buffer
|
||||||
|
// Updated on SetIndexBufData
|
||||||
|
IndexBufCount int32
|
||||||
// IndexBufCount int32
|
// IndexBufCount int32
|
||||||
Stride int32
|
Stride int32
|
||||||
|
|
||||||
@ -59,7 +62,7 @@ func (b *Buffer) SetDataWithUsage(values []float32, usage BufUsage) {
|
|||||||
|
|
||||||
func (b *Buffer) SetIndexBufData(values []uint32) {
|
func (b *Buffer) SetIndexBufData(values []uint32) {
|
||||||
|
|
||||||
// b.IndexBufCount = int32(len(values))
|
b.IndexBufCount = int32(len(values))
|
||||||
gl.BindVertexArray(b.VAOID)
|
gl.BindVertexArray(b.VAOID)
|
||||||
gl.BindBuffer(gl.ELEMENT_ARRAY_BUFFER, b.IndexBufID)
|
gl.BindBuffer(gl.ELEMENT_ARRAY_BUFFER, b.IndexBufID)
|
||||||
|
|
||||||
@ -80,8 +83,8 @@ func (b *Buffer) GetLayout() []Element {
|
|||||||
return e
|
return e
|
||||||
}
|
}
|
||||||
|
|
||||||
//SetLayout updates the layout object and the corresponding vertex attributes.
|
// SetLayout updates the layout object and the corresponding vertex attributes.
|
||||||
//Vertex attributes are also enabled.
|
// Vertex attributes are also enabled.
|
||||||
func (b *Buffer) SetLayout(layout ...Element) {
|
func (b *Buffer) SetLayout(layout ...Element) {
|
||||||
|
|
||||||
b.layout = layout
|
b.layout = layout
|
||||||
|
|||||||
Reference in New Issue
Block a user