/[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.103 by mudyc, Thu Oct 10 14:41:05 2002 UTC revision 1.104 by mudyc, Mon Oct 14 10:01:44 2002 UTC
# Line 310  rs = [ Line 310  rs = [
310  {  {
311      "Type" : "2",      "Type" : "2",
312      "Name": "PaperQuad",      "Name": "PaperQuad",
313      "Data": "float x0, y0, x1, y1; Paper::Paper* paper; float scale;float dicefactor;",      "Data": "float x0, y0, x1, y1; Paper::Paper* paper; float scale;float dicefactor; int flags;",
314      "Params" : """      "Params" : """
315              Paper paper, float x0, float y0, float x1, float y1,              Paper paper, float x0, float y0, float x1, float y1,
316              float scale, float dicefactor              float scale, float dicefactor, int flags
317          """,          """,
318      "ParamCode" : """      "ParamCode" : """
319              this->paper = paper;              this->paper = paper;
# Line 323  rs = [ Line 323  rs = [
323              this->y1 = y1;              this->y1 = y1;
324              this->scale = scale;              this->scale = scale;
325              this->dicefactor = dicefactor;              this->dicefactor = dicefactor;
326                this->flags = flags;
327          """,          """,
328      "RenderCode" : """      "RenderCode" : """
329              Coords &coords2inv = *coords2.getInverse();              Coords &coords2inv = *coords2.getInverse();
# Line 409  rs = [ Line 410  rs = [
410    
411              for(Paper::Paper::iterator it = paper->begin(); it != paper->end(); ++it) {              for(Paper::Paper::iterator it = paper->begin(); it != paper->end(); ++it) {
412    
413                  // XXX                  if (flags & VERTEX_PROGRAM) {
                 if (true) {  
414                      DBG(dbg_paperquad) << "Pass\\n";                      DBG(dbg_paperquad) << "Pass\\n";
415                      GLERR                      GLERR
416                      (*it).setUp_VP(&lightParam);                      (*it).setUp_VP(&lightParam);
# Line 465  rs = [ Line 465  rs = [
465  {  {
466      "Type" : "3",      "Type" : "3",
467      "Name": "CulledPaperQuad",      "Name": "CulledPaperQuad",
468      "Data": "float x0, y0, x1, y1; Paper::Paper* paper; float scale;float dicefactor;",      "Data": "float x0, y0, x1, y1; Paper::Paper* paper; float scale;float dicefactor; int flags;",
469      "Params" : """      "Params" : """
470              Paper paper, float x0, float y0, float x1, float y1,              Paper paper, float x0, float y0, float x1, float y1,
471              float scale, float dicefactor              float scale, float dicefactor, int flags
472          """,          """,
473      "ParamCode" : """      "ParamCode" : """
474              this->paper = paper;              this->paper = paper;
# Line 478  rs = [ Line 478  rs = [
478              this->y1 = y1;              this->y1 = y1;
479              this->scale = scale;              this->scale = scale;
480              this->dicefactor = dicefactor;              this->dicefactor = dicefactor;
481                this->flags = flags;
482          """,          """,
483      "RenderCode" : """      "RenderCode" : """
484              Coords &coords2inv = *coords2.getInverse();              Coords &coords2inv = *coords2.getInverse();
# Line 593  rs = [ Line 594  rs = [
594    
595              for(Paper::Paper::iterator it = paper->begin(); it != paper->end(); ++it) {              for(Paper::Paper::iterator it = paper->begin(); it != paper->end(); ++it) {
596    
597                  // XXX                  if (flags & VERTEX_PROGRAM) {
                 if (true) {  
598                      DBG(dbg_paperquad) << "Pass\\n";                      DBG(dbg_paperquad) << "Pass\\n";
599                      (*it).setUp_VP(&lightParam);                      (*it).setUp_VP(&lightParam);
600    
# Line 1244  jni = headercode = """ Line 1244  jni = headercode = """
1244    
1245  headercode += """  headercode += """
1246  namespace Renderables {  namespace Renderables {
1247    
1248       const int VERTEX_PROGRAM = 0x0001;
1249    
1250  """  """
1251    
1252  for r in rs:  for r in rs:
# Line 1337  import gzz.client.GraphicsAPI; Line 1340  import gzz.client.GraphicsAPI;
1340    
1341  public class GLRen extends GL {  public class GLRen extends GL {
1342    
1343        public static final int VERTEX_PROGRAM = 0x0001;
1344    
1345    
1346      // ----  Shorthands.      // ----  Shorthands.
1347      public static PaperQuad createPaperQuad(Paper paper,      public static PaperQuad createPaperQuad(Paper paper,
1348              float x0, float y0, float x1, float y1, float dicefactor) {              float x0, float y0, float x1, float y1, float dicefactor) {
1349          return createPaperQuad(paper, x0, y0, x1, y1, 1, dicefactor);  
1350                int flags = 0;
1351                if (GL.hasExtension("GL_NV_vertex_program1_1")) {
1352                   flags |= VERTEX_PROGRAM;
1353                } else {
1354                   flags &= ~VERTEX_PROGRAM;
1355                }
1356                
1357            return createPaperQuad(paper, x0, y0, x1, y1, 1, dicefactor, flags);
1358        }
1359        public static PaperQuad createPaperQuad(Paper paper,
1360                float x0, float y0, float x1, float y1, float dicefactor, int flags) {
1361            return createPaperQuad(paper, x0, y0, x1, y1, 1, dicefactor, flags);
1362      }      }
1363    
1364      public static CulledPaperQuad createCulledPaperQuad(Paper paper,      public static CulledPaperQuad createCulledPaperQuad(Paper paper,
1365              float x0, float y0, float x1, float y1, float dicefactor) {              float x0, float y0, float x1, float y1, float dicefactor) {
1366          return createCulledPaperQuad(paper, x0, y0, x1, y1, 1, dicefactor);              
1367                int flags = 0;
1368    
1369                if (GL.hasExtension("GL_NV_vertex_program1_1")) {
1370                   flags |= VERTEX_PROGRAM;
1371                } else {
1372                   flags &= ~VERTEX_PROGRAM;
1373                }
1374                
1375            return createCulledPaperQuad(paper, x0, y0, x1, y1, 1, dicefactor, flags);
1376        }
1377        public static CulledPaperQuad createCulledPaperQuad(Paper paper,
1378                float x0, float y0, float x1, float y1, float dicefactor, int flags) {
1379            return createCulledPaperQuad(paper, x0, y0, x1, y1, 1, dicefactor, flags);
1380      }      }
1381    
1382      public static gzz.vob.Vob createCallList(String s) {      public static gzz.vob.Vob createCallList(String s) {

Legend:
Removed from v.1.103  
changed lines
  Added in v.1.104

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