/[gzz]/gzz/gfx/librenderables/renderables.py
ViewVC logotype

Diff of /gzz/gfx/librenderables/renderables.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.166 by mudyc, Wed Dec 18 16:12:32 2002 UTC revision 1.167 by tjl, Thu Dec 26 12:44:40 2002 UTC
# Line 1423  rs = [ Line 1423  rs = [
1423          """,          """,
1424  }    ,  }    ,
1425    
1426            # For testing out things: just render a mesh.
1427    # Use vertex programs to do interesting stuff.
1428    {
1429        "Type" : "0",
1430        "Name": "SimpleDiced",
1431        "Data": """int flags;
1432                int ndice;
1433                """,
1434        "Params" : "int flags, int ndice",
1435        "ParamCode" : """
1436                this->flags = flags;
1437                this->ndice = ndice;
1438                """,
1439        "ExtraClass" : """
1440            void vert(int x, int y) {
1441                DBG(dbg) << "SimplDiced vert "<<x<<" "<<y<<"\n";
1442                glVertex2f(x / (ndice-1.0), y / (ndice-1.0));
1443            }
1444        """,
1445        "RenderCode" : """
1446            register int flags = this->flags;
1447            GLERR
1448            for(int i=0; i<ndice-1; i++) {
1449                glBegin(GL_TRIANGLE_STRIP);
1450                DBG(dbg) << "SimpleDiced Begin strip "<<i<<"\n";
1451                for(int j=0; j<ndice; j++) {
1452                    if(flags&1) {
1453                        if(j < ndice-i)
1454                            vert(i, j);
1455                        if(j < ndice-(i+1))
1456                            vert((i+1), j);
1457                    } else {
1458                        vert(i, j);
1459                        vert(i+1, j);
1460                    }
1461                }
1462                DBG(dbg) << "SimpleDiced End strip "<<i<<"\n";
1463                glEnd();
1464                GLERR
1465            }
1466        """
1467    },
1468    
1469    
1470  # coords1: paper => window  # coords1: paper => window
1471  # coords2: frame => paper (assumed to be affine)  # coords2: frame => paper (assumed to be affine)

Legend:
Removed from v.1.166  
changed lines
  Added in v.1.167

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26