FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Programming Questions & Help
   Programs
(Moderators: fry, REAS)
   alphaimages too slow?
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: alphaimages too slow?  (Read 1364 times)
levinbeicht


alphaimages too slow?
« on: Apr 7th, 2005, 11:17am »

Hi!
 
I'm trying to code a smooth side-scrolling game and for that I have 3 background images (BGraphics) the largest sized at 3200 * 240 pixels. The sketch is sized 640*240.
 
In setup() i apply an Alpha-Layer to them (also BGraphics) so i can draw them over each other.
In loop() i draw these images on the screen using  image():
 
Code:

image(background03, 0 , 0, width - 1, height - 1, xpos, 0, xpos + width - 1, height - 1);
image(background02, 0 , 0, width - 1, height - 1, xpos * 2, 0, xpos * 2 + width - 1, height - 1);
image(background01, 0 , 0, width - 1, height - 1, xpos * 4, 0, xpos * 4 + width - 1, height - 1);

where xpos is the position of the player.
 
but drawing these images kills the performance. (and by kill i mean i get about 10 fps on my 3ghz p4 with nothing on the screen but these 3 images).
 
First i thought the images i used were too big, so i scaled them down, but this did nothing to the performance.  
 
Anybody has any ideas how to speed things up a little?
I mean it should be possible to draw more than 3 images a frame, so what am i doing wrong?
 
Pages: 1 

« Previous topic | Next topic »