Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. /* Cairo - a vector graphics library with display and print output
  2.  *
  3.  * Copyright © 2009 Eric Anholt
  4.  * Copyright © 2009 Chris Wilson
  5.  *
  6.  * This library is free software; you can redistribute it and/or
  7.  * modify it either under the terms of the GNU Lesser General Public
  8.  * License version 2.1 as published by the Free Software Foundation
  9.  * (the "LGPL") or, at your option, under the terms of the Mozilla
  10.  * Public License Version 1.1 (the "MPL"). If you do not alter this
  11.  * notice, a recipient may use your version of this file under either
  12.  * the MPL or the LGPL.
  13.  *
  14.  * You should have received a copy of the LGPL along with this library
  15.  * in the file COPYING-LGPL-2.1; if not, write to the Free Software
  16.  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA
  17.  * You should have received a copy of the MPL along with this library
  18.  * in the file COPYING-MPL-1.1
  19.  *
  20.  * The contents of this file are subject to the Mozilla Public License
  21.  * Version 1.1 (the "License"); you may not use this file except in
  22.  * compliance with the License. You may obtain a copy of the License at
  23.  * http://www.mozilla.org/MPL/
  24.  *
  25.  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
  26.  * OF ANY KIND, either express or implied. See the LGPL or the MPL for
  27.  * the specific language governing rights and limitations.
  28.  *
  29.  * The Original Code is the cairo graphics library.
  30.  *
  31.  * The Initial Developer of the Original Code is Eric Anholt.
  32.  */
  33.  
  34. #ifndef CAIRO_GL_H
  35. #define CAIRO_GL_H
  36.  
  37. #include "cairo.h"
  38.  
  39. #if CAIRO_HAS_GL_SURFACE
  40.  
  41. CAIRO_BEGIN_DECLS
  42.  
  43. cairo_public cairo_surface_t *
  44. cairo_gl_surface_create (cairo_device_t *device,
  45.                          cairo_content_t content,
  46.                          int width, int height);
  47.  
  48. cairo_public cairo_surface_t *
  49. cairo_gl_surface_create_for_texture (cairo_device_t *abstract_device,
  50.                                      cairo_content_t content,
  51.                                      unsigned int tex,
  52.                                      int width, int height);
  53. cairo_public void
  54. cairo_gl_surface_set_size (cairo_surface_t *surface, int width, int height);
  55.  
  56. cairo_public int
  57. cairo_gl_surface_get_width (cairo_surface_t *abstract_surface);
  58.  
  59. cairo_public int
  60. cairo_gl_surface_get_height (cairo_surface_t *abstract_surface);
  61.  
  62. cairo_public void
  63. cairo_gl_surface_swapbuffers (cairo_surface_t *surface);
  64.  
  65. #if CAIRO_HAS_GLX_FUNCTIONS
  66. #include <GL/glx.h>
  67.  
  68. cairo_public cairo_device_t *
  69. cairo_glx_device_create (Display *dpy, GLXContext gl_ctx);
  70.  
  71. cairo_public Display *
  72. cairo_glx_device_get_display (cairo_device_t *device);
  73.  
  74. cairo_public GLXContext
  75. cairo_glx_device_get_context (cairo_device_t *device);
  76.  
  77. cairo_public cairo_surface_t *
  78. cairo_gl_surface_create_for_window (cairo_device_t *device,
  79.                                     Window win,
  80.                                     int width, int height);
  81. #endif
  82.  
  83. #if CAIRO_HAS_WGL_FUNCTIONS
  84. #include <windows.h>
  85.  
  86. cairo_public cairo_device_t *
  87. cairo_wgl_device_create (HGLRC rc);
  88.  
  89. cairo_public HGLRC
  90. cairo_wgl_device_get_context (cairo_device_t *device);
  91.  
  92. cairo_public cairo_surface_t *
  93. cairo_gl_surface_create_for_dc (cairo_device_t          *device,
  94.                                 HDC                      dc,
  95.                                 int                      width,
  96.                                 int                      height);
  97. #endif
  98.  
  99. #if CAIRO_HAS_EGL_FUNCTIONS
  100. #include <EGL/egl.h>
  101.  
  102. cairo_public cairo_device_t *
  103. cairo_egl_device_create (EGLDisplay dpy, EGLContext egl);
  104.  
  105. cairo_public cairo_surface_t *
  106. cairo_gl_surface_create_for_egl (cairo_device_t *device,
  107.                                  EGLSurface      egl,
  108.                                  int             width,
  109.                                  int             height);
  110.  
  111. #endif
  112.  
  113. CAIRO_END_DECLS
  114.  
  115. #else  /* CAIRO_HAS_GL_SURFACE */
  116. # error Cairo was not compiled with support for the GL backend
  117. #endif /* CAIRO_HAS_GL_SURFACE */
  118.  
  119. #endif /* CAIRO_GL_H */
  120.