Jump to content

  • Log In with Google      Sign In   
  • Create Account

d. buffering with Directx in Java


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 30 December 1999 - 07:13 PM

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


Sponsor:

#2 SonicSilcion   Members   -  Reputation: 122

Like
Likes
Like

Posted 29 December 1999 - 11:18 AM

__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).]


#3 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 30 December 1999 - 07:13 PM

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




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS