[prev in list] [next in list] [prev in thread] [next in thread]
List: freedesktop-xorg
Subject: Re: XRender With Vsync
From: Ryan McClue <re.mcclue () protonmail ! com>
Date: 2021-09-24 8:43:29
Message-ID: Fv7hEJbX22P8uYpSAMpScjEvVeOqZdUeZTcqqjkxF-d1YhmXS87-dZ9QUVY2fyb-RFxNm3TXNKwZ3xABkxT-YQ6SdGelk8huzjZnyeHKx2M= () protonmail ! com
[Download RAW message or body]
I have solved the problem. It seems that XCheckTypedWindowEvent() does not return a \
GenericEvent. I found https://github.com/gnif/LookingGlass and \
https://github.com/xfce-mirror/xfwm4 as some examples to go by.
--
Ryan McClue, Sydney
------- Original Message -------
On Thursday, September 23rd, 2021 at 11:35 AM, Ryan McClue <re.mcclue@protonmail.com> \
wrote:
> I'm trying to use XPresent, however I seem unable to receive GenericEvent. I \
> initialize:
> int present_op = 0, event = 0, error = 0;
>
> XPresentQueryExtension(xlib_display, &present_op, &event, &error);
>
> XPresentSelectInput(xlib_display, xlib_window, PresentCompleteNotifyMask);
>
> In my event loop:
>
> XEvent xlib_event = {};
>
> while (XPending(xlib_display) > 0)
>
> {
>
> XNextEvent(xlib_display, &xlib_event);
>
> switch (xlib_event.type)
>
> {
>
> case GenericEvent:
>
> {
>
> XGenericEventCookie *cookie = (XGenericEventCookie *)&xlib_event.xcookie;
>
> if (cookie->extension == present_op)
>
> {
> XGetEventData(xlib_display, cookie);
> if (cookie->evtype == PresentCompleteNotify)
>
> {
> XRenderComposite(display, PictOpSrc, src_pict, 0, dst_pict,
> 0, 0, 0, 0, 0, 0,
> window_width, window_height);
> }
> XFreeEventData(xlib_display, cookie);
> } break;
> }
>
>
> }
>
> I never receive any GenericEvent.
>
> Am I doing something wrong?
> -----------------------------------------------------------------
>
> Ryan McClue, Sydney
>
> ------- Original Message -------
>
> On Thursday, September 23rd, 2021 at 3:33 AM, Keith Packard keithp@keithp.com \
> wrote:
> > Ryan McClue re.mcclue@protonmail.com writes:
> >
> > > I want this to sync with the monitor's VBLANK, i.e. vsync.
> > >
> > > How can this be achieved?
> >
> > Draw to an offscreen pixmap and use the Present extension.
> >
> > -keith
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic