[Qt-interest] Fwd: Re: fastest way to draw everchanging pixels

Sean Harmer sean.harmer at maps-technology.com
Sat Mar 21 17:42:46 CET 2009


Sorry I meant to post this to the list...
----------  Forwarded Message  ----------

Subject: Re: [Qt-interest] fastest way to draw everchanging pixels
Date: Saturday 21 Mar 2009
From: Sean Harmer <sean.harmer at maps-technology.com>
To: Reto Glauser <qt at blinkeye.ch>

Hi,

Reto Glauser wrote:
> Hello
>
> I'm porting a project from Java (Swing) to QT. I try to visualize a gas
> simulation and have to draw atoms and walls on the screen. I use 1 pixel per
> object, e.g. a blue pixel is an atom and a red pixel is a wall. Since this 
is a
> simulation I'm looking for the fastest way to draw everchanging pixels.
<snip>
> I obviously need another mechanism to visualize the simulation in QT. At the
> moment hardware accelerated support (e.g. OpenGL) is not an option (which is 
not
> used by Java either). Any hints?
>   

Try reducing the number of function calls by calculating the positions 
of each kind of point (gas molecules and walls) then just make two calls 
to QPainter::drawPoints( const QPointF* points, int pointCount ) (or the 
integer equivalent if you are not using QGraphicsView).

HTH,

Sean


-------------------------------------------------------



More information about the Qt-interest-old mailing list