remove pixelgl.Viewport, because Frame sets viewport
This commit is contained in:
parent
2f070dc302
commit
79ef8d51eb
|
@ -1,7 +1,6 @@
|
|||
package pixelgl
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"runtime"
|
||||
|
||||
"github.com/faiface/mainthread"
|
||||
|
@ -29,7 +28,6 @@ func NewFrame(width, height int, smooth bool) *Frame {
|
|||
}
|
||||
|
||||
gl.GenFramebuffers(1, &f.fb.obj)
|
||||
fmt.Println(f.fb.obj)
|
||||
|
||||
f.tex = NewTexture(width, height, smooth, make([]uint8, width*height*4))
|
||||
|
||||
|
@ -61,6 +59,7 @@ func (f *Frame) Height() int {
|
|||
// Begin binds the Frame. All draw operations will target this Frame until End is called.
|
||||
func (f *Frame) Begin() {
|
||||
f.fb.bind()
|
||||
gl.Viewport(0, 0, int32(f.width), int32(f.height))
|
||||
}
|
||||
|
||||
// End unbinds the Frame. All draw operations will go to whatever was bound before this Frame.
|
||||
|
|
|
@ -21,8 +21,3 @@ func Clear(r, g, b, a float32) {
|
|||
gl.ClearColor(r, g, b, a)
|
||||
gl.Clear(gl.COLOR_BUFFER_BIT)
|
||||
}
|
||||
|
||||
// Viewport sets the OpenGL viewport.
|
||||
func Viewport(x, y, w, h int32) {
|
||||
gl.Viewport(x, y, w, h)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue