gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] gzz ./TODO gfx/jni/GzzGL-jni.cxx gfx/librendera...


From: Tuomas J. Lukka
Subject: [Gzz-commits] gzz ./TODO gfx/jni/GzzGL-jni.cxx gfx/librendera...
Date: Fri, 20 Sep 2002 10:41:36 -0400

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Tuomas J. Lukka <address@hidden>        02/09/20 10:41:36

Modified files:
        .              : TODO 
        gfx/jni        : GzzGL-jni.cxx 
        gfx/librenderables: renderables.py 
Added files:
        gfx/demo/opengl: readpixels.py 

Log message:
        Reading pixels from screen

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/TODO.diff?tr1=1.116&tr2=1.117&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/opengl/readpixels.py?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/jni/GzzGL-jni.cxx.diff?tr1=1.25&tr2=1.26&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/librenderables/renderables.py.diff?tr1=1.54&tr2=1.55&r1=text&r2=text

Patches:
Index: gzz/TODO
diff -c gzz/TODO:1.116 gzz/TODO:1.117
*** gzz/TODO:1.116      Fri Sep 20 06:26:42 2002
--- gzz/TODO    Fri Sep 20 10:41:36 2002
***************
*** 304,309 ****
--- 304,310 ----
        - implement distortion in vertex programs
        - use better distortion function
        - do not evaluate points twice
+     - mouse warp on distorted views etc.
  
  
  
Index: gzz/gfx/jni/GzzGL-jni.cxx
diff -c gzz/gfx/jni/GzzGL-jni.cxx:1.25 gzz/gfx/jni/GzzGL-jni.cxx:1.26
*** gzz/gfx/jni/GzzGL-jni.cxx:1.25      Fri Sep 20 06:27:03 2002
--- gzz/gfx/jni/GzzGL-jni.cxx   Fri Sep 20 10:41:36 2002
***************
*** 41,46 ****
--- 41,48 ----
     int getGlyphWidth(int c) { return rend->g.getGlyphWidth(c); }
  };
  
+ typedef std::vector<GLubyte> ByteVector;
+ 
  ObjectStorer<Os::Window> windows;
  ObjectStorer<Image> images;
  ObjectStorer<Mosaic::MosaicTile> imagetiles;
***************
*** 48,53 ****
--- 50,56 ----
  ObjectStorer<Renderable0> renderable0s;
  ObjectStorer<Renderable1> renderable1s;
  ObjectStorer<Renderable2> renderable2s;
+ ObjectStorer<ByteVector> bytevectors;
  
  extern ObjectStorer<Paper::Paper> papers;
  
***************
*** 642,647 ****
--- 645,688 ----
        glDeleteLists(l, 1);
        DBG(dbg) << "Deleted display list\n";
    }
+ 
+ // ByteVector
+ //
+ JNIEXPORT jint JNICALL Java_gzz_gfx_gl_GZZGL_createByteVectorImpl
+   (JNIEnv *, jclass, jint size) {
+       ByteVector *vec = new ByteVector(size);
+       return bytevectors.add(vec);
+ }
+ 
+ JNIEXPORT void JNICALL Java_gzz_gfx_gl_GZZGL_deleteByteVector
+   (JNIEnv *, jclass, jint id) {
+       bytevectors.remove(id);
+ }
+ 
+ JNIEXPORT void JNICALL 
Java_gzz_gfx_gl_GZZGL_impl_1ByteVector_1readFromBuffer_1ubytes
+   (JNIEnv *env, jclass, jint id, jint winid, jstring buffer, jint x, jint y, 
jint w, jint h, jstring format) 
+ {
+     setWindow(winid);
+     ByteVector *v = bytevectors[id];
+     GLenum buf = tokenFromJstring(env, buffer);
+     GLenum form = tokenFromJstring(env, format);
+ 
+     glPushAttrib(GL_PIXEL_MODE_BIT);
+     glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
+     glReadBuffer(buf);
+     glPixelStorei(GL_PACK_ROW_LENGTH, 0);
+     glPixelStorei(GL_PACK_ALIGNMENT, 1);
+     glReadPixels(x, y, w, h, form, GL_UNSIGNED_BYTE, &((*v)[0]));
+     GLERR
+     glPopClientAttrib();
+     glPopAttrib();
+     releaseWindow();
+ }
+ 
+ JNIEXPORT jint JNICALL Java_gzz_gfx_gl_GZZGL_impl_1ByteVector_1get
+  (JNIEnv *env, jclass, jint id, jint ind) {
+     return (*bytevectors[id])[ind];
+ }
  
  
  // Renderable
Index: gzz/gfx/librenderables/renderables.py
diff -c gzz/gfx/librenderables/renderables.py:1.54 
gzz/gfx/librenderables/renderables.py:1.55
*** gzz/gfx/librenderables/renderables.py:1.54  Fri Sep 20 06:27:03 2002
--- gzz/gfx/librenderables/renderables.py       Fri Sep 20 10:41:36 2002
***************
*** 1536,1541 ****
--- 1536,1573 ----
        static private native void compileCallGL(int id, String s);
        static private native void deleteDisplayList(int id);
  
+     //---------- ByteVector
+       static public class ByteVector extends NonRenderableJavaObject {
+           private ByteVector(int id) {
+               super(id);
+           }
+           protected void deleteObj() { deleteByteVector(getId()); }
+ 
+           public int get(int ind) { return impl_ByteVector_get(getId(), ind); 
}
+           public void readFromBuffer_ubytes(Window win,
+               String buffer, 
+               int x, int y, int width, int height, 
+               String format) {
+               impl_ByteVector_readFromBuffer_ubytes(getId(), win.getId(),
+                   buffer, x, y, width, height, format);
+           }
+ 
+       }
+       static public ByteVector createByteVector() {
+           return createByteVector(0);
+       }
+       static public ByteVector createByteVector(int size) {
+           return new ByteVector(createByteVectorImpl(size));
+       }
+       static private native int createByteVectorImpl(int size);
+       static private native void deleteByteVector(int id);
+ 
+       static private native void impl_ByteVector_readFromBuffer_ubytes(
+               int id, int winid, String buffer,
+               int x, int y, int width, int height, 
+               String format) ;
+       static private native int impl_ByteVector_get(int id, int ind);
+ 
      //----------Misc
  
        public static void render(




reply via email to

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