~oem-solutions-group/unity-2d/clutter-1.0

« back to all changes in this revision

Viewing changes to clutter/cogl/cogl/cogl-framebuffer-private.h

  • Committer: Bazaar Package Importer
  • Author(s): Emilio Pozuelo Monfort
  • Date: 2010-03-21 13:27:56 UTC
  • mto: (2.1.3 experimental)
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: james.westby@ubuntu.com-20100321132756-nf8yd30yxo3zzwcm
Tags: upstream-1.2.2
ImportĀ upstreamĀ versionĀ 1.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Cogl
 
3
 *
 
4
 * An object oriented GL/GLES Abstraction/Utility Layer
 
5
 *
 
6
 * Copyright (C) 2007,2008,2009 Intel Corporation.
 
7
 *
 
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.
 
12
 *
 
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.
 
17
 *
 
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/>.
 
20
 *
 
21
 *
 
22
 */
 
23
 
 
24
#ifndef __COGL_FRAMEBUFFER_PRIVATE_H
 
25
#define __COGL_FRAMEBUFFER_PRIVATE_H
 
26
 
 
27
#include "cogl-handle.h"
 
28
#include "cogl-matrix-stack.h"
 
29
#include "cogl-clip-stack.h"
 
30
 
 
31
typedef enum _CoglFramebufferType {
 
32
  COGL_FRAMEBUFFER_TYPE_ONSCREEN,
 
33
  COGL_FRAMEBUFFER_TYPE_OFFSCREEN
 
34
} CoglFramebufferType;
 
35
 
 
36
typedef struct
 
37
{
 
38
  CoglHandleObject    _parent;
 
39
  CoglFramebufferType  type;
 
40
  int                 width;
 
41
  int                 height;
 
42
 
 
43
  CoglMatrixStack    *modelview_stack;
 
44
  CoglMatrixStack    *projection_stack;
 
45
  int                 viewport_x;
 
46
  int                 viewport_y;
 
47
  int                 viewport_width;
 
48
  int                 viewport_height;
 
49
 
 
50
  CoglClipStackState  clip_state;
 
51
} CoglFramebuffer;
 
52
 
 
53
#define COGL_FRAMEBUFFER(X) ((CoglFramebuffer *)(X))
 
54
 
 
55
typedef struct _CoglOffscreen
 
56
{
 
57
  CoglFramebuffer  _parent;
 
58
  GLuint          fbo_handle;
 
59
  GSList          *renderbuffers;
 
60
  CoglHandle      texture;
 
61
} CoglOffscreen;
 
62
 
 
63
#define COGL_OFFSCREEN(X) ((CoglOffscreen *)(X))
 
64
 
 
65
typedef struct _CoglOnscreen
 
66
{
 
67
  CoglFramebuffer  _parent;
 
68
} CoglOnscreen;
 
69
 
 
70
#define COGL_ONSCREEN(X) ((CoglOnscreen *)(X))
 
71
 
 
72
void
 
73
_cogl_framebuffer_state_init (void);
 
74
int
 
75
_cogl_framebuffer_get_width (CoglHandle handle);
 
76
int
 
77
_cogl_framebuffer_get_height (CoglHandle handle);
 
78
CoglClipStackState *
 
79
_cogl_framebuffer_get_clip_state (CoglHandle handle);
 
80
void
 
81
_cogl_framebuffer_set_viewport (CoglHandle handle,
 
82
                                int x,
 
83
                                int y,
 
84
                                int width,
 
85
                                int height);
 
86
int
 
87
_cogl_framebuffer_get_viewport_x (CoglHandle handle);
 
88
int
 
89
_cogl_framebuffer_get_viewport_y (CoglHandle handle);
 
90
int
 
91
_cogl_framebuffer_get_viewport_width (CoglHandle handle);
 
92
int
 
93
_cogl_framebuffer_get_viewport_height (CoglHandle handle);
 
94
void
 
95
_cogl_framebuffer_get_viewport4fv (CoglHandle handle, int *viewport);
 
96
CoglMatrixStack *
 
97
_cogl_framebuffer_get_modelview_stack (CoglHandle handle);
 
98
CoglMatrixStack *
 
99
_cogl_framebuffer_get_projection_stack (CoglHandle handle);
 
100
 
 
101
typedef enum _CoglFramebufferFlushFlags
 
102
{
 
103
  /* XXX: When using this, that imples you are going to manually load the
 
104
   * modelview matrix (via glLoadMatrix). _cogl_matrix_stack_flush_to_gl wont
 
105
   * be called for framebuffer->modelview_stack, and the modelview_stack will
 
106
   * also be marked as dirty. */
 
107
  COGL_FRAMEBUFFER_FLUSH_SKIP_MODELVIEW =     1L<<0,
 
108
} CoglFramebufferFlushFlags;
 
109
 
 
110
void
 
111
_cogl_framebuffer_flush_state (CoglHandle handle,
 
112
                               CoglFramebufferFlushFlags flags);
 
113
 
 
114
CoglHandle
 
115
_cogl_onscreen_new (void);
 
116
 
 
117
CoglHandle
 
118
_cogl_get_framebuffer (void);
 
119
GSList *
 
120
_cogl_create_framebuffer_stack (void);
 
121
void
 
122
_cogl_free_framebuffer_stack (GSList *stack);
 
123
 
 
124
#endif /* __COGL_FRAMEBUFFER_PRIVATE_H */
 
125