4 * An object oriented GL/GLES Abstraction/Utility Layer
6 * Copyright (C) 2012 Intel Corporation.
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
23 * Neil Roberts <neil@linux.intel.com>
30 #include "cogl-poll.h"
31 #include "cogl-winsys-private.h"
32 #include "cogl-context-private.h"
35 cogl_poll_get_info (CoglContext *context,
36 CoglPollFD **poll_fds,
40 const CoglWinsysVtable *winsys;
42 _COGL_RETURN_IF_FAIL (cogl_is_context (context));
43 _COGL_RETURN_IF_FAIL (poll_fds != NULL);
44 _COGL_RETURN_IF_FAIL (n_poll_fds != NULL);
45 _COGL_RETURN_IF_FAIL (timeout != NULL);
47 winsys = _cogl_context_get_winsys (context);
49 if (winsys->poll_get_info)
51 winsys->poll_get_info (context,
58 /* By default we'll assume Cogl doesn't need to block on anything */
61 *timeout = -1; /* no timeout */
65 cogl_poll_dispatch (CoglContext *context,
66 const CoglPollFD *poll_fds,
69 const CoglWinsysVtable *winsys;
71 _COGL_RETURN_IF_FAIL (cogl_is_context (context));
73 winsys = _cogl_context_get_winsys (context);
75 if (winsys->poll_dispatch)
76 winsys->poll_dispatch (context, poll_fds, n_poll_fds);