Author: JaroslawTworek
Date: 2008-01-25 07:55:39 +0000 (Fri, 25 Jan 2008)
New Revision: 799
Modified:
trunk/pysoy/examples/vid_billboard.py
trunk/pysoy/src/widgets/Canvas.pxi
Log:
Fixed vid_billboard.py and made fps texture actually display something
Modified: trunk/pysoy/examples/vid_billboard.py
===================================================================
--- trunk/pysoy/examples/vid_billboard.py 2008-01-25 07:32:12 UTC (rev
798)
+++ trunk/pysoy/examples/vid_billboard.py 2008-01-25 07:55:39 UTC (rev
799)
@@ -32,4 +32,5 @@
if __name__ == '__main__' :
while True:
- sleep(10)
+ sleep(0.3)
+ fps.text = str(cam.fps)
Modified: trunk/pysoy/src/widgets/Canvas.pxi
===================================================================
--- trunk/pysoy/src/widgets/Canvas.pxi 2008-01-25 07:32:12 UTC (rev 798)
+++ trunk/pysoy/src/widgets/Canvas.pxi 2008-01-25 07:55:39 UTC (rev 799)
@@ -74,19 +74,35 @@
cdef void _render(self) :
if not self._texture :
return
+ (<soy.textures.Texture> self._texture)._bind()
+
+ if (<soy.textures.Texture> self._texture)._chans & 1:
+ gl.glDisable(gl.GL_BLEND)
+ else:
+ gl.glEnable(gl.GL_BLEND)
+ gl.glBlendFunc(gl.GL_SRC_ALPHA, gl.GL_ONE_MINUS_SRC_ALPHA)
+
gl.glViewport(self._xpos, self._ypos, self._width, self._height)
gl.glMatrixMode(gl.GL_PROJECTION)
gl.glLoadIdentity()
gl.glOrtho(0.0, 1.0, 0.0, 1.0, -1, 1)
gl.glMatrixMode(gl.GL_MODELVIEW)
gl.glLoadIdentity()
+
if gl.GLEW_ARB_vertex_buffer_object :
gl.glBindBufferARB (gl.GL_ELEMENT_ARRAY_BUFFER_ARB, 0)
gl.glBindBufferARB (gl.GL_ARRAY_BUFFER_ARB, 0)
+
gl.glVertexPointer (3, gl.GL_FLOAT, 36, &self._verts[0].px)
gl.glNormalPointer ( gl.GL_FLOAT, 36, &self._verts[0].nx)
gl.glTexCoordPointer(3, gl.GL_FLOAT, 36, &self._verts[0].tx)
- (<soy.textures.Texture> self._texture)._bind()
gl.glDrawElements (gl.GL_TRIANGLES, 6, gl.GL_UNSIGNED_SHORT,
<unsigned short *> self._faces)
+
+ if (<soy.textures.Texture> self._texture)._chans & 1:
+ pass
+ else:
+ gl.glDisable(gl.GL_BLEND)
+
+
(<soy.textures.Texture> self._texture)._unbind()
_______________________________________________
PySoy-SVN mailing list
[email protected]
http://www.pysoy.org/mailman/listinfo/pysoy-svn