mirror of https://github.com/kivy/kivy.git
fbo: allow the user to call bind/release
This commit is contained in:
parent
97ea6f4d49
commit
1ad67a3c4f
|
@ -15,9 +15,9 @@ cdef class Fbo(RenderContext):
|
||||||
cdef int _is_bound
|
cdef int _is_bound
|
||||||
|
|
||||||
cpdef clear_buffer(self)
|
cpdef clear_buffer(self)
|
||||||
|
cpdef bind(self)
|
||||||
|
cpdef release(self)
|
||||||
|
|
||||||
cdef bind(self)
|
|
||||||
cdef release(self)
|
|
||||||
cdef create_fbo(self)
|
cdef create_fbo(self)
|
||||||
cdef delete_fbo(self)
|
cdef delete_fbo(self)
|
||||||
cdef apply(self)
|
cdef apply(self)
|
||||||
|
|
|
@ -180,7 +180,7 @@ cdef class Fbo(RenderContext):
|
||||||
projection_mat.view_clip(0.0, self._width, 0.0, self._height, -1.0, 1.0, 0)
|
projection_mat.view_clip(0.0, self._width, 0.0, self._height, -1.0, 1.0, 0)
|
||||||
self.set_state('projection_mat', projection_mat)
|
self.set_state('projection_mat', projection_mat)
|
||||||
|
|
||||||
cdef bind(self):
|
cpdef bind(self):
|
||||||
if self._is_bound:
|
if self._is_bound:
|
||||||
raise FboException('FBO is already binded.')
|
raise FboException('FBO is already binded.')
|
||||||
else:
|
else:
|
||||||
|
@ -195,7 +195,7 @@ cdef class Fbo(RenderContext):
|
||||||
glGetIntegerv(GL_VIEWPORT, <GLint *>&self._viewport)
|
glGetIntegerv(GL_VIEWPORT, <GLint *>&self._viewport)
|
||||||
glViewport(0, 0, self._width, self._height)
|
glViewport(0, 0, self._width, self._height)
|
||||||
|
|
||||||
cdef release(self):
|
cpdef release(self):
|
||||||
if self._is_bound == 0:
|
if self._is_bound == 0:
|
||||||
raise FboException('Cannot release a FBO not binded.')
|
raise FboException('Cannot release a FBO not binded.')
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue