sprite rendering
First off, I don't understand how rendering works with
an image that is partially visible on screen. Let's say
for example, I have a sprite that is half off screen,
in my rendering method, when I say g2D.drawImage(sprite.getImage(), sprite.getX(), sprite.getY(), observer);
What exactly happens? Is time wasted trying to
draw the pixels that are not on the screen? Please ask
me to specify if any other information is needed. Thanks
in advance.
Here are the specs that may be useful:
- uses BuffereStrategy (3 buffers)
- undecorated 'Frame' at fullscreen exclusive mode (640 by 480)
[660 byte] By [
afarmanda] at [2007-9-29 11:40:14]

I've often wondered this.
While testing a game I'm working on at the moment I was drawing about 10000 drawRect()'s to the screen per game loop, obviously this slowed the game down, *but*, when the drawRect()'s weren't onscreen (once I scrolled passed them) the game speed shot back up, so I'm guessing if it isn't drawing drawRect()'s that aren't visible maybe the same applies to images, although I'd further guess that the whole image has to be off screen before its not being drawn, unless java is doing something super cool with the raster (is that right?) that is.
Further, clarification on this from someone who isn't guessing would be nice :)