aboutsummaryrefslogtreecommitdiffstats
path: root/src/native/d3d/Canvas3D.cpp
diff options
context:
space:
mode:
authorKevin Rushforth <[email protected]>2005-10-17 22:56:23 +0000
committerKevin Rushforth <[email protected]>2005-10-17 22:56:23 +0000
commit356bbf2bd325380e16fd77d34fffd084dc1c0928 (patch)
tree1d67b61e1a427baa49047341ee825bca9b423553 /src/native/d3d/Canvas3D.cpp
parent68449b2071392af151a75f90610026465c426401 (diff)
Merged changes from dev-1_4 branch into the main trunk.
NOTE: all 1.4 development will now proceed on the main trunk. The dev-1_4 branch is closed. git-svn-id: https://svn.java.net/svn/j3d-core~svn/trunk@445 ba19aa83-45c5-6ac9-afd3-db810772062c
Diffstat (limited to 'src/native/d3d/Canvas3D.cpp')
-rw-r--r--src/native/d3d/Canvas3D.cpp38
1 files changed, 21 insertions, 17 deletions
diff --git a/src/native/d3d/Canvas3D.cpp b/src/native/d3d/Canvas3D.cpp
index 4195f14..3636e6d 100644
--- a/src/native/d3d/Canvas3D.cpp
+++ b/src/native/d3d/Canvas3D.cpp
@@ -55,9 +55,11 @@ jlong JNICALL Java_javax_media_j3d_Canvas3D_createNewContext(
jlong fbConfigListPtr,
jlong sharedCtx,
jboolean isSharedCtx,
- jboolean offScreen)
+ jboolean offScreen,
+ jboolean glslLibraryAvailable,
+ jboolean cgLibraryAvailable)
{
- HWND hwnd = WindowFromDC(reinterpret_cast<HDC>(window));
+ HWND hwnd = WindowFromDC(reinterpret_cast<HDC>(jlong(window)));
lock();
D3dCtx* ctx = new D3dCtx(env, obj, hwnd, offScreen, vid);
@@ -109,9 +111,11 @@ void JNICALL Java_javax_media_j3d_Canvas3D_createQueryContext(
jlong fbConfigListPtr,
jboolean offScreen,
jint width,
- jint height)
+ jint height,
+ jboolean glslLibraryAvailable,
+ jboolean cgLibraryAvailable)
{
- HWND hwnd = WindowFromDC(reinterpret_cast<HDC>(window));
+ HWND hwnd = WindowFromDC(reinterpret_cast<HDC>(jlong(window)));
lock();
// always use offscreen for property since it
@@ -187,7 +191,7 @@ void JNICALL Java_javax_media_j3d_Canvas3D_composite(
// However we use the following texturemapping function instead
// so this will not invoke.
if (d3dCtx->backSurface == NULL) {
- device->GetBackBuffer(0, D3DBACKBUFFER_TYPE_MONO,
+ device->GetBackBuffer(0,0, D3DBACKBUFFER_TYPE_MONO,//iSwapChain is 0
&d3dCtx->backSurface);
}
jbyte *byteData = (jbyte *) (env->GetPrimitiveArrayCritical(
@@ -262,7 +266,7 @@ void JNICALL Java_javax_media_j3d_Canvas3D_texturemapping(
env, texture, ctx, 0, minX, minY, J3D_RGBA, format,
minX, minY, rasWidth, maxX-minX, maxY-minY, imageYdown);
- LPDIRECT3DTEXTURE8 surf = d3dCtx->textureTable[objectId];
+ LPDIRECT3DTEXTURE9 surf = d3dCtx->textureTable[objectId];
if (surf == NULL) {
if (debug) {
@@ -366,7 +370,7 @@ void JNICALL Java_javax_media_j3d_Canvas3D_clear(
id = env->GetFieldID(pa2d_class, "height", "I");
int height = env->GetIntField(pa2d, id);
- LPDIRECT3DTEXTURE8 surf;
+ LPDIRECT3DTEXTURE9 surf;
if ((d3dImage == NULL) || (d3dImage->surf == NULL)) {
surf = createSurfaceFromImage(env, pa2d, ctx,
@@ -420,11 +424,11 @@ void JNICALL Java_javax_media_j3d_Canvas3D_clear(
sw = winWidth/(float) width;
sh = winHeight/(float) height;
if (sw >= sh) {
- scaleWidth = width*sh;
+ scaleWidth = int(width*sh);
scaleHeight = winHeight;
} else {
scaleWidth = winWidth;
- scaleHeight = height*sw;
+ scaleHeight = int(height*sw);
}
texModeRepeat = FALSE;
break;
@@ -435,9 +439,9 @@ void JNICALL Java_javax_media_j3d_Canvas3D_clear(
sh = winHeight/(float) height;
if (sw >= sh) {
scaleWidth = winWidth;
- scaleHeight = height*sw;
+ scaleHeight = int(height*sw);
} else {
- scaleWidth = width*sh;
+ scaleWidth = int(width*sh);
scaleHeight = winHeight;
}
texModeRepeat = FALSE;
@@ -551,7 +555,7 @@ VOID freePointerList()
if (useFreePointerList0) {
if (freePointerList1.size() > 0) {
lockSurfaceList();
- for (void **p = freePointerList1.begin();
+ for (ITER_VOID p = freePointerList1.begin();
p != freePointerList1.end(); ++p) {
delete (*p);
}
@@ -563,7 +567,7 @@ VOID freePointerList()
} else {
if (freePointerList0.size() > 0) {
lockSurfaceList();
- for (void **p = freePointerList0.begin();
+ for (ITER_VOID p = freePointerList0.begin();
p != freePointerList0.end(); ++p) {
delete (*p);
}
@@ -599,7 +603,7 @@ jint JNICALL Java_javax_media_j3d_Canvas3D_swapBuffers(
if (D3DERR_DEVICENOTRESET == hr) {
if (debug) {
printf("Buffer swap error %s, try Reset() the surface... \n",
- DXGetErrorString8(hr));
+ DXGetErrorString9(hr));
}
retCode = d3dCtx->resetSurface(env, obj);
GetDevice2();
@@ -607,7 +611,7 @@ jint JNICALL Java_javax_media_j3d_Canvas3D_swapBuffers(
if (FAILED(hr)) {
if (debug) {
printf("Buffer swap error %s \n",
- DXGetErrorString8(hr));
+ DXGetErrorString9(hr));
}
}
}
@@ -891,11 +895,11 @@ void JNICALL Java_javax_media_j3d_Canvas3D_readOffScreenBuffer(
}
if (d3dCtx->backSurface == NULL) {
- HRESULT hr = device->GetBackBuffer(0, D3DBACKBUFFER_TYPE_MONO,
+ HRESULT hr = device->GetBackBuffer(0,0, D3DBACKBUFFER_TYPE_MONO, //iSwapChain is 0
&d3dCtx->backSurface);
if (FAILED(hr)) {
printf("[Java 3D] GetBackBuffer fail %s\n",
- DXGetErrorString8(hr));
+ DXGetErrorString9(hr));
return;
}
}