mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
graphicsutil: Remove dependency on opengl
This commit is contained in:
parent
ff54d3b681
commit
fde9fd2d0e
@ -127,7 +127,7 @@ func (q *commandQueue) EnqueueDrawImageCommand(dst, src *Image, vertices []float
|
||||
|
||||
q.appendVertices(vertices)
|
||||
q.appendIndices(indices, uint16(q.nextIndex))
|
||||
q.nextIndex += len(vertices) * opengl.Float.SizeInBytes() / VertexSizeInBytes()
|
||||
q.nextIndex += len(vertices) * opengl.Float.SizeInBytes() / theArrayBufferLayout.totalBytes()
|
||||
q.tmpNumIndices += len(indices)
|
||||
|
||||
q.doEnqueueDrawImageCommand(dst, src, len(vertices), len(indices), color, mode, filter, split)
|
||||
@ -225,9 +225,9 @@ type drawImageCommand struct {
|
||||
filter graphics.Filter
|
||||
}
|
||||
|
||||
// VertexSizeInBytes returns the size in bytes of one vertex.
|
||||
func VertexSizeInBytes() int {
|
||||
return theArrayBufferLayout.totalBytes()
|
||||
// VertexFloatNum returns the number of floats for one vertex.
|
||||
func VertexFloatNum() int {
|
||||
return theArrayBufferLayout.totalBytes() / opengl.Float.SizeInBytes()
|
||||
}
|
||||
|
||||
func (c *drawImageCommand) String() string {
|
||||
|
@ -16,7 +16,6 @@ package graphicsutil
|
||||
|
||||
import (
|
||||
"github.com/hajimehoshi/ebiten/internal/graphicscommand"
|
||||
"github.com/hajimehoshi/ebiten/internal/opengl"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -30,7 +29,7 @@ type verticesBackend struct {
|
||||
|
||||
func (v *verticesBackend) sliceForOneQuad() []float32 {
|
||||
const num = 256
|
||||
size := 4 * graphicscommand.VertexSizeInBytes() / opengl.Float.SizeInBytes()
|
||||
size := 4 * graphicscommand.VertexFloatNum()
|
||||
if v.backend == nil {
|
||||
v.backend = make([]float32, size*num)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user