[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
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
[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
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?
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
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
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
[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
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,
[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
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
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
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
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
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
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
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
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
[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,
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
[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
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
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
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);
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
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 =
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
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
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
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
30 matches
Mail list logo