diff options
author | Alessandro Borges <[email protected]> | 2006-01-02 18:40:00 +0000 |
---|---|---|
committer | Alessandro Borges <[email protected]> | 2006-01-02 18:40:00 +0000 |
commit | 121fb78d9ea6642170d870a4399927b612aa9f5c (patch) | |
tree | c485f0e8aa4d52b2502fec8d2035e3ad3bdf0171 /src/native | |
parent | 8cd45b1ebd9f6cde7360cf6be8233f774ff3bf79 (diff) |
Debug output fix.
git-svn-id: https://svn.java.net/svn/j3d-core~svn/trunk@487 ba19aa83-45c5-6ac9-afd3-db810772062c
Diffstat (limited to 'src/native')
-rw-r--r-- | src/native/d3d/Canvas3D.cpp | 59 | ||||
-rw-r--r-- | src/native/d3d/D3dCtx.cpp | 17 | ||||
-rw-r--r-- | src/native/d3d/D3dDriverInfo.cpp | 2 |
3 files changed, 50 insertions, 28 deletions
diff --git a/src/native/d3d/Canvas3D.cpp b/src/native/d3d/Canvas3D.cpp index 661c20d..4c31d88 100644 --- a/src/native/d3d/Canvas3D.cpp +++ b/src/native/d3d/Canvas3D.cpp @@ -69,30 +69,34 @@ jlong JNICALL Java_javax_media_j3d_Canvas3D_createNewContext( return 0; } - if (offScreen) { - - jclass cls = (jclass) env->GetObjectClass(obj); - jfieldID fieldId = env->GetFieldID(cls, + if (offScreen) + { + jclass cls = (jclass) env->GetObjectClass(obj); + jfieldID fieldId = env->GetFieldID(cls, "offScreenCanvasSize", "Ljava/awt/Dimension;"); - jobject dimObj = env->GetObjectField(obj, fieldId); - if (dimObj == NULL) { - // user invoke queryProperties() - ctx->offScreenWidth = 1; - ctx->offScreenHeight = 1; - } else { - cls = (jclass) env->GetObjectClass(dimObj); - fieldId = env->GetFieldID(cls, "width", "I"); - ctx->offScreenWidth = env->GetIntField(dimObj, fieldId); - fieldId = env->GetFieldID(cls, "height", "I"); - ctx->offScreenHeight = env->GetIntField(dimObj, fieldId); - } + jobject dimObj = env->GetObjectField(obj, fieldId); + if (dimObj == NULL) + { + // user invoke queryProperties() + ctx->offScreenWidth = 1; + ctx->offScreenHeight = 1; + } + else + { + cls = (jclass) env->GetObjectClass(dimObj); + fieldId = env->GetFieldID(cls, "width", "I"); + ctx->offScreenWidth = env->GetIntField(dimObj, fieldId); + fieldId = env->GetFieldID(cls, "height", "I"); + ctx->offScreenHeight = env->GetIntField(dimObj, fieldId); + } } - if (!ctx->initialize(env, obj)) { - delete ctx; - unlock(); - return 0; + if (!ctx->initialize(env, obj)) + { + delete ctx; + unlock(); + return 0; } d3dCtxList.push_back(ctx); @@ -345,15 +349,26 @@ void JNICALL Java_javax_media_j3d_Canvas3D_clear( } /* clear stencil, if in used */ + if (d3dCtx->stencilWriteEnable ) {// clear stencil and ZBuffer - device->Clear(0, NULL, D3DCLEAR_STENCIL | D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, + HRESULT hr = device->Clear(0, NULL, D3DCLEAR_STENCIL | D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_COLORVALUE(r, g, b, 1.0f), 1.0, 0); + if (hr == D3DERR_INVALIDCALL) + { + printf("[Java3D] Error cleaning Canvas3D stencil & ZBuffer\n"); + } + // printf("canvas3D clear stencil & ZBuffer\n"); } else { // clear ZBuffer only - device->Clear(0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, + HRESULT hr = device->Clear(0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_COLORVALUE(r, g, b, 1.0f), 1.0, 0); + if (hr == D3DERR_INVALIDCALL) + { + printf("[Java3D] Error cleaning Canvas3D ZBuffer\n"); + } + // printf("canvas3D clear ZBuffer\n"); } diff --git a/src/native/d3d/D3dCtx.cpp b/src/native/d3d/D3dCtx.cpp index 7bd4362..55a4869 100644 --- a/src/native/d3d/D3dCtx.cpp +++ b/src/native/d3d/D3dCtx.cpp @@ -1390,24 +1390,31 @@ VOID D3dCtx::setImplicitMultisamplingProperty(JNIEnv *env) VOID D3dCtx::setCanvasProperty(JNIEnv *env, jobject obj) { int mask = javax_media_j3d_Canvas3D_EXT_ABGR | - javax_media_j3d_Canvas3D_EXT_BGR; + javax_media_j3d_Canvas3D_EXT_BGR; - if ((deviceInfo->depthStencilFormat == D3DFMT_D24S8) || - (deviceInfo->depthStencilFormat == D3DFMT_D24X4S4)) { + if ((deviceInfo->depthStencilFormat == D3DFMT_D24S8) || + (deviceInfo->depthStencilFormat == D3DFMT_D24X4S4)) + { // The other format D3DFMT_D15S1 with 1 bit // stencil buffer has no use for Decal group so it // is ignored. - mask |= javax_media_j3d_Canvas3D_STENCIL_BUFFER; + mask |= javax_media_j3d_Canvas3D_STENCIL_BUFFER; } + jclass canvasCls = env->GetObjectClass(obj); jfieldID id = env->GetFieldID(canvasCls, "fullScreenMode", "Z"); env->SetBooleanField(obj, id, bFullScreen); + id = env->GetFieldID(canvasCls, "fullscreenWidth", "I"); env->SetIntField(obj, id, driverInfo->desktopMode.Width); + id = env->GetFieldID(canvasCls, "fullscreenHeight", "I"); env->SetIntField(obj, id, driverInfo->desktopMode.Height); + //id = env->GetFieldID(canvasCls, "userStencilAvailable", "Z"); + //env->SetBooleanField(obj, id, deviceInfo->supportStencil ); + id = env->GetFieldID(canvasCls, "textureExtendedFeatures", "I"); env->SetIntField(obj, id, deviceInfo->getTextureFeaturesMask()); @@ -1860,7 +1867,7 @@ VOID D3dCtx::printInfo(D3DPRESENT_PARAMETERS *d3dPresent) printf("FullScreen "); } - printf("%dx%d %s, handle=%x, %s, %s, %s\n", + printf("%dx%d %s, handle=%x, MultiSampleType %s, SwapEffect %s, AutoDepthStencilFormat: %s\n", d3dPresent->BackBufferWidth, d3dPresent->BackBufferHeight, getPixelFormatName(d3dPresent->BackBufferFormat), diff --git a/src/native/d3d/D3dDriverInfo.cpp b/src/native/d3d/D3dDriverInfo.cpp index 30f2cc8..20e6335 100644 --- a/src/native/d3d/D3dDriverInfo.cpp +++ b/src/native/d3d/D3dDriverInfo.cpp @@ -333,7 +333,7 @@ VOID D3dDriverInfo::initialize(JNIEnv *env) LPDIRECT3D9 pD3D = Direct3DCreate9( D3D_SDK_VERSION ); printf("[Java3D] Using DirectX D3D 9.0 or higher.\n"); if (debug){ - printf("[Java3D] DirectX D3D renderer build 1.4.2005.10.10\n"); + printf("[Java3D] DirectX D3D renderer build 1.4.2005.12.30\n"); } if (pD3D == NULL) { D3dCtx::d3dError(D3DNOTFOUND); |