Exemplo n.º 1
0
func (lr *LinesRenderer) Delete() (err error) {
	gl.BindBuffer(gl.ARRAY_BUFFER, 0)
	gl.BindBuffer(gl.ELEMENT_ARRAY_BUFFER, 0)
	gl.DeleteBuffers(1, &lr.buffer)
	gl.DeleteBuffers(1, &lr.indexBuffer)
	if e := gl.GetError(); e != 0 {
		err = fmt.Errorf("ERROR: OpenGL error %X", e)
	}
	return
}
Exemplo n.º 2
0
func (r *EffectsRenderer) Delete() error {
	gl.BindTexture(gl.TEXTURE_2D, 0)
	gl.BindFramebuffer(gl.FRAMEBUFFER, 0)
	gl.BindRenderbuffer(gl.RENDERBUFFER, 0)
	gl.BindBuffer(gl.ARRAY_BUFFER, 0)
	gl.DeleteFramebuffers(1, &r.framebuffer)
	gl.DeleteTextures(1, &r.texture)
	gl.DeleteBuffers(1, &r.coords)
	return r.GetError()
}
Exemplo n.º 3
0
func (r *GlowRenderer) Delete() error {
	gl.BindTexture(gl.TEXTURE_2D, 0)
	gl.BindFramebuffer(gl.FRAMEBUFFER, 0)
	gl.BindRenderbuffer(gl.RENDERBUFFER, 0)
	gl.BindBuffer(gl.ARRAY_BUFFER, 0)
	gl.DeleteFramebuffers(1, &r.GlowFb)
	gl.DeleteTextures(1, &r.GlowTex)
	gl.DeleteFramebuffers(1, &r.BlurFb)
	gl.DeleteTextures(1, &r.BlurTex)
	gl.DeleteBuffers(1, &r.coords)
	return r.GetError()
}
Exemplo n.º 4
0
func Cleanup() {
	gl.DeleteBuffers(1, &vbo)

}
Exemplo n.º 5
0
func (b *Batch) Delete() {
	b.Texture.Delete()
	gl.BindBuffer(gl.ARRAY_BUFFER, 0)
	gl.DeleteBuffers(1, &b.Buffer)
}
Exemplo n.º 6
0
func (b *GLBuffer) Delete() {
	gl.DeleteBuffers(1, &b.id)
}
Exemplo n.º 7
0
// Release releases font resources.
// A font can no longer be used for rendering after this call completes.
func (t *Text) Release() {
	gl.DeleteBuffers(1, &t.vbo)
	gl.DeleteBuffers(1, &t.ebo)
	gl.DeleteBuffers(1, &t.vao)
}
Exemplo n.º 8
0
func (tr *SpriteRenderer) Delete() error {
	gl.BindBuffer(gl.ARRAY_BUFFER, 0)
	gl.DeleteBuffers(1, &tr.instanceVBO)
	return nil
}
Exemplo n.º 9
0
func (b *BoundingBox) Release() {
	gl.DeleteBuffers(1, &b.vbo)
	gl.DeleteBuffers(1, &b.ebo)
	gl.DeleteBuffers(1, &b.vao)
}
Exemplo n.º 10
0
// Cleaning up the memory from a LineReader.
func (lr *LineRender) Destroy() {
	gl.DeleteVertexArrays(1, &lr.vao)
	gl.DeleteBuffers(1, &lr.vbo)
	gl.DeleteBuffers(1, &lr.ebo)
}
Exemplo n.º 11
0
// Destroying the resources of a RenderObject.
func (renderObject *RenderObject) Destroy() {
	gl.DeleteVertexArrays(1, &renderObject.vao)
	gl.DeleteBuffers(1, &renderObject.vbo)
	gl.DeleteBuffers(1, &renderObject.ebo)
}
Exemplo n.º 12
0
func (tr *TextRenderer) Delete() error {
	gl.BindBuffer(gl.ARRAY_BUFFER, 0)
	gl.DeleteBuffers(1, &tr.VBO)
	return nil
}
Exemplo n.º 13
0
//Delete is the implementation of the opengl object interface. Delete this object
//from the opengl context
func (vertexArray VertexArray) Delete() {
	gl.DeleteBuffers(1, &vertexArray.handleVAO)
}