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