2008-04-25 09:37:36 -04:00
|
|
|
/*
|
2009-04-27 10:48:12 -04:00
|
|
|
* Cogl
|
2008-04-25 09:37:36 -04:00
|
|
|
*
|
2009-04-27 10:48:12 -04:00
|
|
|
* An object oriented GL/GLES Abstraction/Utility Layer
|
2008-04-25 09:37:36 -04:00
|
|
|
*
|
2009-04-27 10:48:12 -04:00
|
|
|
* Copyright (C) 2007,2008,2009 Intel Corporation.
|
2008-04-25 09:37:36 -04:00
|
|
|
*
|
|
|
|
* 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
|
2010-03-01 07:56:10 -05:00
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*
|
2008-04-25 09:37:36 -04:00
|
|
|
*/
|
|
|
|
|
2011-02-22 15:08:16 -05:00
|
|
|
#ifndef __COGL_WINSYS_PRIVATE_H
|
|
|
|
#define __COGL_WINSYS_PRIVATE_H
|
2008-04-25 09:37:36 -04:00
|
|
|
|
2011-06-20 08:29:12 -04:00
|
|
|
#include "cogl-renderer.h"
|
|
|
|
|
2010-11-05 08:28:33 -04:00
|
|
|
#include "cogl-framebuffer-private.h"
|
2011-03-01 09:43:43 -05:00
|
|
|
#ifdef COGL_HAS_XLIB_SUPPORT
|
|
|
|
#include "cogl-texture-pixmap-x11-private.h"
|
|
|
|
#endif
|
2010-11-05 08:28:33 -04:00
|
|
|
|
|
|
|
#ifdef COGL_HAS_XLIB_SUPPORT
|
|
|
|
#include <X11/Xutil.h>
|
2011-02-25 06:29:08 -05:00
|
|
|
#include "cogl-texture-pixmap-x11-private.h"
|
2010-11-05 08:28:33 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
GQuark
|
|
|
|
_cogl_winsys_error_quark (void);
|
|
|
|
|
|
|
|
#define COGL_WINSYS_ERROR (_cogl_winsys_error_quark ())
|
|
|
|
|
|
|
|
typedef enum { /*< prefix=COGL_WINSYS_ERROR >*/
|
|
|
|
COGL_WINSYS_ERROR_INIT,
|
|
|
|
COGL_WINSYS_ERROR_CREATE_CONTEXT,
|
|
|
|
COGL_WINSYS_ERROR_CREATE_ONSCREEN,
|
|
|
|
} CoglWinsysError;
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
COGL_WINSYS_RECTANGLE_STATE_UNKNOWN,
|
|
|
|
COGL_WINSYS_RECTANGLE_STATE_DISABLE,
|
|
|
|
COGL_WINSYS_RECTANGLE_STATE_ENABLE
|
|
|
|
} CoglWinsysRectangleState;
|
|
|
|
|
2011-02-25 06:29:08 -05:00
|
|
|
typedef struct _CoglWinsysVtable
|
|
|
|
{
|
2011-06-20 08:29:12 -04:00
|
|
|
CoglWinsysID id;
|
|
|
|
|
2011-04-18 11:24:51 -04:00
|
|
|
const char *name;
|
|
|
|
|
2011-05-10 08:51:41 -04:00
|
|
|
/* Required functions */
|
|
|
|
|
2011-02-25 06:29:08 -05:00
|
|
|
CoglFuncPtr
|
2011-07-27 07:30:02 -04:00
|
|
|
(*renderer_get_proc_address) (CoglRenderer *renderer,
|
|
|
|
const char *name);
|
2008-04-25 09:37:36 -04:00
|
|
|
|
2011-02-25 06:29:08 -05:00
|
|
|
gboolean
|
|
|
|
(*renderer_connect) (CoglRenderer *renderer, GError **error);
|
2010-11-05 08:28:33 -04:00
|
|
|
|
2011-02-25 06:29:08 -05:00
|
|
|
void
|
|
|
|
(*renderer_disconnect) (CoglRenderer *renderer);
|
2010-11-05 08:28:33 -04:00
|
|
|
|
2011-02-25 06:29:08 -05:00
|
|
|
gboolean
|
|
|
|
(*display_setup) (CoglDisplay *display, GError **error);
|
2010-11-05 08:28:33 -04:00
|
|
|
|
2011-02-25 06:29:08 -05:00
|
|
|
void
|
|
|
|
(*display_destroy) (CoglDisplay *display);
|
2010-11-05 08:28:33 -04:00
|
|
|
|
2011-02-25 06:29:08 -05:00
|
|
|
gboolean
|
|
|
|
(*context_init) (CoglContext *context, GError **error);
|
2010-11-05 08:28:33 -04:00
|
|
|
|
2011-02-25 06:29:08 -05:00
|
|
|
void
|
|
|
|
(*context_deinit) (CoglContext *context);
|
2010-11-05 08:28:33 -04:00
|
|
|
|
2011-02-25 06:29:08 -05:00
|
|
|
gboolean
|
|
|
|
(*onscreen_init) (CoglOnscreen *onscreen, GError **error);
|
2010-11-05 08:28:33 -04:00
|
|
|
|
2011-02-25 06:29:08 -05:00
|
|
|
void
|
|
|
|
(*onscreen_deinit) (CoglOnscreen *onscreen);
|
2010-11-05 08:28:33 -04:00
|
|
|
|
2011-02-25 06:29:08 -05:00
|
|
|
void
|
|
|
|
(*onscreen_bind) (CoglOnscreen *onscreen);
|
2010-11-05 08:28:33 -04:00
|
|
|
|
2011-02-25 06:29:08 -05:00
|
|
|
void
|
|
|
|
(*onscreen_swap_buffers) (CoglOnscreen *onscreen);
|
2010-11-05 08:28:33 -04:00
|
|
|
|
2011-05-10 08:51:41 -04:00
|
|
|
void
|
|
|
|
(*onscreen_update_swap_throttled) (CoglOnscreen *onscreen);
|
|
|
|
|
|
|
|
void
|
|
|
|
(*onscreen_set_visibility) (CoglOnscreen *onscreen,
|
|
|
|
gboolean visibility);
|
|
|
|
|
|
|
|
/* Optional functions */
|
|
|
|
|
2011-02-25 06:29:08 -05:00
|
|
|
void
|
|
|
|
(*onscreen_swap_region) (CoglOnscreen *onscreen,
|
|
|
|
int *rectangles,
|
|
|
|
int n_rectangles);
|
2010-11-05 08:28:33 -04:00
|
|
|
|
2011-05-10 08:51:41 -04:00
|
|
|
#ifdef COGL_HAS_EGL_SUPPORT
|
|
|
|
EGLDisplay
|
|
|
|
(*context_egl_get_egl_display) (CoglContext *context);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef COGL_HAS_XLIB_SUPPORT
|
|
|
|
XVisualInfo *
|
|
|
|
(*xlib_get_visual_info) (void);
|
|
|
|
#endif
|
2010-11-05 08:28:33 -04:00
|
|
|
|
2011-02-25 06:29:08 -05:00
|
|
|
guint32
|
|
|
|
(*onscreen_x11_get_window_xid) (CoglOnscreen *onscreen);
|
2010-11-05 08:28:33 -04:00
|
|
|
|
2011-05-09 12:48:50 -04:00
|
|
|
#ifdef COGL_HAS_WIN32_SUPPORT
|
|
|
|
HWND
|
|
|
|
(*onscreen_win32_get_window) (CoglOnscreen *onscreen);
|
|
|
|
#endif
|
|
|
|
|
2011-02-25 06:29:08 -05:00
|
|
|
unsigned int
|
|
|
|
(*onscreen_add_swap_buffers_callback) (CoglOnscreen *onscreen,
|
|
|
|
CoglSwapBuffersNotify callback,
|
|
|
|
void *user_data);
|
2010-11-05 08:28:33 -04:00
|
|
|
|
2011-02-25 06:29:08 -05:00
|
|
|
void
|
|
|
|
(*onscreen_remove_swap_buffers_callback) (CoglOnscreen *onscreen,
|
|
|
|
unsigned int id);
|
2010-11-05 08:28:33 -04:00
|
|
|
|
2011-03-01 09:43:43 -05:00
|
|
|
#ifdef COGL_HAS_XLIB_SUPPORT
|
2011-02-25 06:29:08 -05:00
|
|
|
gboolean
|
|
|
|
(*texture_pixmap_x11_create) (CoglTexturePixmapX11 *tex_pixmap);
|
|
|
|
void
|
|
|
|
(*texture_pixmap_x11_free) (CoglTexturePixmapX11 *tex_pixmap);
|
2011-03-01 09:43:43 -05:00
|
|
|
|
2011-02-25 06:29:08 -05:00
|
|
|
gboolean
|
|
|
|
(*texture_pixmap_x11_update) (CoglTexturePixmapX11 *tex_pixmap,
|
|
|
|
gboolean needs_mipmap);
|
2011-03-01 09:43:43 -05:00
|
|
|
|
2011-02-25 06:29:08 -05:00
|
|
|
void
|
|
|
|
(*texture_pixmap_x11_damage_notify) (CoglTexturePixmapX11 *tex_pixmap);
|
2011-03-01 09:43:43 -05:00
|
|
|
|
2011-02-25 06:29:08 -05:00
|
|
|
CoglHandle
|
|
|
|
(*texture_pixmap_x11_get_texture) (CoglTexturePixmapX11 *tex_pixmap);
|
2011-03-01 09:43:43 -05:00
|
|
|
#endif
|
|
|
|
|
2011-02-25 06:29:08 -05:00
|
|
|
} CoglWinsysVtable;
|
|
|
|
|
2011-05-03 16:00:00 -04:00
|
|
|
gboolean
|
|
|
|
_cogl_winsys_has_feature (CoglWinsysFeature feature);
|
|
|
|
|
2011-02-22 15:08:16 -05:00
|
|
|
#endif /* __COGL_WINSYS_PRIVATE_H */
|