/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#include "sun_java2d_d3d_D3DGraphicsDevice.h"
#include "D3DGraphicsDevice.h"
#include "D3DPipelineManager.h"
#include "D3DRenderQueue.h"
#include "Trace.h"
#include "awt_Toolkit.h"
#include "awt_Window.h"
extern "C" {
/*
* Class: sun_java2d_d3d_D3DGraphicsDevice
* Method: initD3D
* Signature: ()Z
*/
{
return result;
}
/*
* Class: sun_java2d_d3d_D3DGraphicsDevice
* Method: getDeviceIdNative
*/
{
return NULL;
}
// ('%d.' will take no more than 6+1 chars since we are printing a WORD)
// AAAA&BBBB MAX_DEVICE_IDENTIFIER_STRING (%d.%d.%d.%d)0
// _snwprintf doesn't add 0 at the end if the formatted string didn't fit
// in the buffer so we have to make sure it is null terminated
delete pAdapterId;
return ret;
}
/*
* Class: sun_java2d_d3d_D3DGraphicsDevice
* Method: getDeviceCapsNative
* Signature: (I)I
*/
{
"D3DGD_getDeviceCapsNative: device %d disabled", adapter);
return CAPS_EMPTY;
}
return pCtx->GetContextCaps();
}
/*
* Class: sun_java2d_d3d_D3DGraphicsDevice
* Method: enterFullScreenExclusiveNative
* Signature: (IJ)V
*/
{
AwtWindow *w;
return JNI_FALSE;
}
"D3DGD_enterFullScreenExclusiveNative: disposed window");
return JNI_FALSE;
}
// REMIND: should we also move the non-topleve window from
// being on top here (it's moved to front in GraphicsDevice.setFSW())?
// let the mananger know that we're entering the fs mode, it will
// set the proper current focus window for us, which ConfigureContext will
// use when creating the device
newParams = *pCurParams;
}
/*
* Class: sun_java2d_d3d_D3DGraphicsDevice
* Method: exitFullScreenExclusiveNative
* Signature: (I)V
*/
{
return JNI_FALSE;
}
newParams = *pCurParams;
// we're exiting fs, the device window can be 0
newParams.hDeviceWindow = 0;
newParams.BackBufferWidth = 0;
// exited fs, update current focus window
// note that we call this after this adapter exited fs mode so that
// the rest of the adapters can be reset
}
/*
* Class: sun_java2d_d3d_D3DGraphicsDevice
* Method: configDisplayModeNative
* Signature: (IJIIII)V
*/
{
return;
}
newParams = *pCurParams;
// we leave the swap effect so that it's more likely
// to be the one user selected initially
// newParams.SwapEffect = D3DSWAPEFFECT_DISCARD;
if (bitDepth == 32) {
} else if (bitDepth == 16) {
if (modesCount == 0) {
}
{
{
// prefer 565 over 555
break;
}
}
}
}
"D3DGD_configDisplayModeNative: no 16-bit formats");
return;
}
} else {
"D3DGD_configDisplayModeNative: unsupported depth: %d",
bitDepth);
return;
}
// the full screen window doesn't receive WM_SIZE event when
// the display mode changes (it does get resized though) so we need to
// generate the event ourselves
}
}
/*
* Class: sun_java2d_d3d_D3DGraphicsDevice
* Method: getCurrentDisplayModeNative
* Signature: (I)Ljava/awt/DisplayMode;
*/
{
// these are the only three valid screen formats
case D3DFMT_R5G6B5:
}
" current dm: %dx%dx%d@%d",
}
return ret;
}
/*
* Class: sun_java2d_d3d_D3DGraphicsDevice
* Method: enumDisplayModesNative
*/
{
// EnumAdapterModes treats 555 and 565 formats as equivalents
{ D3DFMT_X8R8G8B8, D3DFMT_R5G6B5 };
{
// these are the only three valid screen formats,
// 30-bit is returned as X8R8G8B8
case D3DFMT_R5G6B5:
}
}
}
}
}
/*
* Class: sun_java2d_d3d_D3DGraphicsDevice
* Method: getAvailableAcceleratedMemoryNative
* Signature: (I)J
*/
{
// REMIND: looks like Direct3D provides information about texture memory
// only via IDirect3DDevice9::GetAvailableTextureMem, however, it
// seems to report the same amount as direct draw used to.
return 0L;
}
return mem;
}
/*
* Class: sun_java2d_d3d_D3DGraphicsDevice
* Method: isD3DAvailableOnDeviceNative
* Signature: (I)Z
*/
{
return JNI_FALSE;
}
return JNI_TRUE;
}
} // extern "C"