problem with setting a display mode

while in full screen mode,
if i try to set the display mode to a smaller resolution than the current resolution i’ve set for windows.
for example, if the current resolution for windows is 1024X768 and i call:

gd.setDisplayMode(
new DisplayMode(800,600,32, DisplayMode.REFRESH_RATE_UNKNOWN));

everything works fine.

but, if try it the other way around, that is, try to set the resolution to be larger than the current resolution of windows, my game appears on only part of the screen, and i can see the desktop, as though i haven’t switched to full screen mode, although the resolution is changed to the desired resolution…

Assuming you are using BufferStrategy:

Resizing windows with BufferStrategy pre 1.6 - You need to recreate the BufferStrategy because the strategy doesn’t get updated automatically.
I’m not sure what happens in fullscreen mode, but its worth trying to recreate the BufferStrategy and see what happens.

i only create the buffer strategy after changing resolution and switching to full scree mode

what platform, jdk version?

Dmitri
Java2D Team

XP, 1.5

ok, i’ve solved half the problem- i called resize() after setting full screen, i guess that caused the desktop to show.
but now instead of seeing the desktop, i just get a flickering in all the area outside that that is being painted in the game loop, although i do call g.fillRect(0, 0, win.getWidth(), win.getHeight()), and i haven’t set a clipping region…

That’d explain why you’re not getting any acceleration with d3d=true. Could you try 6.0?

Dmitri
Java2D Team

excuse me for my ignorance, but that do you refer to by 6.0? the jdk?

Yes he means the new 1.6 jdk which they are apparently calling 6.

and the older jdk’s don’t support d3d?

pre-6.0 jdks only used d3d for rendering lines (and rendering translucent
compatible images if you set a special flag). 6.0 has an improved Direct3D pipeline.
Search for “Direct3D pipeline” post from me for details.

Thanks,
Dmitri

sorry for being so clueless, but the latest jdk i can find in sun’s website is 5.0…
where’s 6.0?
and i really would rather rely on the opengl pipeline, as it is supported by most systems.

Java 6.0 is not yet released. But the betas are available from the Mustang project on java.net. https://mustang.dev.java.net/