graphicsdriver/opengl: Remove println and add error messages

This commit is contained in:
Hajime Hoshi 2020-05-24 23:15:00 +09:00
parent fc50f9b0be
commit 9bf24ba545

View File

@ -15,6 +15,8 @@
package opengl package opengl
import ( import (
"fmt"
"github.com/hajimehoshi/ebiten/internal/driver" "github.com/hajimehoshi/ebiten/internal/driver"
"github.com/hajimehoshi/ebiten/internal/shaderir" "github.com/hajimehoshi/ebiten/internal/shaderir"
) )
@ -50,17 +52,16 @@ func (s *Shader) Dispose() {
func (s *Shader) compile() error { func (s *Shader) compile() error {
vssrc, fssrc := s.ir.Glsl() vssrc, fssrc := s.ir.Glsl()
println(vssrc, fssrc)
vs, err := s.graphics.context.newShader(vertexShader, vssrc) vs, err := s.graphics.context.newShader(vertexShader, vssrc)
if err != nil { if err != nil {
return err return fmt.Errorf("opengl: vertex shader compile error: %v, source:\n%s", vssrc)
} }
defer s.graphics.context.deleteShader(vs) defer s.graphics.context.deleteShader(vs)
fs, err := s.graphics.context.newShader(fragmentShader, fssrc) fs, err := s.graphics.context.newShader(fragmentShader, fssrc)
if err != nil { if err != nil {
return err return fmt.Errorf("opengl: fragment shader compile error: %v, source:\n%s", fssrc)
} }
defer s.graphics.context.deleteShader(fs) defer s.graphics.context.deleteShader(fs)