Hi !

> > "compressed" lines in the extra space.
> 
> But 
> 
>       pixelPointer += stride - mode.virt.x;
> 
> should work for all cards?

No. This line can only work for 8BPP. As said, going down one pixel is done
by

(uint *)pixelpointer += stride.

The virtual mode size has nothing to do with that. The demo you probably looked
at uses it, because it will have advanced its pixelbuffer by exactly
mode.virt.x bytes at that time.

> My ggilib is from february or so, didn't want to build a new ggi lib. But
> yes, I'll take the time and get me the new one.

That would qualify for the known SegV problem.

> mouse pointer, this image that traveles around the screen, when the mouse
> is moved. When I run a ggi programm I get only a white pixel that moves.

Yes. This is intentional. If you start a GGI program outside X, you will
have no mouse pointer at all. The reason we leave one pixel in X is, that
it helps for your orientation with respect to leaving the program window.

> If I'm not totatly wrong I remember that I've read some where that the
> graphic cards have extra suport for cursors/mouse pointers. 

Yes.

> As this would be a hardware feature I expected to gain control with a ggi 
> function. So there is no XCreatePixmapCursor, XDefineCursor, XFreeCursor
> for ggi?

Yes, as this _requires_ Hardware support. We will soon provide an extension 
that does this, but it will only work on cards that have hardware support 
for it.

> But if ggi doesn't control the cursor appearance, who decides that in my
> ggi apps only a whit dot is drawn?

GGI itself draws nothing. The change of the X cirsor is only done to get a
consistent look for LibGGI programs. If you want to have a Mouse-Cursor in
LibGGI programs, you have to draw it yourself.

> I got emZero's. Strange that this disapeared when I recompiled it.

Hmm - maybe something got miscompiled or you had a buffer overflow somewhere.

> after this I have the main loop that should do something if a mouse 
> button was pressed or should break the loop if a key was pressed;
> 
> It looks like this:
> 
>   while ( 1 )
>     {
>       if ( ( eventMask = ggiEventPoll( visual, emPtrButton | emKeyPress, NULL ) ) < 
>0 )
>       {
>         fail( "Error in event poll\n" );
>       }
> 
>       if ( ggiEventRead( visual, &theEvent, emAll ) == 0 )
>       {
>         fail( "Error in reading new event!\n" );
>       }

Um - why do you use emAll here ? Please use emPtrButton | emKeyPress like in
the Poll call. The thing you have now will dequeue _any_ event that came in, 
as soon as an event that matches the mask in the Poll-call comes in.

> theEvent.any.type
> 
> showed that there were lots of pointer movement events. But I didn't want
>  them, I set the event mask so that it shouldn't receive other events 
> than I want. 

No - the event mask is _advisory_. It will disable modules in the Poll-
Sequence that deliver _none_ of the asked-for events. However the mouse does
send both an interesting event (Buttons) and another one. 

> showed that I seam to get all queued pointer positions befor and after the
>  mouse press event for the time sequenz where the pointer was in the
> window ( I'm using the X target).

Yes. This is correct for the code above. Use the correct Mask for the
EventRead to filter out all the movement events.

> Why do I get events that I don't want to get?

Because the Setmask call is advisory.

> Is there a better solution?

Yes - calling EventRead with proper evMask.

> How do I have to code it when I want to know the position, where the button
>  press and release event happened?

You track the movement events. The last movement event will be the place the
pointer was clciked at.

> Do I have to cache the positions delivered by pointer movement events all
>  the time and use the last position befor the button press event happened?


Yes.

> At least this was the way I did it in a test application and it seamed to
> work although moving the cursor around in the window ( again I used the X
> target ) caused 30 - 40 percent of cpu load on a Pentium 100. Using top
> showed that the X server was the one who consumed the cpu resource.

This is strange. You were drawing nothing ? Maybe your X server has no
hardware cursor ?

> I would like to read a rectangular region out of the frame buffer. I
> guess that ggiGetBox would help me in what I want to do.
> But how should the functions ggiPutBox and ggiGetBox be used in respect of
> the buffer that has to be specified?
> What size should the buffer have? What type?

man ggiGetPixelFormat

A safe bet for situations where RAM usage isn't critical is 
(width+7)*height*sizeof(ggi_pixel)

CU, ANdy

-- 
Andreas Beck              |  Email :  <[EMAIL PROTECTED]>

Reply via email to