Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » High Performance Drawing
High Performance Drawing [message #13144] |
Sun, 16 December 2007 12:48 |
cbpporter
Messages: 1401 Registered: September 2007
|
Ultimate Contributor |
|
|
Hi!
I need high performance flicker free graphics. The high performance part is relativelly covered, but not the flicker free one.
Code that draws stuff when the mouse is moved is pretty flickery, even when drawn to an Image first (x and y are updated by mouse move. The issue is most apparent when using larger windows and resolutions:
void aggtest::Paint(Draw& draw)
{
if (GetSize().cx == 0 || GetSize().cy == 0)
return;
ImageDraw agdraw(GetSize());
agdraw.DrawRect(GetSize(), White);
agdraw.DrawLine(x,y,150,150,50,Blue);
Image img(agdraw);
draw.DrawImage(0,0,GetSize().cx,GetSize().cy,img);
}
I don't think that this is a buffer issue, it is rather and issue with screen refresh synchronization. Does anybody know a way to reduce this flicker under Windows/Linux. I don't want to use OpenGL or DirectX to wait for hardware sync with the monitor.
Also, creating a buffer at every paint seems rather costly for large resolutions. Isn't there a way to keep a buffer pre-allocated and then obtain Image objects out of it with non-destructive copy?
And the documentation about ImageDraw is inaccurate:
Quote: |
Image img(100, 100);
ImageDraw idraw(img);
myobject.Paint(idraw);
idraw.Close();
// now the Image has been modified by the myobject's drawing
operations and can be e.g. saved to disk
|
ImageDraw does not have a ImageDraw(const Image&) constructor or a Close() method.
Furthermore, I couldn't find a way to create an ImageDraw object starting from an existing Image since the above methods are not present.
|
|
|
|
|
High Performance Drawing
|
|
|
Re: High Performance Drawing
By: mirek on Sun, 16 December 2007 23:15
|
|
|
Re: High Performance Drawing
|
|
|
Re: High Performance Drawing
By: mirek on Mon, 17 December 2007 14:47
|
|
|
Re: High Performance Drawing
|
|
|
Re: High Performance Drawing
By: mirek on Wed, 26 December 2007 14:16
|
|
|
Re: High Performance Drawing
|
|
|
Re: High Performance Drawing
By: mirek on Tue, 01 January 2008 10:54
|
|
|
Re: High Performance Drawing
By: phirox on Tue, 01 January 2008 21:21
|
|
|
Re: High Performance Drawing
By: phirox on Tue, 01 January 2008 23:54
|
|
|
Re: High Performance Drawing
|
|
|
Re: High Performance Drawing
By: mirek on Wed, 02 January 2008 22:00
|
|
|
Re: High Performance Drawing
By: phirox on Sat, 05 January 2008 19:55
|
|
|
Re: High Performance Drawing
By: mirek on Sun, 06 January 2008 08:54
|
|
|
Re: High Performance Drawing
|
|
|
Re: High Performance Drawing
|
|
|
Re: High Performance Drawing
By: mirek on Wed, 23 January 2008 17:01
|
|
|
Re: High Performance Drawing
|
|
|
Re: High Performance Drawing
|
|
|
Re: High Performance Drawing
|
Goto Forum:
Current Time: Fri Mar 29 16:34:07 CET 2024
Total time taken to generate the page: 0.01976 seconds
|