~ubuntu-branches/ubuntu/gutsy/rss-glx/gutsy

« back to all changes in this revision

Viewing changes to src/driver.cpp

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones
  • Date: 2005-11-30 18:21:27 UTC
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20051130182127-5iww7elbiyzej1lk
Tags: upstream-0.8.0
ImportĀ upstreamĀ versionĀ 0.8.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
xstuff_t *XStuff;
39
39
 
40
40
extern char *hack_name;
41
 
extern void hack_handle_opts (int argc, char **argv);
42
 
extern void hack_init (xstuff_t *);
43
 
extern void hack_reshape (xstuff_t *);
44
 
extern void hack_draw (xstuff_t *);
45
 
extern void hack_cleanup (xstuff_t *);
46
41
 
47
42
/*
48
43
 * display parameters 
169
164
        clearBuffers();
170
165
 
171
166
        gettimeofday (&now, NULL);
 
167
        int frameTimeSoFar = 0;
172
168
        while (!signalled) {
173
 
                hack_draw (XStuff);
 
169
                hack_draw (XStuff, now.tv_sec + now.tv_usec / 1000000.0f, frameTimeSoFar / 1000000.0f);
174
170
 
175
171
                glXSwapBuffers (XStuff->display, XStuff->window);
176
172
 
236
232
                        }
237
233
                }
238
234
 
 
235
                then = now;
 
236
                gettimeofday (&now, NULL);
 
237
                frameTimeSoFar = (now.tv_sec - then.tv_sec) * 1000000 + now.tv_usec - then.tv_usec;
 
238
 
239
239
                if (frameTime) {
240
 
                        int frameTimeSoFar = 0;
241
 
 
242
 
                        then = now;
243
 
                        gettimeofday (&now, NULL);
244
 
                        frameTimeSoFar = (now.tv_sec - then.tv_sec) * 1000000 + now.tv_usec - then.tv_usec;
245
 
 
246
240
                        while (frameTimeSoFar < frameTime) {
247
241
                                if (be_nice) {
248
242
/* nanosleep on Linux/i386 seems completely ineffective for idling for < 20ms */