mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
graphicsdriver/opengl: Remove println and add error messages
This commit is contained in:
parent
fc50f9b0be
commit
9bf24ba545
@ -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)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user