aboutsummaryrefslogtreecommitdiffstats
path: root/src/native/d3d
diff options
context:
space:
mode:
authorChien Yang <[email protected]>2007-03-16 17:59:20 +0000
committerChien Yang <[email protected]>2007-03-16 17:59:20 +0000
commit48f2ad8638b490854eebcfa07ea59b811189efd9 (patch)
tree106550f5f085131a1282234fe2da2e0b79e76b86 /src/native/d3d
parenta6cd0ac1ac0e96d99c6216d1a3450c8e365ceda7 (diff)
1) Fixed Issue 461 : ClassCastException thrown when using filters with NioImageBuffer
2) Minor clean up; removed unuse variables. Note: This isn't a Complete fix to auto mipmap. It will be addressed in Issue 126 and 408. git-svn-id: https://svn.java.net/svn/j3d-core~svn/trunk@798 ba19aa83-45c5-6ac9-afd3-db810772062c
Diffstat (limited to 'src/native/d3d')
-rw-r--r--src/native/d3d/D3dDeviceInfo.cpp64
1 files changed, 31 insertions, 33 deletions
diff --git a/src/native/d3d/D3dDeviceInfo.cpp b/src/native/d3d/D3dDeviceInfo.cpp
index 7ae16e7..f018663 100644
--- a/src/native/d3d/D3dDeviceInfo.cpp
+++ b/src/native/d3d/D3dDeviceInfo.cpp
@@ -25,7 +25,7 @@ D3dDeviceInfo::~D3dDeviceInfo()
VOID D3dDeviceInfo::setCaps(D3DCAPS9 *d3dCaps) {
BOOL supportNPOT;
-
+
if (deviceType == D3DDEVTYPE_HAL ){
isHardware = true;
isHardwareTnL = (d3dCaps->DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT);
@@ -72,7 +72,7 @@ VOID D3dDeviceInfo::setCaps(D3DCAPS9 *d3dCaps) {
// As OpenGL is UNCONDITIONAL, it is not used by Java3D
//supportNPOT = true;
}
- }else{
+ } else {
//UNconditional: Textures do not need to be a power of 2 in size
supportNPOT = true;
}
@@ -95,8 +95,7 @@ VOID D3dDeviceInfo::setCaps(D3DCAPS9 *d3dCaps) {
printf("Java3D: Supported Shaders = %d.%d in mode %s ",
HIBYTE(LOWORD(vsVersion)),
LOBYTE(LOWORD(vsVersion)),
- dt);
-
+ dt);
}
//supportStreamOffset =
@@ -119,7 +118,7 @@ VOID D3dDeviceInfo::setCaps(D3DCAPS9 *d3dCaps) {
texBorderModeSupport = ((d3dCaps->TextureAddressCaps & D3DPTADDRESSCAPS_BORDER) != 0);
texLerpSupport = ((d3dCaps->TextureOpCaps & D3DTEXOPCAPS_LERP) != 0);
-
+
canRenderWindowed = true;//((d3dCaps->Caps2 & D3DCAPS2_CANRENDERWINDOWED) != 0);
maxPrimitiveCount = d3dCaps->MaxPrimitiveCount;
@@ -166,43 +165,42 @@ VOID D3dDeviceInfo::setCaps(D3DCAPS9 *d3dCaps) {
supportRasterPresImmediate = false;
if (((d3dCaps->RasterCaps & D3DPRASTERCAPS_FOGTABLE) != 0) &&
- ((d3dCaps->RasterCaps & D3DPRASTERCAPS_WFOG) != 0)) {
+ ((d3dCaps->RasterCaps & D3DPRASTERCAPS_WFOG) != 0)) {
// use pixel w-fog
fogMode = D3DRS_FOGTABLEMODE;
rangeFogEnable = false;
}
- else
- if (((d3dCaps->RasterCaps & D3DPRASTERCAPS_FOGVERTEX) != 0) &&
- ((d3dCaps->RasterCaps & D3DPRASTERCAPS_FOGRANGE) != 0))
-
- {
- // use vertex range based fog
- fogMode = D3DRS_FOGVERTEXMODE;
- rangeFogEnable = true;
- }
- else
- if ((d3dCaps->RasterCaps & D3DPRASTERCAPS_FOGTABLE) != 0) {
- // use pixel z-fog
- fogMode = D3DRS_FOGTABLEMODE;
- rangeFogEnable = false;
- }
- else
- if (D3DPRASTERCAPS_FOGVERTEX) {
- // use vertex z-fog
- fogMode = D3DRS_FOGVERTEXMODE;
- rangeFogEnable = false;
- }
- else {
- if (debug) {
- printf("[Java 3D] Fog not support in this device !\n");
- }
- }
+ else if (((d3dCaps->RasterCaps & D3DPRASTERCAPS_FOGVERTEX) != 0) &&
+ ((d3dCaps->RasterCaps & D3DPRASTERCAPS_FOGRANGE) != 0)) {
+ // use vertex range based fog
+ fogMode = D3DRS_FOGVERTEXMODE;
+ rangeFogEnable = true;
+ }
+ else if ((d3dCaps->RasterCaps & D3DPRASTERCAPS_FOGTABLE) != 0) {
+ // use pixel z-fog
+ fogMode = D3DRS_FOGTABLEMODE;
+ rangeFogEnable = false;
+ }
+ else if (D3DPRASTERCAPS_FOGVERTEX) {
+ // use vertex z-fog
+ fogMode = D3DRS_FOGVERTEXMODE;
+ rangeFogEnable = false;
+ }
+ else {
+ if (debug) {
+ printf("[Java 3D] Fog not support in this device !\n");
+ }
+ }
texMask = 0;
-
+
if(supportNPOT){
texMask |= javax_media_j3d_Canvas3D_TEXTURE_NON_POWER_OF_TWO;
}
+
+ if((d3dCaps->Caps2 & D3DCAPS2_CANAUTOGENMIPMAP) != 0) {
+ texMask |= javax_media_j3d_Canvas3D_TEXTURE_AUTO_MIPMAP_GENERATION;
+ }
if ((d3dCaps->TextureCaps & D3DPTEXTURECAPS_VOLUMEMAP) &&
(maxTextureDepth > 0)) {