[haiku-appserver] Re: Be's BView and BGLView (and BDirectWindow?) clipping info is faulty

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-appserver@xxxxxxxxxxxxx
  • Date: Thu, 07 Apr 2005 15:45:52 +0200 CEST

"Rudolf" <drivers.be-hold@xxxxxxxxxxxx> wrote:
> ->BGLView::DirectConnected()'s info struct's direct=5Fbuffer=5Finfo's 
> clipping info is bad. 
> The member: clipping=5Frect=A0clip=5Flist[1] to be precise. This 
> should be a 
> pointer, not a array[1]. If you look at sample code handling the info 
> here you see it uses it as a pointer as well, but if you look at it's 
> 'content' (array or pointer) you'll find that only the first clipping 
> rect is there. All rects beyond that are zero's or undefined. The 
> number or clipping=5F rects there is reflected by uint32 clip=5Flist=
> 5Fcount, 
> which is correct.

I cannot confirm this. The [1] array at the end of a structure is often 
used to indicate that the structure itself has a non specified length. 
This is only important if you have to copy the whole structure or just 
the clipping info. In BeUAE I used this to copy the clipping info and 
it worked fine:

        fClipListCount = info->clip_list_count;
        if (fClipListCount > MAX_CLIP_LIST_COUNT)
                fClipListCount = MAX_CLIP_LIST_COUNT;

        memcpy(fClipList, info->clip_list, fClipListCount * 
sizeof(clipping_rect));

(I previously defined MAX_CLIP_LIST_COUNT to be 64, as the fClipList 
array wasn't larger :-))

Since the clipping info is specified in screen coordinates, I would 
find it very odd if a BMenuBar (which is just a view) would mess the 
clipping up, but who knows.
IIRC there is also a stars demo that uses both, a BMenuBar and a direct 
window - maybe that can give us a clue.

Bye,
   Axel.


Other related posts: