summaryrefslogtreecommitdiff
path: root/cogl/cogl-onscreen-private.h
blob: d5a3707878728c2a08b3b72b439d5fd0338bc0cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*
 * Cogl
 *
 * An object oriented GL/GLES Abstraction/Utility Layer
 *
 * Copyright (C) 2011 Intel Corporation.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
 *
 *
 */

#ifndef __COGL_ONSCREEN_PRIVATE_H
#define __COGL_ONSCREEN_PRIVATE_H

#include "cogl-framebuffer-private.h"
#include "cogl-queue.h"

#include <glib.h>

#ifdef COGL_HAS_WIN32_SUPPORT
#include <windows.h>
#endif

typedef struct _CoglSwapBuffersNotifyEntry CoglSwapBuffersNotifyEntry;

COGL_TAILQ_HEAD (CoglSwapBuffersNotifyList, CoglSwapBuffersNotifyEntry);

struct _CoglSwapBuffersNotifyEntry
{
  COGL_TAILQ_ENTRY (CoglSwapBuffersNotifyEntry) list_node;

  CoglSwapBuffersNotify callback;
  void *user_data;
  unsigned int id;
};

typedef struct _CoglResizeNotifyEntry CoglResizeNotifyEntry;

COGL_TAILQ_HEAD (CoglResizeNotifyList, CoglResizeNotifyEntry);

struct _CoglResizeNotifyEntry
{
  COGL_TAILQ_ENTRY (CoglResizeNotifyEntry) list_node;

  CoglOnscreenResizeCallback callback;
  void *user_data;
  unsigned int id;
};

struct _CoglOnscreen
{
  CoglFramebuffer  _parent;

#ifdef COGL_HAS_X11_SUPPORT
  uint32_t foreign_xid;
  CoglOnscreenX11MaskCallback foreign_update_mask_callback;
  void *foreign_update_mask_data;
#endif

#ifdef COGL_HAS_WIN32_SUPPORT
  HWND foreign_hwnd;
#endif

  CoglBool swap_throttled;

  CoglSwapBuffersNotifyList swap_callbacks;

  CoglBool resizable;
  CoglResizeNotifyList resize_callbacks;

  void *winsys;
};

void
_cogl_framebuffer_winsys_update_size (CoglFramebuffer *framebuffer,
                                      int width, int height);

void
_cogl_onscreen_notify_swap_buffers (CoglOnscreen *onscreen);

void
_cogl_onscreen_notify_resize (CoglOnscreen *onscreen);

#endif /* __COGL_ONSCREEN_PRIVATE_H */