Aha...
My simple hack ignored multimon and assumed the code
wanted to vsync on the primary display (wouldn't life
be easier without multimon?); in your case, my simple
approach would not work.
However, if you want to avoid JAWT, I would think you could
get teh information you need somehow at the Java level and
pass it down to your native code to help determine the
correct device. That is, given the bounds of the screen
(GraphicsDevice, GraphicsConfiguration), you should be able to
do various native calls to figure out which ddraw device
that mapped to. On the other hand, it's probably easier to
do this through JAWT, so maybe you're better off with
your current approach...
Chet.
Michele Puccini wrote:
Chet,
as you guessed I need the handle to the window in order to determine the
device (monitor) I'm using. Different devices may have different refresh
rates. In my case I have the main monitor at 75Hz and the PAL second
monitor
at 50Hz.
Here I construct a ddraw object using the native window handle of the java
canvas (using jawt).
// init
DDrawPtr = DirectDrawCreateFromWindow(hWnd);
hMonitor = OneMonitorFromWindow(hWnd);
if (hMonitor != NULL)
{
MonitorInfo.cbSize = sizeof(MONITORINFO);
GetMonitorInfo(hMonitor,&MonitorInfo);
}
// then I call
videoutils.waitvbl() from the java side. I don't have any native paint
code.
Working without JAWT can make life simpler. Can you post some code ?
Maybe you may want to take a look at my code. Just ask for it.
Mik
--
----- Original Message -----
From: "Chet Haase" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 30, 2006 3:37 PM
Subject: Re: [JAVA2D] FullScreen, BufferStrategy, Vertical Blanking
Note that you may be able to get away with vsync'ing without
JAWT; vsync is done on a per-device basis and does not need a
handle to the window. The main reason you'd need to know the
window would be to determine the correct device (display) to
use. If you can determine that some other way, then you
can skip JAWT altogether and just call the appropriate
vsync operation on the correct device.
(I just tried this experiment on an unrelated project and
it seemed to work - I init a separate ddraw object at startup
time and then call into JNI to call ddraw's WaitForVerticalBlank
function in my paint method. Works like a charm).
Chet.
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".