@jonssonj
If your window is borderless you can just:
SetRast(win->RPort, 2);
However, if your window has borders then you need to account for them:
{
LONG l, t, w, h;
l = win->BorderLeft;
t = win->BorderTop;
w = win->Width - win->BorderLeft - win->BorderRight;
h = win->Height - win->BorderTop - win->BorderBottom;
if (w > 0 && h > 0)
{
/* White background */
SetAPen(win->RPort, 2);
RectFill(win->RPort, l, t, l + w - 1, t + h - 1);
...
}
}
Another possibility is using WA_BackFill and custom backfill hook.
Here's slightly more complex example showing how it is possible to handle custom colour rendering on any public screen:
simplewindow.c