Hi all,

I have a question (or potential bug report) about the flushGraphics() method of the new GameCanvas.

I'm particularly bewildered by the flushGraphics(int x, int y, int width, int height) method that allows the setting of a region for copying. According to the docs, the following are the definition of the params:

x - the left edge of the region to be flushed
y - the top edge of the region to be flushed
width - the width of the region to be flushed
height - the height of the region to be flushed

I believe the x and y values referred to the region of the off-screen buffer and NOT the display. However, in my case the x and y values seem to refer to the region on the display and not the buffer. Heres the detail explanation.

Imagine i flushed the display to all 0 at the start: (ascii art below)

0000000000
0000000000
0000000000
0000000000

I computed my camera's aspect, checked with the display's dimension and position the clipping region at the center so that the perspective is correct and the display is nicely centered. The clipping region is as shown:

0001111000
0001111000
0001111000
0001111000

Assuming each block is 1 unit, the following is how i setup the clipping for the Graphics3D during each render:

Graphics3D.getInstance().setViewport(4,4,4,4);

I also set the clipping region for the off-screen buffer:

offscrBuffer.setClip(4,4,4,4);

Before rendering the first frame, i filled the entire off-screen buffer with '9', theni render to the clip region of the off-screen buffer and it looks something like this:

9992345999
9992345999
9992345999
9992345999

Ok finally, then i call flushGraphics(4,4,4,4) to flush all the '9's from the off-screen buffer to the display. Instead of getting a nice display, i got the following...

0009992000
0009992000
0009992000
0009992000

As u can see, the (x,y) params in the flushGraphics() call did not flush the correct region of the off-screen buffer to the display. The (x,y) values seem to refer to the "top left" corner of the display and NOT the off-screen display. To show that, i tried call flushGraphics(0,0,4,4). True enough, i got the following:

9992000000
9992000000
9992000000
9992000000


Is this a bug or did i mis-understood something? Have anyone encountered this before?

Oh yes, i forgot to add. I'm using JDK5 and Midp2.0 of course.
System is a intel 2.4GHz and Win2K. I'm using the NetBeans4.2 development environment.