[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] libvob ./TODO include/vob/Coorder.hxx include/v...
From: |
Tuomas J. Lukka |
Subject: |
[Gzz-commits] libvob ./TODO include/vob/Coorder.hxx include/v... |
Date: |
Wed, 12 Mar 2003 08:37:58 -0500 |
CVSROOT: /cvsroot/libvob
Module name: libvob
Changes by: Tuomas J. Lukka <address@hidden> 03/03/12 08:37:57
Modified files:
. : TODO
include/vob : Coorder.hxx Debug.hxx
include/vob/os : Os.hxx
include/vob/util: ObjectStorer.hxx
src/jni : Main.cxx Makefile Transform.cxx vobjnidef.hxx
Added files:
include/vob : Renderer.hxx
src/jni : Render.cxx
Log message:
GL renderer now in place and compiles
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/TODO.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/Renderer.hxx?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/Coorder.hxx.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/Debug.hxx.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/os/Os.hxx.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/util/ObjectStorer.hxx.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/src/jni/Render.cxx?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/src/jni/Main.cxx.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/src/jni/Makefile.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/src/jni/Transform.cxx.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/src/jni/vobjnidef.hxx.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
Patches:
Index: libvob/TODO
diff -u libvob/TODO:1.8 libvob/TODO:1.9
--- libvob/TODO:1.8 Mon Mar 10 09:26:17 2003
+++ libvob/TODO Wed Mar 12 08:37:57 2003
@@ -190,6 +190,9 @@
- changes to Java classes are, however, not found without jreload()
- convert basalt/pdlimg ---> gfx/libtexture texturer. Remove
gfx/images/*cell* and *conn*
+ - show erroneous debug vars: a call to get
+ list of vars touched by "setDbgvar"
+ but not used by any code.
jvk:
+ parseCombiner -> fragment program compiler
- in gldemo.py, add "R" key for "cvs update":ing in addition
Index: libvob/include/vob/Coorder.hxx
diff -u libvob/include/vob/Coorder.hxx:1.2 libvob/include/vob/Coorder.hxx:1.3
--- libvob/include/vob/Coorder.hxx:1.2 Mon Mar 10 11:02:04 2003
+++ libvob/include/vob/Coorder.hxx Wed Mar 12 08:37:57 2003
@@ -1,5 +1,8 @@
// (c) Tuomas J. Lukka and Asko Soukka
+#ifndef VOB_COORDER_HXX
+#define VOB_COORDER_HXX
+
#include <vector>
#include <vob/Transform.hxx>
#include <vob/Primitives.hxx>
@@ -106,4 +109,4 @@
}
-
+#endif
Index: libvob/include/vob/Debug.hxx
diff -u libvob/include/vob/Debug.hxx:1.1 libvob/include/vob/Debug.hxx:1.2
--- libvob/include/vob/Debug.hxx:1.1 Tue Mar 11 06:24:28 2003
+++ libvob/include/vob/Debug.hxx Wed Mar 12 08:37:57 2003
@@ -48,6 +48,7 @@
* by the invocation.
*/
#define DBGVAR(cname, name) const char *cname##___DBGNAME = name; int &cname =
Debug::var(name)
+#define STATICDBGVAR(cname, name) static const char *cname##___DBGNAME = name;
static int &cname = Debug::var(name)
/** Predeclare an extern debug variable.
* Useful for header files.
* Example:
Index: libvob/include/vob/os/Os.hxx
diff -u libvob/include/vob/os/Os.hxx:1.2 libvob/include/vob/os/Os.hxx:1.3
--- libvob/include/vob/os/Os.hxx:1.2 Fri Feb 28 08:56:08 2003
+++ libvob/include/vob/os/Os.hxx Wed Mar 12 08:37:57 2003
@@ -24,6 +24,9 @@
* Written by Tuomas J. Lukka
*/
+#ifndef VOB_OS_OS_HXX
+#define VOB_OS_OS_HXX
+
namespace Vob {
namespace Os {
@@ -140,3 +143,5 @@
}
}
+
+#endif
Index: libvob/include/vob/util/ObjectStorer.hxx
diff -u libvob/include/vob/util/ObjectStorer.hxx:1.1
libvob/include/vob/util/ObjectStorer.hxx:1.2
--- libvob/include/vob/util/ObjectStorer.hxx:1.1 Fri Feb 28 07:25:24 2003
+++ libvob/include/vob/util/ObjectStorer.hxx Wed Mar 12 08:37:57 2003
@@ -26,6 +26,9 @@
* Written by Tuomas J. Lukka
*/
+#ifndef VOB_UTIL_OBJECTSTORER_HXX
+#define VOB_UTIL_OBJECTSTORER_HXX
+
#include <vector>
namespace Vob {
@@ -109,3 +112,4 @@
}
+#endif
Index: libvob/src/jni/Main.cxx
diff -u libvob/src/jni/Main.cxx:1.8 libvob/src/jni/Main.cxx:1.9
--- libvob/src/jni/Main.cxx:1.8 Wed Mar 12 04:00:50 2003
+++ libvob/src/jni/Main.cxx Wed Mar 12 08:37:57 2003
@@ -63,7 +63,7 @@
vector<int> contextStack;
-void setWindow(int wid = -1) {
+void setWindow(int wid) {
Os::RenderingSurface *win = getWindowByWID(wid);
if(!win->setCurrent()) {
cerr << "Couldn't set window to current -> returning\n";
Index: libvob/src/jni/Makefile
diff -u libvob/src/jni/Makefile:1.10 libvob/src/jni/Makefile:1.11
--- libvob/src/jni/Makefile:1.10 Wed Mar 12 04:00:50 2003
+++ libvob/src/jni/Makefile Wed Mar 12 08:37:57 2003
@@ -1,6 +1,6 @@
include ../../rules.mk
-sources = Gen.cxx GLRen.gen.cxx Main.cxx Strings.cxx Transform.cxx
+sources = Gen.cxx GLRen.gen.cxx Main.cxx Strings.cxx Transform.cxx Render.cxx
CALLGL=../../../callgl
CALLGLOBJS=$(CALLGL)/src/glwrapper/GL_wrapper.o $(CALLGL)/src/callgl.o
@@ -9,7 +9,9 @@
TEXTUREOBJS=../texture/Texture.o ../texture/Texture_pipetexture.o
UTILOBJS=../util/Perlin.o ../util/buildmipmaps.o ../util/Debug.o
-JNIOBJS=GLRen.gen.o Main.o Strings.o Transform.cxx $(OSOBJS) $(TEXTUREOBJS)
$(UTILOBJS) $(CALLGLOBJS)
+TRANSOBJS=../trans/Transform.o ../trans/Coorder.o
+
+JNIOBJS=GLRen.gen.o Main.o Strings.o Transform.o Render.o $(OSOBJS)
$(TEXTUREOBJS) $(UTILOBJS) $(CALLGLOBJS) $(TRANSOBJS)
EXTRAINCLUDE=-I${JAVAHOME}/include -I${JAVAHOME}/include/linux
Index: libvob/src/jni/Transform.cxx
diff -u libvob/src/jni/Transform.cxx:1.1 libvob/src/jni/Transform.cxx:1.2
--- libvob/src/jni/Transform.cxx:1.1 Wed Mar 12 04:00:50 2003
+++ libvob/src/jni/Transform.cxx Wed Mar 12 08:37:57 2003
@@ -33,6 +33,8 @@
extern Primitives::HierarchicalTransform *defaultTransformFactory(int id) ;
+extern "C" {
+
jf( jboolean , transform)
(JNIEnv *env, jclass, jint ninds, jintArray j_inds, jfloatArray j_pts,
jint coordsys, jboolean inverse, jfloatArray j_points, jfloatArray j_into)
{
@@ -50,9 +52,9 @@
jfloat *points = env->GetFloatArrayElements(j_points, 0);
jfloat *into = env->GetFloatArrayElements(j_into, 0);
- Transform *cs = coordset.get(coordsys);
+ const Transform *cs = coordset.get(coordsys);
if(cs != 0) {
- if(inverse) cs = cs->getInverse();
+ if(inverse) cs = &cs->getInverse();
if(cs != 0)
for(int i=0; i<arrayLength; i+=3) {
ZPt pt(points[i], points[i+1], points[i+2]);
@@ -72,6 +74,42 @@
return (cs != 0);
}
+jf( jboolean , transformSq)
+ (JNIEnv *env, jclass, jint ninds, jintArray j_inds,
+ jfloatArray j_pts,
+ jint coordsys,
+ jfloatArray j_into) {
+ jint *inds = env->GetIntArrayElements(j_inds, 0);
+ jfloat *pts = env->GetFloatArrayElements(j_pts, 0);
+
+ Coorder coordset(defaultTransformFactory);
+ coordset.clean();
+ coordset.setPoints((int)ninds, (int*)inds,
+ (float*)pts, (int*)0,
+ (int*)0, (float*)0,
+ (float)0, (bool)true);
+
+ jfloat *into = env->GetFloatArrayElements(j_into, 0);
+
+
+ const Transform *cs = coordset.get(coordsys);
+
+
+ if(cs != 0) {
+ Pt sq = cs->getSqSize();
+ into[0] = sq.x;
+ into[1] = sq.y;
+ }
+
+ env->ReleaseFloatArrayElements(j_into, into, 0); // These were changed,
commit.
+
+ env->ReleaseIntArrayElements(j_inds, inds, JNI_ABORT);
+ env->ReleaseFloatArrayElements(j_pts, pts, JNI_ABORT);
+
+ return (cs != 0);
+ }
+
+
jf( jboolean , transform2)
(JNIEnv *env, jclass, jint ninds, jintArray j_inds, jfloatArray j_pts,
jintArray j_interpinds, jintArray j_inds2, jfloatArray j_pts2,
@@ -97,9 +135,9 @@
jfloat *points = env->GetFloatArrayElements(j_points, 0);
jfloat *into = env->GetFloatArrayElements(j_into, 0);
- Transform *cs = coordset.get(coordsys);
+ const Transform *cs = coordset.get(coordsys);
if(cs != 0) {
- if(inverse) cs = cs->getInverse();
+ if(inverse) cs = &cs->getInverse();
for(int i=0; i<arrayLength; i+=3) {
ZPt pt(points[i], points[i+1], points[i+2]);
ZPt pt2 = cs->transform(pt);
@@ -150,13 +188,13 @@
for(Coorder::iterator iter = coordset.begin();
iter != coordset.end(); iter++) {
// XXX Break encapsulation badly
- if(!(inds[*iter] & Coords::CSFLAG_ACTIVE))
+ if(!(inds[*iter] & CSFLAG_ACTIVE))
continue;
Transform *cs = coordset.get(*iter);
if(!cs) continue;
// Transform screen point to inside coordsys
- ZPt pt = cs->getInverse()->transform(screenpt);
+ ZPt pt = cs->getInverse().transform(screenpt);
Pt sq = cs->getSqSize();
// See whether inside unit square
if(pt.x < 0 || pt.x > sq.x ||
@@ -190,6 +228,6 @@
}
-
+}
}
Index: libvob/src/jni/vobjnidef.hxx
diff -u libvob/src/jni/vobjnidef.hxx:1.1 libvob/src/jni/vobjnidef.hxx:1.2
--- libvob/src/jni/vobjnidef.hxx:1.1 Wed Mar 12 04:28:05 2003
+++ libvob/src/jni/vobjnidef.hxx Wed Mar 12 08:37:57 2003
@@ -3,3 +3,16 @@
/** Define a jni function in the vob GL class.
*/
#define jf(t, rootname) JNIEXPORT t JNICALL
Java_org_nongnu_libvob_gl_GL_##rootname
+
+#include <vob/os/Os.hxx>
+#include <vob/util/ObjectStorer.hxx>
+
+namespace Vob {
+namespace JNI {
+
+extern void setWindow(int wid = -1) ;
+extern void releaseWindow() ;
+extern ObjectStorer<Os::RenderingSurface> windows;
+
+}
+}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gzz-commits] libvob ./TODO include/vob/Coorder.hxx include/v...,
Tuomas J. Lukka <=