Re: [JAVA2D] VolatileImage.validate() does not (always) work

2008-08-14 Thread Dmitri Trembovetski
[EMAIL PROTECTED] wrote: Hi again, so Dmitri, you would suggest to get the current graphics cinfiguration each time I touch the according image, right. That was the approach I used at the very beginning (as i have shown in one of my code examples here). But still, I have the problem that the

Re: [JAVA2D] VolatileImage.validate() does not (always) work

2008-08-13 Thread java2d
Hi again, so Dmitri, you would suggest to get the current graphics cinfiguration each time I touch the according image, right. That was the approach I used at the very beginning (as i have shown in one of my code examples here). But still, I have the problem that the call sometimes does not

Re: [JAVA2D] VolatileImage.validate() does not (always) work

2008-08-11 Thread Dmitri Trembovetski
[EMAIL PROTECTED] wrote: Dmitri, I have my rendering code in a separate thread for performance, so I cache the GraphicsConfiguration so that it can access it in a thread safe way. Is there a better way of doing this? Or can I just get the GraphicsConfiguration from the component from a

Re: [JAVA2D] VolatileImage.validate() does not (always) work

2008-08-10 Thread java2d
Dmitri, I have my rendering code in a separate thread for performance, so I cache the GraphicsConfiguration so that it can access it in a thread safe way. Is there a better way of doing this? Or can I just get the GraphicsConfiguration from the component from a thread other than the EDT?

Re: [JAVA2D] VolatileImage.validate() does not (always) work

2008-08-08 Thread java2d
Hi Mark, Because our software is a huge project with many packages, it is not that easy . . . The graphic I'am talking about is nested in one of our own dialog classes. This dialog can be made of of different container types. In my case this type is a JFrame. So i added this code to the

Re: [JAVA2D] VolatileImage.validate() does not (always) work

2008-08-08 Thread Dmitri Trembovetski
Ugh. Please don't attempt to cache or track your GraphicsConfiguration. It will be updated for you when the window is moved. You are supposed to retrieve it every time from the component. The test I sent the other day was just an illustration and quick verification test, not

Re: [JAVA2D] VolatileImage.validate() does not (always) work

2008-08-07 Thread java2d
Maik, Can you please show the code where you detect the changed GraphicsConfiguration? Is it in the top level window (JFrame / JWindow etc) of your application? Mark [Message sent by forum member 'markgrantham' (markgrantham)] http://forums.java.net/jive/thread.jspa?messageID=292232

Re: [JAVA2D] VolatileImage.validate() does not (always) work

2008-08-06 Thread Dmitri Trembovetski
[EMAIL PROTECTED] wrote: Okay, when I decide to use active rendering in windowed mode, do I get hardware acceleration as well? I just surfed a little bit through the net regarding this topic and read here http://www.gamedev.net/reference/programming/features/javarender/page2.asp , that

Re: [JAVA2D] VolatileImage.validate() does not (always) work

2008-08-06 Thread java2d
You seem to be identifying blitting with lack of hardware acceleration. Well, yes . . . . Some time ago I found this site on the net: http://java.sun.com/javase/6/webnotes/trouble/TSG-Desktop/html/gcrua.html There it is said that Any time you see a MaskBlit or any of the General* primitives,

Re: [JAVA2D] VolatileImage.validate() does not (always) work

2008-08-06 Thread Dmitri Trembovetski
[EMAIL PROTECTED] wrote: You seem to be identifying blitting with lack of hardware acceleration. Well, yes . . . . Some time ago I found this site on the net: http://java.sun.com/javase/6/webnotes/trouble/TSG-Desktop/html/gcrua.html There it is said that Any time you see a MaskBlit or any

Re: [JAVA2D] VolatileImage.validate() does not (always) work

2008-08-06 Thread java2d
Maik, The Timer which you are using is a java.util.Timer (not a javax.swing.Timer), so your rendering function is not being called on the Event Dispatch Thread. This could be why you are not always getting the GraphicsConfiguration / GraphicsDevice which you expect (as

Re: [JAVA2D] VolatileImage.validate() does not (always) work

2008-08-05 Thread java2d
Hi Ken, I'm just at work and see that I call it indirectly through repaint(). To be honest, it confuses me a bit that there are the methods repaint(), paint(Grphics g) and even update(Graphics g). I'm sure that I read about the differences and when I have to use one or the other at the time I

Re: [JAVA2D] VolatileImage.validate() does not (always) work

2008-08-05 Thread Ken Warner
If you call repaint() you invoke the AWT thread and paint() is called by the AWT thread. update() and paint() should not be called directly by your program they are generally called from the AWT thread in response to some sort of system event like Expose or Move etc. With VolitileImages, you

Re: [JAVA2D] VolatileImage.validate() does not (always) work

2008-08-05 Thread java2d
Hi Ken, With VolitileImages, you should render directly from your program by calling your own render method directly. Don't call repaint(). I do use my own render method, but that method only renders on my background volatile image. After that is finished I somehow have to get my image onto the

Re: [JAVA2D] VolatileImage.validate() does not (always) work

2008-08-05 Thread Dmitri Trembovetski
You can certainly use repaint() with VolatileImages as back buffers. The alternative approach is called active rendering, where you control when stuff gets rendered. Take a look at this: http://java.sun.com/docs/books/tutorial/extra/fullscreen/rendering.html While this is a full

Re: [JAVA2D] VolatileImage.validate() does not (always) work

2008-08-05 Thread Ken Warner
That's the way I do things. I do active rendering using BufferStrategy. I turn off repaint() setIgnoreRepaint(true) while I'm active rendering and then when I'm not active rendering and the applet is just sitting there, I turn on repaint() with setIgnoreRepaint(false) so that if the applet gets

Re: [JAVA2D] VolatileImage.validate() does not (always) work

2008-08-05 Thread java2d
Okay, when I decide to use active rendering in windowed mode, do I get hardware acceleration as well? I just surfed a little bit through the net regarding this topic and read here http://www.gamedev.net/reference/programming/features/javarender/page2.asp , that this attempt uses blitting in

Re: [JAVA2D] VolatileImage.validate() does not (always) work

2008-08-04 Thread java2d
Hi Dmitri, your Graphics Configuration Update Test works as expected. The title of the window changes each time it is dragged to an other screen. So, could it be that the recognition of the current screen device can depend on the overall load of the system? I mean, your test program is very

Re: [JAVA2D] VolatileImage.validate() does not (always) work

2008-08-04 Thread Dmitri Trembovetski
[EMAIL PROTECTED] wrote: Hi Dmitri, your Graphics Configuration Update Test works as expected. The title of the window changes each time it is dragged to an other screen. So, could it be that the recognition of the current screen device can depend on the overall load of the system? I mean,

Re: [JAVA2D] VolatileImage.validate() does not (always) work

2008-08-04 Thread java2d
To be honest I doubt it. I never seen this happen. Okay, but what is the explanation for the fact that I NEVER have this problem on the other system although it is 100% the same code? I mean, i don't want to say that my code is without some errors, but it should happen on both machines, if it

Re: [JAVA2D] VolatileImage.validate() does not (always) work

2008-08-04 Thread Dmitri Trembovetski
[EMAIL PROTECTED] wrote: To be honest I doubt it. I never seen this happen. Okay, but what is the explanation for the fact that I NEVER have this problem on the other system although it is 100% the same code? I mean, i don't want to say that my code is without some errors, but it should

Re: [JAVA2D] VolatileImage.validate() does not (always) work

2008-08-04 Thread java2d
Does your rendering loop run on the event dispatch thread or some other thread? Well, I am not that familiar with the event dispatch thread and myabe that's the problem in my code . . . . To render my image, which should happen at a fixed rate of 20Hz, I use a Timer which calls my render

Re: [JAVA2D] VolatileImage.validate() does not (always) work

2008-08-04 Thread Ken Warner
Do you call paint method directly or indirectly through repaint()? [EMAIL PROTECTED] wrote: Does your rendering loop run on the event dispatch thread or some other thread? Well, I am not that familiar with the event dispatch thread and myabe that's the problem in my code . . . . To render

Re: [JAVA2D] VolatileImage.validate() does not (always) work

2008-08-01 Thread java2d
Okay, so here is my code. Nothing special, I guess . . . . // Render Frame to volatile image. do { // Check if the viBackbuffer is still valid. graphicsConfiguration = this.getGraphicsConfiguration(); valCode = viBackbuffer.validate(graphicsConfiguration);

Re: [JAVA2D] VolatileImage.validate() does not (always) work

2008-08-01 Thread java2d
Hi Dmitri, I have to apologize to the vaildate() method because it is the this.getGraphicsConfiguration that does not always realize that the image is located on a different screen. Now, I make a printout of the device ID each time I call this.getGraphicsConfiguration and although the dialoge

Re: [JAVA2D] VolatileImage.validate() does not (always) work

2008-08-01 Thread Dmitri Trembovetski
I don't see much wrong with the code. See comments below. [EMAIL PROTECTED] wrote: Okay, so here is my code. Nothing special, I guess . . . . // Render Frame to volatile image. do { // Check if the viBackbuffer is still valid. graphicsConfiguration =

Re: [JAVA2D] VolatileImage.validate() does not (always) work

2008-08-01 Thread Dmitri Trembovetski
Could you please try this test on that system and see if the device in the title changes when you move the frame back and forth. [code] import java.awt.Frame; import java.awt.GraphicsDevice; import java.awt.event.ComponentAdapter; import java.awt.event.ComponentEvent; import

Re: [JAVA2D] VolatileImage.validate() does not (always) work

2008-08-01 Thread java2d
Hi Dmitri, thanks for your effort! I will try your code on monday, when I am back at work. Anyway, to answer the questions from your first answer today: Firstly, yes, I am sure that no other thread updates my graphicConfiguration field. The other answer is that meanwhile I do print out the

Re: [JAVA2D] VolatileImage.validate() does not (always) work

2008-07-31 Thread Dmitri Trembovetski
Hi Maik, Where and how do you get the graphics configuration that you use to validate the VolatileImage? Could you print it out and see if it changes when you move the window from one screen to another? You can also print out the device this GraphicsConfiguration belongs to. It

Re: [JAVA2D] VolatileImage.validate() does not (always) work

2008-07-31 Thread java2d
Hi Dmitri, as I described in my questioning thread, I get the graphics configuration via viBackbuffer.validate(this.getGraphicsConfiguration) whereas viBackbuffer is an VolatileImage object. The expression this.getGraphicsConfiguration I found in many documentation for the usage of