4
* An object oriented GL/GLES Abstraction/Utility Layer
6
* Copyright (C) 2007,2008,2009 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/>.
24
#ifndef __COGL_FRAMEBUFFER_PRIVATE_H
25
#define __COGL_FRAMEBUFFER_PRIVATE_H
27
#include "cogl-handle.h"
28
#include "cogl-matrix-stack.h"
29
#include "cogl-clip-stack.h"
31
typedef enum _CoglFramebufferType {
32
COGL_FRAMEBUFFER_TYPE_ONSCREEN,
33
COGL_FRAMEBUFFER_TYPE_OFFSCREEN
34
} CoglFramebufferType;
38
CoglHandleObject _parent;
39
CoglFramebufferType type;
43
CoglMatrixStack *modelview_stack;
44
CoglMatrixStack *projection_stack;
50
CoglClipStackState clip_state;
53
#define COGL_FRAMEBUFFER(X) ((CoglFramebuffer *)(X))
55
typedef struct _CoglOffscreen
57
CoglFramebuffer _parent;
59
GSList *renderbuffers;
63
#define COGL_OFFSCREEN(X) ((CoglOffscreen *)(X))
65
typedef struct _CoglOnscreen
67
CoglFramebuffer _parent;
70
#define COGL_ONSCREEN(X) ((CoglOnscreen *)(X))
73
_cogl_framebuffer_state_init (void);
75
_cogl_framebuffer_get_width (CoglHandle handle);
77
_cogl_framebuffer_get_height (CoglHandle handle);
79
_cogl_framebuffer_get_clip_state (CoglHandle handle);
81
_cogl_framebuffer_set_viewport (CoglHandle handle,
87
_cogl_framebuffer_get_viewport_x (CoglHandle handle);
89
_cogl_framebuffer_get_viewport_y (CoglHandle handle);
91
_cogl_framebuffer_get_viewport_width (CoglHandle handle);
93
_cogl_framebuffer_get_viewport_height (CoglHandle handle);
95
_cogl_framebuffer_get_viewport4fv (CoglHandle handle, int *viewport);
97
_cogl_framebuffer_get_modelview_stack (CoglHandle handle);
99
_cogl_framebuffer_get_projection_stack (CoglHandle handle);
101
typedef enum _CoglFramebufferFlushFlags
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;
111
_cogl_framebuffer_flush_state (CoglHandle handle,
112
CoglFramebufferFlushFlags flags);
115
_cogl_onscreen_new (void);
118
_cogl_get_framebuffer (void);
120
_cogl_create_framebuffer_stack (void);
122
_cogl_free_framebuffer_stack (GSList *stack);
124
#endif /* __COGL_FRAMEBUFFER_PRIVATE_H */