thanks worked fine !!!
public void apply(int[] dest, int[] source) {
System.arraycopy(fb.getPixels(), 0, dest, 0, fb.getPixels().length);
}
trying to optimize the code, I'm looking for a way to remove the Graphics operations, and use the blit method, in order to draw the upper box with a blit over the main frambuffer
done this :
this the method to draw the current viewport
public void display(FrameBuffer buffer, int x, int y) {
if (buffer != null) {
buffer.blit(getTexture(), 0, 0, x, y, getTexture().getWidth(),
getTexture().getHeight(), false);
}
// fb.display(g, x, y);
}
that is called by (that its in my game class)
public void afterPaintComponent(Graphics g) {
rearview.display(getBuffer(), 30, 30);
g.setColor(Color.WHITE);
g.drawRect(30, 30, 300, 100);
g.drawString(Integer.toString(lastFPS) + "FPS", 15, 15);
}
and its called by my gamesuper class (that is a Jcomponent)
protected void paintComponent(Graphics g) {
if (buffer != null) {
buffer.display(g, leftBorderWidth, titleBarHeight);
afterPaintComponent(g);
}
}
but ... I got nothing at the white box ...