mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 02:38:53 +01:00
graphics: Move a comment
This commit is contained in:
parent
aa83167e56
commit
37473d2f9f
@ -52,6 +52,8 @@ func (q *commandQueue) Flush(context *opengl.Context) error {
|
||||
if 0 < len(vertices) {
|
||||
context.BufferSubData(context.ArrayBuffer, vertices)
|
||||
}
|
||||
// NOTE: WebGL doesn't seem to have Check gl.MAX_ELEMENTS_VERTICES or gl.MAX_ELEMENTS_INDICES so far.
|
||||
// Let's use them to compare to len(quads) in the future.
|
||||
if MaxQuads < len(vertices)/16 {
|
||||
return errors.New(fmt.Sprintf("len(quads) must be equal to or less than %d", MaxQuads))
|
||||
}
|
||||
@ -97,8 +99,6 @@ func (c *drawImageCommand) Exec(context *opengl.Context) error {
|
||||
}
|
||||
context.BlendFunc(c.mode)
|
||||
|
||||
// NOTE: WebGL doesn't seem to have Check gl.MAX_ELEMENTS_VERTICES or gl.MAX_ELEMENTS_INDICES so far.
|
||||
// Let's use them to compare to len(quads) in the future.
|
||||
n := len(c.vertices) / 16
|
||||
if n == 0 {
|
||||
return nil
|
||||
|
@ -116,7 +116,9 @@ func (f *Framebuffer) DrawTexture(context *opengl.Context, t *Texture, vertices
|
||||
// Drawing a texture to the default buffer must be the last command.
|
||||
// TODO(hajimehoshi): This seems a little hacky. Refactor.
|
||||
if f.native == opengl.ZeroFramebuffer {
|
||||
return theCommandQueue.Flush(context)
|
||||
if err := theCommandQueue.Flush(context); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user