[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz gfx/demo/opengl/texperf.py gfx/jni/GzzGL-jn...
From: |
Tuomas J. Lukka |
Subject: |
[Gzz-commits] gzz gfx/demo/opengl/texperf.py gfx/jni/GzzGL-jn... |
Date: |
Mon, 23 Sep 2002 07:15:42 -0400 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Tuomas J. Lukka <address@hidden> 02/09/23 07:15:42
Modified files:
gfx/demo/opengl: texperf.py
gfx/jni : GzzGL-jni.cxx
gzz/gfx/gl : GL.java
Log message:
Oops... nvidia dependency
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/opengl/texperf.py.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/jni/GzzGL-jni.cxx.diff?tr1=1.28&tr2=1.29&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/gfx/gl/GL.java.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
Patches:
Index: gzz/gfx/demo/opengl/texperf.py
diff -c gzz/gfx/demo/opengl/texperf.py:1.3 gzz/gfx/demo/opengl/texperf.py:1.4
*** gzz/gfx/demo/opengl/texperf.py:1.3 Mon Sep 23 05:09:29 2002
--- gzz/gfx/demo/opengl/texperf.py Mon Sep 23 07:15:42 2002
***************
*** 80,86 ****
TexParameter TEXTURE_2D TEXTURE_MIN_FILTER
LINEAR_MIPMAP_LINEAR
TexParameter TEXTURE_2D TEXTURE_BASE_LEVEL 2
""" % texes[i].getTexId()))
! vs.put(quad(), "T"+str(i), 50-i, 100+20*i, 100+20*i, 100, 100)
niters = 10
t = w.timeRender(vs, niters) / niters
print "Time: ", nt, t
--- 80,86 ----
TexParameter TEXTURE_2D TEXTURE_MIN_FILTER
LINEAR_MIPMAP_LINEAR
TexParameter TEXTURE_2D TEXTURE_BASE_LEVEL 2
""" % texes[i].getTexId()))
! vs.put(quad(), "T"+str(i), 50-i, 100+2*i, 100+2*i, 100, 100)
niters = 10
t = w.timeRender(vs, niters) / niters
print "Time: ", nt, t
Index: gzz/gfx/jni/GzzGL-jni.cxx
diff -c gzz/gfx/jni/GzzGL-jni.cxx:1.28 gzz/gfx/jni/GzzGL-jni.cxx:1.29
*** gzz/gfx/jni/GzzGL-jni.cxx:1.28 Mon Sep 23 04:46:17 2002
--- gzz/gfx/jni/GzzGL-jni.cxx Mon Sep 23 07:15:42 2002
***************
*** 988,1043 ****
return env->NewStringUTF(str);
}
- GLuint buf[1600 * 1200];
-
- JNIEXPORT void JNICALL Java_gzz_gfx_gl_GL_reallyClearStencilBuffer
- (JNIEnv *env, jclass, jint w, jint h) {
-
- if(w*h > 1600*1200) return;
-
- cout << "In reallyClear\n\n";
- glPixelStorei(GL_PACK_ALIGNMENT, 1);
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- cout << "Set up\n";
- glReadPixels(0, 0, w, h, GL_DEPTH_STENCIL_NV, GL_UNSIGNED_INT_24_8_NV,
buf);
- cout << "Read pix\n";
- GLERR
- for(int i=0; i<w*h; i++) {
- if(buf[i] != 0) {
- cout << "Buf "<<i<<" "<<buf[i]<<"\n";
- goto nonzero;
- }
- }
- cout << "done\n";
- return;
- nonzero:
- cout << "STENCIL CLEARING: NOT ALL ZERO!!!!\n";
- for(int i=0; i<w*h; i++) buf[i] = 0;
- cout << "rastpos\n";
- glPushAttrib(GL_ENABLE_BIT);
- glDisable(GL_DEPTH_TEST);
- glDisable(GL_STENCIL_TEST);
- glStencilMask(255);
- glRasterPos2d(0,0);
- glDrawPixels(w, h, GL_DEPTH_STENCIL_NV, GL_UNSIGNED_INT_24_8_NV, buf);
- glRasterPos2d(0,1);
- glDrawPixels(w, h, GL_DEPTH_STENCIL_NV, GL_UNSIGNED_INT_24_8_NV, buf);
- glRasterPos2d(1,0);
- glDrawPixels(w, h, GL_DEPTH_STENCIL_NV, GL_UNSIGNED_INT_24_8_NV, buf);
- glRasterPos2d(1,1);
- glDrawPixels(w, h, GL_DEPTH_STENCIL_NV, GL_UNSIGNED_INT_24_8_NV, buf);
- glRasterPos2d(w,h);
- glDrawPixels(w, h, GL_DEPTH_STENCIL_NV, GL_UNSIGNED_INT_24_8_NV, buf);
- glRasterPos2d(w,0);
- glDrawPixels(w, h, GL_DEPTH_STENCIL_NV, GL_UNSIGNED_INT_24_8_NV, buf);
- glRasterPos2d(0,h);
- glDrawPixels(w, h, GL_DEPTH_STENCIL_NV, GL_UNSIGNED_INT_24_8_NV, buf);
- glPopAttrib();
- cout << "drawn\n";
- }
-
-
-
using namespace Renderables;
#include "librenderables/RealRenderables-jni.hxx"
--- 988,993 ----
Index: gzz/gzz/gfx/gl/GL.java
diff -c gzz/gzz/gfx/gl/GL.java:1.3 gzz/gzz/gfx/gl/GL.java:1.4
*** gzz/gzz/gfx/gl/GL.java:1.3 Mon Sep 23 05:30:11 2002
--- gzz/gzz/gfx/gl/GL.java Mon Sep 23 07:15:42 2002
***************
*** 18,24 ****
*
*/
/*
! * Written by Tuomas Lukka
*/
package gzz.gfx.gl;
import java.awt.Rectangle;
--- 18,24 ----
*
*/
/*
! * Written by Tuomas J. Lukka
*/
package gzz.gfx.gl;
import java.awt.Rectangle;
***************
*** 587,596 ****
public static native float[] getGLFloat(String name);
public static native float[] getGLTexParameterFloat(String target, int
tex, String name);
public static native float[] getGLTexLevelParameterFloat(String target,
int tex, int level, String name);
public static native String getGLTokenString(int value);
- // Clear stencil buffer: on some NVIDIA drivers, there
- // seems to be a bug.
- public static native void reallyClearStencilBuffer(int w, int h);
}
--- 587,606 ----
public static native float[] getGLFloat(String name);
public static native float[] getGLTexParameterFloat(String target, int
tex, String name);
public static native float[] getGLTexLevelParameterFloat(String target,
int tex, int level, String name);
+
+ /** Get the OpenGL token string corresponding to the given integer value.
+ * This is useful for producing human-readable output from the result of
getGLFloats.
+ * For example,
+ * <pre>
+ GL.getGLTokenString(
+ (int)(GL.getGLTexLevelParameterFloat(
+ "TEXTURE_2D", id, 0, "TEXTURE_INTERNAL_FORMAT")[0]
+ )
+ )
+ * </pre>
+ * yields the string representation for the internal format of the given
texture id.
+ */
public static native String getGLTokenString(int value);
}
- [Gzz-commits] gzz gfx/demo/opengl/texperf.py gfx/jni/GzzGL-jn...,
Tuomas J. Lukka <=