gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] gzz/gfx/demo fpfont.py


From: Janne V. Kujala
Subject: [Gzz-commits] gzz/gfx/demo fpfont.py
Date: Fri, 24 Jan 2003 08:46:20 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Janne V. Kujala <address@hidden>        03/01/24 08:46:20

Modified files:
        gfx/demo       : fpfont.py 

Log message:
        more

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/fpfont.py.diff?tr1=1.1&tr2=1.2&r1=text&r2=text

Patches:
Index: gzz/gfx/demo/fpfont.py
diff -u gzz/gfx/demo/fpfont.py:1.1 gzz/gfx/demo/fpfont.py:1.2
--- gzz/gfx/demo/fpfont.py:1.1  Fri Jan 24 08:21:17 2003
+++ gzz/gfx/demo/fpfont.py      Fri Jan 24 08:46:20 2003
@@ -1,5 +1,21 @@
+from gfx.util.demokeys import *
+from gfx.util.misc import *
+from gfx.libpaper.texcache import getCachedTexture
+import gzz.media.impl
+from gfx.util.fparb import dump
 
 
+pis = gzz.media.impl.PageImageScroll(None, gzz.mediaserver.Mediaserver.Id(
+    "01E1682758ABF63E7833692653A5DE46EA53A6F8AA"))
+
+rect = GLSpans.getRect(pis.getCurrent())
+
+texid = rect.texId
+
+if globals().has_key("fp"):
+       fp.deleteObject()
+
+fp = GL.createProgram(
 """!!ARBfp1.0
 
 # Sharpen the texture value 
@@ -26,5 +42,82 @@
 MOV result.color, p;
 END
 """
+)
+dump(fp.getProgId())
+
+class Scene:
+    def __init__(self):
+       self.key = KeyPresses(self,
+           SlideLin("x", 0, 30, "x coord", "Left", "Right"),
+           SlideLin("y", 0, 30, "x coord", "Up", "Down"),
+       )
+
+    def scene(self, vs):
+       putnoc(vs, background((.5,.5,.5)))
+
+        cs1 = vs.coords.affineCoordsys(0, 0, self.x, self.y, 
+           1000, 0, 0, 1000)
+       vs.matcher.add(cs1, "1")
+
+        vs.map.put(getDList("""
+        BindProgramARB FRAGMENT_PROGRAM_ARB %s
+       #Enable FRAGMENT_PROGRAM_ARB
+
+        ActiveTexture TEXTURE0
+        TexGen S TEXTURE_GEN_MODE OBJECT_LINEAR
+        TexGen T TEXTURE_GEN_MODE OBJECT_LINEAR
+        TexGen S OBJECT_PLANE 1 0 0 0
+        TexGen T OBJECT_PLANE 0 1 0 0
+        Enable TEXTURE_GEN_S
+        Enable TEXTURE_GEN_T
+
+        ActiveTexture TEXTURE1
+        TexGen S TEXTURE_GEN_MODE OBJECT_LINEAR
+        TexGen T TEXTURE_GEN_MODE OBJECT_LINEAR
+        TexGen S OBJECT_PLANE 1 0 0 .001
+        TexGen T OBJECT_PLANE 0 1 0 0
+        Enable TEXTURE_GEN_S
+        Enable TEXTURE_GEN_T
+
+        ActiveTexture TEXTURE2
+        TexGen S TEXTURE_GEN_MODE OBJECT_LINEAR
+        TexGen T TEXTURE_GEN_MODE OBJECT_LINEAR
+        TexGen S OBJECT_PLANE 1 0 0 0
+        TexGen T OBJECT_PLANE 0 1 0 .001
+        Enable TEXTURE_GEN_S
+        Enable TEXTURE_GEN_T
+
+        ActiveTexture TEXTURE3
+        TexGen S TEXTURE_GEN_MODE OBJECT_LINEAR
+        TexGen T TEXTURE_GEN_MODE OBJECT_LINEAR
+        TexGen S OBJECT_PLANE 1 0 0 -.001
+        TexGen T OBJECT_PLANE 0 1 0 0
+        Enable TEXTURE_GEN_S
+        Enable TEXTURE_GEN_T
+
+        ActiveTexture TEXTURE4
+        TexGen S TEXTURE_GEN_MODE OBJECT_LINEAR
+        TexGen T TEXTURE_GEN_MODE OBJECT_LINEAR
+        TexGen S OBJECT_PLANE 1 0 0 0
+        TexGen T OBJECT_PLANE 0 1 0 -.001
+        Enable TEXTURE_GEN_S
+        Enable TEXTURE_GEN_T
+
+        ActiveTexture TEXTURE0
+        
+       BindTexture TEXTURE_2D %s
+       Enable TEXTURE_2D
+        Color 1 1 1
+        Begin QUAD_STRIP
+        Vertex 0 0
+        Vertex 0 1
+        Vertex 1 0
+        Vertex 1 1
+        End
+        Disable FRAGMENT_PROGRAM_ARB
+        """ % (fp.getProgId(), texid)), cs1)
+
+
+currentScene = Scene()
 
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]