🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.x
Article #38291

Calling an idle function in X

#38291
From: Joshua Rosinger
Date: Thu, 03 Jul 1997 00:00
30 lines
1919 bytes
Hi everyone,

I am doing a program that invlolves OpenGL, Xlib and a bit of Xt. What I
want to do is to be able to call a function even if there are no X
events for my program, ie to perform some work even if the connection is
idle. This is similar to glutIdleFunc in OpenGL. I need to do it with
Xlib so I can't use XtAppMainLoop.

How do I go about doing it with Xlib? What I do now is:

While(1)
{
   do
    {
         cases of events type ...
    }
    While (XPending(...))
    Call to the function ...
    Here I generate a fake expose event and use XSendEvent to send it to
my program.
}

I guess this solution is not very efficient. How does glut implement it
in general?

Any information will be appreciated.

Thanks in advance,
Shuky
Technical Details
Message-ID: <33BBAE35.1B2B5D48@greenrose.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f6cac,42c827b68b1cbd4a,start
X-Google-Attributes: gidf6cac,public
X-Google-Thread: 1667f1,42c827b68b1cbd4a,start
X-Google-Attributes: gid1667f1,public
X-Google-Thread: 103734,42c827b68b1cbd4a,start
X-Google-Attributes: gid103734,public
X-Google-Thread: 11038b,42c827b68b1cbd4a,start
X-Google-Attributes: gid11038b,public
X-Google-Thread: 1051fd,42c827b68b1cbd4a,start
X-Google-Attributes: gid1051fd,public
X-Google-Thread: 1082b0,42c827b68b1cbd4a,start
X-Google-Attributes: gid1082b0,public
X-Google-Thread: 10b6ac,42c827b68b1cbd4a,start
X-Google-Attributes: gid10b6ac,public
X-Google-Thread: f4bda,42c827b68b1cbd4a,start
X-Google-Attributes: gidf4bda,public
From: Joshua Rosinger <info@greenrose.com>
Subject: Calling an idle function in X
Date: 1997/07/03
Message-ID: <33BBAE35.1B2B5D48@greenrose.com>
X-Deja-AN: 254282833
X-Priority: 3 (Normal)
Organization: GreenRose Corp.
Newsgroups: comp.windows.x,comp.os.linux.x,comp.windows.x.i386unix,de.comp.os.linux.x,de.comp.x11,fj.windows.x,comp.windows.x.motif,comp.windows.x.intrinsics,comp.graphics.api.opengl