mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 03:38:55 +01:00
opengl: Remove arrayBufferLayoutPart.dataType
This commit is contained in:
parent
00f28dd896
commit
82e9f227d1
@ -27,7 +27,6 @@ import (
|
||||
type arrayBufferLayoutPart struct {
|
||||
// TODO: This struct should belong to a program and know it.
|
||||
name string
|
||||
dataType DataType
|
||||
num int
|
||||
}
|
||||
|
||||
@ -47,7 +46,7 @@ func (a *arrayBufferLayout) totalBytes() int {
|
||||
}
|
||||
t := 0
|
||||
for _, p := range a.parts {
|
||||
t += p.dataType.SizeInBytes() * p.num
|
||||
t += Float.SizeInBytes() * p.num
|
||||
}
|
||||
a.total = t
|
||||
return a.total
|
||||
@ -66,8 +65,8 @@ func (a *arrayBufferLayout) enable(program program) {
|
||||
total := a.totalBytes()
|
||||
offset := 0
|
||||
for _, p := range a.parts {
|
||||
GetContext().vertexAttribPointer(program, p.name, p.num, p.dataType, total, offset)
|
||||
offset += p.dataType.SizeInBytes() * p.num
|
||||
GetContext().vertexAttribPointer(program, p.name, p.num, Float, total, offset)
|
||||
offset += Float.SizeInBytes() * p.num
|
||||
}
|
||||
}
|
||||
|
||||
@ -88,17 +87,14 @@ func initializeArrayBuferLayout() {
|
||||
parts: []arrayBufferLayoutPart{
|
||||
{
|
||||
name: "vertex",
|
||||
dataType: Float,
|
||||
num: 2,
|
||||
},
|
||||
{
|
||||
name: "tex_coord",
|
||||
dataType: Float,
|
||||
num: 4,
|
||||
},
|
||||
{
|
||||
name: "color_scale",
|
||||
dataType: Float,
|
||||
num: 4,
|
||||
},
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user