fenfire-commits
[Top][All Lists]
Advanced

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

[ff-cvs] callgl examples/calltest.cxx include/callgl.hxx...


From: Tuomas J. Lukka
Subject: [ff-cvs] callgl examples/calltest.cxx include/callgl.hxx...
Date: Sun, 21 Sep 2003 09:34:57 -0400

CVSROOT:        /cvsroot/callgl
Module name:    callgl
Branch:         
Changes by:     Tuomas J. Lukka <address@hidden>        03/09/21 09:34:57

Modified files:
        examples       : calltest.cxx 
        include        : callgl.hxx callgl_objects.hxx 
        src            : callgl.cxx 

Log message:
        Arch sync

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/callgl/callgl/examples/calltest.cxx.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/callgl/callgl/include/callgl.hxx.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/callgl/callgl/include/callgl_objects.hxx.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/callgl/callgl/src/callgl.cxx.diff?tr1=1.9&tr2=1.10&r1=text&r2=text

Patches:
Index: callgl/examples/calltest.cxx
diff -u callgl/examples/calltest.cxx:1.1 callgl/examples/calltest.cxx:1.2
--- callgl/examples/calltest.cxx:1.1    Sat Feb 22 09:27:43 2003
+++ callgl/examples/calltest.cxx        Sun Sep 21 09:34:56 2003
@@ -103,7 +103,7 @@
 
     if (!compiled[code_ind]) {
       cout << "Callgl "<<code_ind<<"\n";
-      callGL(code[code_ind].c_str(), listname + code_ind);
+      compileGL(code[code_ind].c_str(), listname + code_ind);
       cout << "Called Callgl "<<code_ind<<"\n";
       compiled[code_ind] = true;
     }
Index: callgl/include/callgl.hxx
diff -u callgl/include/callgl.hxx:1.5 callgl/include/callgl.hxx:1.6
--- callgl/include/callgl.hxx:1.5       Sat Feb 22 13:50:18 2003
+++ callgl/include/callgl.hxx   Sun Sep 21 09:34:57 2003
@@ -46,9 +46,7 @@
 
     /** Execute OpenGL commands.
      * The overall function that executes a number of
-     * OpenGL commands in the given string and puts the results
-     * into the "intoList" display list, or if intoList <= 0,
-     * executes them directly.
+     * OpenGL commands in the given string.
      * <p>
      *
      * The string is of the form
@@ -104,7 +102,13 @@
      * <p>
      *
      */
-    void callGL(const char *string, int intoList);
+    void callGL(const char *string);
+
+    /** Convenience: compile the given callGL string into
+     * the display list given as parameter.
+     * @param intoList the display list id.
+     */
+    void compileGL(const char *string, GLuint intoList);
 
     /** Get an OpenGL token value for the given string.
      * The token must be provided without the GL_ prefix.
Index: callgl/include/callgl_objects.hxx
diff -u callgl/include/callgl_objects.hxx:1.2 
callgl/include/callgl_objects.hxx:1.3
--- callgl/include/callgl_objects.hxx:1.2       Wed Mar 26 09:41:19 2003
+++ callgl/include/callgl_objects.hxx   Sun Sep 21 09:34:57 2003
@@ -74,7 +74,7 @@
     protected:
       void compile() { 
        displist = boost::shared_ptr<DisplayList>(new DisplayList);
-       callGL(source.c_str(), displist->name);
+       compileGL(source.c_str(), displist->name);
       }
       std::string source;
       boost::shared_ptr<DisplayList> displist;
Index: callgl/src/callgl.cxx
diff -u callgl/src/callgl.cxx:1.9 callgl/src/callgl.cxx:1.10
--- callgl/src/callgl.cxx:1.9   Thu Jun 26 08:35:04 2003
+++ callgl/src/callgl.cxx       Sun Sep 21 09:34:57 2003
@@ -635,7 +635,7 @@
       return val;
     }
 
-    void callGL(const char *str, int intoList) {
+    void callGL(const char *str) {
        DBG(dbg) << "CallGL\n";
 
        int er = glGetError(); 
@@ -646,9 +646,6 @@
            return;
          }
 
-       if(intoList > 0) {
-           glNewList(intoList, GL_COMPILE);
-       }
        const char *cur = str;
        const char *next;
        while((next=strchr(cur, '\n')) != 0) {
@@ -658,9 +655,41 @@
        if(strlen(cur) != 0)
            callGLop(string(cur));
     out:
-       if(intoList > 0) {
-           glEndList();
-       }
+        er = glGetError(); 
+        if (er != GL_NO_ERROR)
+         {
+           cerr << "OPENGL ERROR " <<gluErrorString(er)
+              <<" after executing " << str << "\n";
+           return ;
+         }
+       return;
+    }
+
+    void compileGL(const char *str, GLuint intoList) {
+       DBG(dbg) << "CallGL\n";
+
+       int er = glGetError(); 
+       if (er != GL_NO_ERROR)
+         {
+           cerr << "OPENGL ERROR " <<gluErrorString(er)<<" before executing " 
+                << str << "\n";
+           return;
+         }
+
+       glNewList(intoList, GL_COMPILE);
+
+       callGL(str);
+
+       glEndList();
+
+        er = glGetError(); 
+        if (er != GL_NO_ERROR)
+         {
+           cerr << "OPENGL ERROR " <<gluErrorString(er)
+              <<" after compiling " << str << "\n";
+           return ;
+         }
+       return;
     }
 
     const char* getString(const char *name) { 




reply via email to

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