~ubuntu-branches/ubuntu/vivid/mir/vivid

« back to all changes in this revision

Viewing changes to examples/eglapp.c

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release
  • Date: 2014-10-10 14:01:26 UTC
  • mto: This revision was merged to the branch mainline in revision 84.
  • Revision ID: package-import@ubuntu.com-20141010140126-n1czko8na1kuz4ll
Tags: upstream-0.8.0+14.10.20141010
ImportĀ upstreamĀ versionĀ 0.8.0+14.10.20141010

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
 
71
71
void mir_eglapp_swap_buffers(void)
72
72
{
73
 
    static time_t lasttime = 0;
74
 
    static int lastcount = 0;
75
 
    static int count = 0;
76
 
    time_t now = time(NULL);
77
 
    time_t dtime;
78
 
    int dcount;
79
73
    EGLint width, height;
80
74
 
81
75
    if (!running)
83
77
 
84
78
    eglSwapBuffers(egldisplay, eglsurface);
85
79
 
86
 
    count++;
87
 
    dcount = count - lastcount;
88
 
    dtime = now - lasttime;
89
 
    if (dtime)
90
 
    {
91
 
        printf("%d FPS\n", dcount);
92
 
        lasttime = now;
93
 
        lastcount = count;
94
 
    }
95
 
 
96
80
    /*
97
81
     * Querying the surface (actually the current buffer) dimensions here is
98
82
     * the only truly safe way to be sure that the dimensions we think we
404
388
 
405
389
    signal(SIGINT, shutdown);
406
390
    signal(SIGTERM, shutdown);
 
391
    signal(SIGHUP, shutdown);
407
392
 
408
393
    *width = surfaceparm.width;
409
394
    *height = surfaceparm.height;