🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

d. buffering with Directx in Java

Started by
1 comment, last by GameDev.net 24 years, 6 months ago
__Java and DirectX?! That might be your problem right there.
__Well, if it isn't I (unfortunately) can't help. I'm geared toward OpenGL (and don't know much about it, either.) I took my Java class in the Business Department at college so someone, please, correct me if I'm wrong.
__Animation is usually done via multithreading in Java. (Java automatically handles multithreading.) Basically one thread is used to repaint the screen while the other monitors the clock and triggers the first thread (indirectly, I believe) when it is time to repaint. I never had a chance to get it working right (too many other assignments.)
__As for the error(s), it could just be you forgot to handle ("catch") exceptions that are normally thrown by DirectX. Exceptions happen a LOT in Java, especially with input.

[This message has been edited by SonicSilcion (edited December 29, 1999).]

Advertisement
I want to get rid of the flicker when my screen gets updated but I am unable to get double buffering working with Directx and Java. When I run it the applet gives me a "com.ms.com.ComFailException:Unknown error
(0x887600647)". This happens if I set either the "DDSD_BACKBUFFERCOUNT"
or the "DDSCAPS_FLIP" or "DSCAPS_COMPLEX" flags. In the examples I have
seen these flags seem to be necessary for double buffering.

This is my code:
ddsd = new DDSurfaceDesc();
ddsd.flags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT ;
ddsd.ddsCaps = DDSCAPS_PRIMARYSURFACE |DDSCAPS_FLIP | DSCAPS_COMPLEX;
ddsd.backBufferCount = 1;
ddsPrimary = dd.createSurface(ddsd);

I'm hoping that I'm just missing a step. If anyone has done this and
can send me a working example of double buffering with Directx in Java
it would be greatly appreciated. Thanks.
arrow@halcyon.com

Thanks, I will check that out. As you can imagine I am having a very hard time finding anyone else who has worked with Directx and Java. Other than the documentation that came with the Microsoft Java SDK I haven't found much information on it

This topic is closed to new replies.

Advertisement