2009-09-25 13:34:34 +00:00
|
|
|
/*
|
|
|
|
* Cogl
|
|
|
|
*
|
|
|
|
* An object oriented GL/GLES Abstraction/Utility Layer
|
|
|
|
*
|
|
|
|
* Copyright (C) 2007,2008,2009 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, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
2009-11-26 19:06:35 +00:00
|
|
|
#ifndef __COGL_FRAMEBUFFER_PRIVATE_H
|
|
|
|
#define __COGL_FRAMEBUFFER_PRIVATE_H
|
2009-09-25 13:34:34 +00:00
|
|
|
|
|
|
|
#include "cogl-handle.h"
|
|
|
|
#include "cogl-matrix-stack.h"
|
|
|
|
#include "cogl-clip-stack.h"
|
|
|
|
|
2009-11-26 19:06:35 +00:00
|
|
|
typedef enum _CoglFramebufferType {
|
|
|
|
COGL_FRAMEBUFFER_TYPE_ONSCREEN,
|
|
|
|
COGL_FRAMEBUFFER_TYPE_OFFSCREEN
|
|
|
|
} CoglFramebufferType;
|
2009-09-25 13:34:34 +00:00
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
CoglHandleObject _parent;
|
2009-11-26 19:06:35 +00:00
|
|
|
CoglFramebufferType type;
|
2009-09-25 13:34:34 +00:00
|
|
|
int width;
|
|
|
|
int height;
|
|
|
|
|
|
|
|
CoglMatrixStack *modelview_stack;
|
|
|
|
CoglMatrixStack *projection_stack;
|
|
|
|
int viewport_x;
|
|
|
|
int viewport_y;
|
|
|
|
int viewport_width;
|
|
|
|
int viewport_height;
|
|
|
|
|
|
|
|
CoglClipStackState clip_state;
|
2009-11-26 19:06:35 +00:00
|
|
|
} CoglFramebuffer;
|
2009-09-25 13:34:34 +00:00
|
|
|
|
2009-11-26 19:06:35 +00:00
|
|
|
#define COGL_FRAMEBUFFER(X) ((CoglFramebuffer *)(X))
|
2009-09-25 13:34:34 +00:00
|
|
|
|
|
|
|
typedef struct _CoglOffscreen
|
|
|
|
{
|
2009-11-26 19:06:35 +00:00
|
|
|
CoglFramebuffer _parent;
|
2009-09-25 13:34:34 +00:00
|
|
|
GLuint fbo_handle;
|
2009-11-30 20:04:41 +00:00
|
|
|
GSList *renderbuffers;
|
2009-11-25 14:26:32 +00:00
|
|
|
CoglHandle texture;
|
2009-09-25 13:34:34 +00:00
|
|
|
} CoglOffscreen;
|
|
|
|
|
|
|
|
#define COGL_OFFSCREEN(X) ((CoglOffscreen *)(X))
|
|
|
|
|
|
|
|
typedef struct _CoglOnscreen
|
|
|
|
{
|
2009-11-26 19:06:35 +00:00
|
|
|
CoglFramebuffer _parent;
|
2009-09-25 13:34:34 +00:00
|
|
|
} CoglOnscreen;
|
|
|
|
|
|
|
|
#define COGL_ONSCREEN(X) ((CoglOnscreen *)(X))
|
|
|
|
|
|
|
|
void
|
2009-11-26 19:06:35 +00:00
|
|
|
_cogl_framebuffer_state_init (void);
|
2009-10-21 22:20:44 +00:00
|
|
|
int
|
2009-11-26 19:06:35 +00:00
|
|
|
_cogl_framebuffer_get_width (CoglHandle handle);
|
2009-10-21 22:20:44 +00:00
|
|
|
int
|
2009-11-26 19:06:35 +00:00
|
|
|
_cogl_framebuffer_get_height (CoglHandle handle);
|
2009-09-25 13:34:34 +00:00
|
|
|
CoglClipStackState *
|
2009-11-26 19:06:35 +00:00
|
|
|
_cogl_framebuffer_get_clip_state (CoglHandle handle);
|
2009-09-25 13:34:34 +00:00
|
|
|
void
|
2009-11-26 19:06:35 +00:00
|
|
|
_cogl_framebuffer_set_viewport (CoglHandle handle,
|
2009-09-25 13:34:34 +00:00
|
|
|
int x,
|
|
|
|
int y,
|
|
|
|
int width,
|
|
|
|
int height);
|
|
|
|
int
|
2009-11-26 19:06:35 +00:00
|
|
|
_cogl_framebuffer_get_viewport_x (CoglHandle handle);
|
2009-09-25 13:34:34 +00:00
|
|
|
int
|
2009-11-26 19:06:35 +00:00
|
|
|
_cogl_framebuffer_get_viewport_y (CoglHandle handle);
|
2009-09-25 13:34:34 +00:00
|
|
|
int
|
2009-11-26 19:06:35 +00:00
|
|
|
_cogl_framebuffer_get_viewport_width (CoglHandle handle);
|
2009-09-25 13:34:34 +00:00
|
|
|
int
|
2009-11-26 19:06:35 +00:00
|
|
|
_cogl_framebuffer_get_viewport_height (CoglHandle handle);
|
2009-09-25 13:34:34 +00:00
|
|
|
void
|
2009-11-26 19:06:35 +00:00
|
|
|
_cogl_framebuffer_get_viewport4fv (CoglHandle handle, int *viewport);
|
2009-09-25 13:34:34 +00:00
|
|
|
CoglMatrixStack *
|
2009-11-26 19:06:35 +00:00
|
|
|
_cogl_framebuffer_get_modelview_stack (CoglHandle handle);
|
2009-09-25 13:34:34 +00:00
|
|
|
CoglMatrixStack *
|
2009-11-26 19:06:35 +00:00
|
|
|
_cogl_framebuffer_get_projection_stack (CoglHandle handle);
|
2009-09-25 13:34:34 +00:00
|
|
|
|
2009-11-26 19:06:35 +00:00
|
|
|
typedef enum _CoglFramebufferFlushFlags
|
2009-09-25 13:34:34 +00:00
|
|
|
{
|
|
|
|
/* XXX: When using this, that imples you are going to manually load the
|
|
|
|
* modelview matrix (via glLoadMatrix). _cogl_matrix_stack_flush_to_gl wont
|
2009-11-26 19:06:35 +00:00
|
|
|
* be called for framebuffer->modelview_stack, and the modelview_stack will
|
2009-09-25 13:34:34 +00:00
|
|
|
* also be marked as dirty. */
|
2009-11-26 19:06:35 +00:00
|
|
|
COGL_FRAMEBUFFER_FLUSH_SKIP_MODELVIEW = 1L<<0,
|
|
|
|
} CoglFramebufferFlushFlags;
|
2009-09-25 13:34:34 +00:00
|
|
|
|
|
|
|
void
|
2009-11-26 19:06:35 +00:00
|
|
|
_cogl_framebuffer_flush_state (CoglHandle handle,
|
|
|
|
CoglFramebufferFlushFlags flags);
|
2009-09-25 13:34:34 +00:00
|
|
|
|
|
|
|
CoglHandle
|
|
|
|
_cogl_onscreen_new (void);
|
|
|
|
|
|
|
|
CoglHandle
|
2009-11-26 19:06:35 +00:00
|
|
|
_cogl_get_framebuffer (void);
|
2009-09-25 13:34:34 +00:00
|
|
|
GSList *
|
2009-11-26 19:06:35 +00:00
|
|
|
_cogl_create_framebuffer_stack (void);
|
2009-09-25 13:34:34 +00:00
|
|
|
void
|
2009-11-26 19:06:35 +00:00
|
|
|
_cogl_free_framebuffer_stack (GSList *stack);
|
2009-09-25 13:34:34 +00:00
|
|
|
|
2009-11-26 19:06:35 +00:00
|
|
|
#endif /* __COGL_FRAMEBUFFER_PRIVATE_H */
|
2009-09-25 13:34:34 +00:00
|
|
|
|