43e8d16641389a13f08e31bedae4a7e00ca3a719
[profile/ivi/clutter.git] / clutter / glx / clutter-stage-glx.h
1 /* Clutter.
2  * An OpenGL based 'interactive canvas' library.
3  * Authored By Matthew Allum  <mallum@openedhand.com>
4  * Copyright (C) 2006-2007 OpenedHand
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
18  *
19  *
20  */
21
22 #ifndef __CLUTTER_STAGE_GLX_H__
23 #define __CLUTTER_STAGE_GLX_H__
24
25 #include <glib-object.h>
26 #include <clutter/clutter-stage.h>
27 #include <X11/Xlib.h>
28 #include <X11/Xatom.h>
29 #include <GL/glx.h>
30 #include <GL/gl.h>
31
32 #include "clutter-backend-glx.h"
33 #include "../x11/clutter-stage-x11.h"
34
35 G_BEGIN_DECLS
36
37 #define CLUTTER_TYPE_STAGE_GLX                  (_clutter_stage_glx_get_type ())
38 #define CLUTTER_STAGE_GLX(obj)                  (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_STAGE_GLX, ClutterStageGLX))
39 #define CLUTTER_IS_STAGE_GLX(obj)               (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_STAGE_GLX))
40 #define CLUTTER_STAGE_GLX_CLASS(klass)          (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_STAGE_GLX, ClutterStageGLXClass))
41 #define CLUTTER_IS_STAGE_GLX_CLASS(klass)       (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_STAGE_GLX))
42 #define CLUTTER_STAGE_GLX_GET_CLASS(obj)        (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_STAGE_GLX, ClutterStageGLXClass))
43
44 typedef struct _ClutterStageGLX         ClutterStageGLX;
45 typedef struct _ClutterStageGLXClass    ClutterStageGLXClass;
46
47 struct _ClutterStageGLX
48 {
49   ClutterStageX11 parent_instance;
50
51   gint pending_swaps;
52
53   CoglOnscreen *onscreen;
54
55   unsigned int swap_callback_id;
56
57   /* We only enable clipped redraws after 2 frames, since we've seen
58    * a lot of drivers can struggle to get going and may output some
59    * junk frames to start with.
60    */
61   guint frame_count;
62
63   ClutterGeometry bounding_redraw_clip;
64
65   guint initialized_redraw_clip : 1;
66 };
67
68 struct _ClutterStageGLXClass
69 {
70   ClutterStageX11Class parent_class;
71 };
72
73 GType _clutter_stage_glx_get_type  (void) G_GNUC_CONST;
74
75 G_END_DECLS
76
77 #endif /* __CLUTTER_STAGE_H__ */