aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/classes/share/javax/media/j3d/Canvas3D.java18
-rw-r--r--src/native/d3d/D3dCtx.cpp11
-rw-r--r--src/native/ogl/Canvas3D.c13
3 files changed, 38 insertions, 4 deletions
diff --git a/src/classes/share/javax/media/j3d/Canvas3D.java b/src/classes/share/javax/media/j3d/Canvas3D.java
index 2135a9c..01f630e 100644
--- a/src/classes/share/javax/media/j3d/Canvas3D.java
+++ b/src/classes/share/javax/media/j3d/Canvas3D.java
@@ -751,12 +751,15 @@ public class Canvas3D extends Canvas {
// Texture Boundary Width Max
int textureBoundaryWidthMax = 0;
- // Texture Width Max
+ // Texture Width, Height Max
int textureWidthMax = 0;
-
- // Texture Height Max
int textureHeightMax = 0;
+ // Texture3D Width, Heigh, Depth Max
+ int texture3DWidthMax = -1;
+ int texture3DHeightMax = -1;
+ int texture3DDepthMax = -1;
+
// Cached position & size for CanvasViewCache.
// We don't want to call canvas.getxx method in Renderer
// since it will cause deadlock as removeNotify() need to get
@@ -3449,6 +3452,15 @@ public class Canvas3D extends Canvas {
keys.add("textureHeightMax");
values.add(new Integer(textureHeightMax));
+ keys.add("texture3DWidthMax");
+ values.add(new Integer(texture3DWidthMax));
+
+ keys.add("texture3DHeightMax");
+ values.add(new Integer(texture3DHeightMax));
+
+ keys.add("texture3DDepthMax");
+ values.add(new Integer(texture3DDepthMax));
+
keys.add("textureBoundaryWidthMax");
values.add(new Integer(textureBoundaryWidthMax));
diff --git a/src/native/d3d/D3dCtx.cpp b/src/native/d3d/D3dCtx.cpp
index 9072a3f..3bc2afb 100644
--- a/src/native/d3d/D3dCtx.cpp
+++ b/src/native/d3d/D3dCtx.cpp
@@ -1303,6 +1303,17 @@ VOID D3dCtx::setCanvasProperty(JNIEnv *env, jobject obj)
id = env->GetFieldID(canvasCls, "textureHeightMax", "I");
env->SetIntField(obj, id, deviceInfo->maxTextureHeight);
+
+ if (deviceInfo->maxTextureDepth > 0) {
+ id = env->GetFieldID(canvasCls, "texture3DWidthMax", "I");
+ env->SetIntField(obj, id, deviceInfo->maxTextureWidth);
+
+ id = env->GetFieldID(canvasCls, "texture3DHeightMax", "I");
+ env->SetIntField(obj, id, deviceInfo->maxTextureHeight);
+
+ id = env->GetFieldID(canvasCls, "texture3DDepthMax", "I");
+ env->SetIntField(obj, id, deviceInfo->maxTextureDepth);
+ }
}
VOID D3dCtx::createVertexBuffer()
diff --git a/src/native/ogl/Canvas3D.c b/src/native/ogl/Canvas3D.c
index 7cfb723..146d531 100644
--- a/src/native/ogl/Canvas3D.c
+++ b/src/native/ogl/Canvas3D.c
@@ -1015,9 +1015,20 @@ void setupCanvasProperties(
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &param);
rsc_field = (jfieldID) (*(table->GetFieldID))(env, cv_class, "textureWidthMax", "I");
(*(table->SetIntField))(env, obj, rsc_field, param);
-
+
rsc_field = (jfieldID) (*(table->GetFieldID))(env, cv_class, "textureHeightMax", "I");
(*(table->SetIntField))(env, obj, rsc_field, param);
+
+ param = -1;
+ glGetIntegerv(GL_MAX_3D_TEXTURE_SIZE, &param);
+ rsc_field = (jfieldID) (*(table->GetFieldID))(env, cv_class, "texture3DWidthMax", "I");
+ (*(table->SetIntField))(env, obj, rsc_field, param);
+
+ rsc_field = (jfieldID) (*(table->GetFieldID))(env, cv_class, "texture3DHeightMax", "I");
+ (*(table->SetIntField))(env, obj, rsc_field, param);
+
+ rsc_field = (jfieldID) (*(table->GetFieldID))(env, cv_class, "texture3DDepthMax", "I");
+ (*(table->SetIntField))(env, obj, rsc_field, param);
}
JNIEXPORT