RB graphics display speed 
Author Message
 RB graphics display speed

Hi.
I've made an application in RB displaying the Mandelbrot set in a
Canvas using RGBSurface.pixel(x,y) function.
When I compile it with RB 3.2 on Mac OS 9.1 and run it on Mac OS 9.1,
the display is achieved 5 times faster than when I compile it with RB
3.5 on Mac OS X.1 and run it on Mac OS X.1
Have you had such a graphics display speed problem???
Thanks.


Fri, 30 Apr 2004 20:38:12 GMT  
 RB graphics display speed

Quote:

> I've made an application in RB displaying the Mandelbrot set in a
> Canvas using RGBSurface.pixel(x,y) function.
> When I compile it with RB 3.2 on Mac OS 9.1 and run it on Mac OS 9.1,
> the display is achieved 5 times faster than when I compile it with RB
> 3.5 on Mac OS X.1 and run it on Mac OS X.1

How often are you updating the screen, and how are you doing so?  OS X
is certainly slower than classic MacOS for many reasons, but these are
usually only display-related -- if you turn off drawing to the window,
I'd expect the speed to be very similar.  (A bit slower on OS X just
because it's running lots of other processes in the background.)

Cheers,
- Joe

--
,------------------------------------------------------------------.
|    Joseph J. Strout         Check out the Mac Web Directory:     |

`------------------------------------------------------------------'



Sat, 01 May 2004 00:55:55 GMT  
 RB graphics display speed

Quote:

> Have you had such a graphics display speed problem???

Changing the window's content forces RB to tell Mac OS X to redraw the
window which is fast but too slow if you do it 100 times a second.

Draw your picture into a picture object. Than draw that picture object
into the canvas. DON'T draw into a backdrop picture or directly into a
canvas if it need to be fast.

Mfg
Christian

--
"Merke: Mac-User wollen nicht die beste Bohrmaschine, sondern die
sch?nsten L?cher in der Wand."
                                         (Gerhard Piezinger in rk)
http://www.christians-software.de (Kostenlose Mac/Win Software)



Sat, 01 May 2004 06:49:03 GMT  
 RB graphics display speed

Quote:

> Hi. I've made an application in RB displaying the Mandelbrot set in a
> Canvas using RGBSurface.pixel(x,y) function. When I compile it with RB
> 3.2 on Mac OS 9.1 and run it on Mac OS 9.1, the display is achieved 5
> times faster than when I compile it with RB 3.5 on Mac OS X.1 and run
> it on Mac OS X.1 Have you had such a graphics display speed problem???

Show us your displaying code.

And secondly, OSX is slower than 9.1, for everything User Interface.

--
Email Cleaner does convenient re-wrapping on badly wrapped emails and
newsgroup-posts. Badly wrapped lines is a problem every Internet User
comes across, Email Cleaner solves it! It also has many other features.

Email Cleaner works from inside all of your Mac programs, from one
button click.

<www.elfdata.com/emailcleaner/>



Sat, 01 May 2004 06:58:06 GMT  
 RB graphics display speed

Quote:



> > I've made an application in RB displaying the Mandelbrot set in a
> > Canvas using RGBSurface.pixel(x,y) function.
> > When I compile it with RB 3.2 on Mac OS 9.1 and run it on Mac OS 9.1,
> > the display is achieved 5 times faster than when I compile it with RB
> > 3.5 on Mac OS X.1 and run it on Mac OS X.1

> How often are you updating the screen, and how are you doing so?  OS X
> is certainly slower than classic MacOS for many reasons, but these are
> usually only display-related -- if you turn off drawing to the window,
> I'd expect the speed to be very similar.  (A bit slower on OS X just
> because it's running lots of other processes in the background.)

The process is simple:
For each pixel of my Canvas I compute a function (the one which allows
to build the Mandelbrot set) and then I assign the result of the
function (which is a color made of 3 floats) to the RGBSurface
(something like myCanvas.graphics.RGBSurface.pixel(x,y) =
myColor(r,g,b)).
I use RB 3.5. When I compile my app in PPC/OS9 code and run it in the
classic environment (OS9) my canvas is computed and filled
approximately 10 times faster than when I compile it in OSX code and
run it in the OSX environment!
Remark: I write directly to screen either than in a buffer because I
want to see the canvas wile it fills and not only after it is
completed.
Do you understand the problem?
My app seems either to do the computations, either to do the display,
either both of them, (but I suspect more the display part) 10 times
slower in OSX than in OS9...
What's your opinion?
Thanks.


Sat, 01 May 2004 15:06:17 GMT  
 RB graphics display speed

Quote:
> Changing the window's content forces RB to tell Mac OS X to redraw the
> window which is fast but too slow if you do it 100 times a second.

Why is my application about 10 times slower under OSX than under
OS9??? Is it only a matter of display? Why?

Quote:
> Draw your picture into a picture object. Than draw that picture object
> into the canvas. DON'T draw into a backdrop picture or directly into a
> canvas if it need to be fast.

I would like to display the result of my Mandelbrot set as and when it
is computed (pixel after pixel).
It works fine under OS9: each time a pixel is computed I display it
with a "myCanvas.graphics.RGBSurface.pixel(x,y) = theComputedColor",
but under OSX the display is 10 times slower... (I repeat: with the
same project compiled once for PPC(OS9) and once for OSX.
How do you explain this?
Thanks.


Sat, 01 May 2004 20:06:34 GMT  
 RB graphics display speed

Quote:

> How do you explain this?

YOU draw the pixel.
MacOS9 draws this pixel on screen.
MacOSX draws the pixel into the pixel buffer and than draws the hole
buffer into the window.
This is slower and you should change your code to display the picture
only maybe every 100th pixel.

Mfg
Christian

--
Die Loveparade ist vorbei, die Raver hinterliessen sage und schreibe
220 Tonnen Mll, die Musik noch nicht mitgerechnet. (NDR2-Nachrichten)

http://www.christians-software.de (Kostenlose Mac/Win Software)



Sat, 01 May 2004 21:30:17 GMT  
 RB graphics display speed

Quote:

> For each pixel of my Canvas I compute a function (the one which allows
> to build the Mandelbrot set) and then I assign the result of the
> function (which is a color made of 3 floats) to the RGBSurface
> (something like myCanvas.graphics.RGBSurface.pixel(x,y) =
> myColor(r,g,b)).

Wow, I'm surprised myCanvas.graphics even has an RGBSurface.  As others
have suggested, Don't Do This.  Instead, update the RGBSurface of a
picture you've created with NewPicture.  Then periodically update the
screen with DrawPicture.  (This will have the nice side-benefit of
allowing you to refresh your window after it's covered by some other
window, without having to recompute the entire Mandelbrot set!)

Quote:
> Remark: I write directly to screen either than in a buffer because I
> want to see the canvas wile it fills and not only after it is
> completed.

I understand this urge, but you should still write to a buffer.  Just
update the screen every row or so.  (Or every pixel if you must, but
then don't complain if it's slow -- the speed of OS X graphics is not
up to us.)

Cheers,
- Joe

--
,------------------------------------------------------------------.
|    Joseph J. Strout         Check out the Mac Web Directory:     |

`------------------------------------------------------------------'



Sun, 02 May 2004 00:42:55 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Array of sets of displayed controls in RB

2. 8bit graphics in RB

3. Graphics in RB?

4. RB and 1 bit bw display ?

5. Transparent Graphics with RB???

6. Speed..Speed..Speed

7. speed display text under Window95

8. LAbView graphics speed?

9. VGA 640*480 : display speed problem

10. Fortran Powerstation Graphics Speed

11. Graphics speed on Windows NT

 

 
Powered by phpBB® Forum Software