You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

133 line
4.7 KiB

  1. /*
  2. * Copyright (C) 1998 Janne Löf <jlof@mail.student.oulu.fi>
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Library General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Library General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Library General Public
  15. * License along with this library; if not, write to the Free
  16. * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17. */
  18. #ifndef __GDK_GL_H__
  19. #define __GDK_GL_H__
  20. #include <glib.h>
  21. #ifdef G_OS_WIN32
  22. /* The GL/gl.h on Windows requires you to include <windows.h>
  23. * anyway, so we might as well include it here.
  24. */
  25. #include <windows.h>
  26. #endif
  27. #include <gdk/gdk.h>
  28. G_BEGIN_DECLS
  29. /*
  30. * These definitions are duplicated from GL/glx.h that comes with Mesa.
  31. * I don't want every program to include GL/glx.h because GtkGLArea
  32. * supports lecacy systems like Windows. You can still use GLX_xxxx
  33. * attributes with these, but then you lose portability.
  34. */
  35. enum _GDK_GL_CONFIGS {
  36. GDK_GL_NONE = 0,
  37. GDK_GL_USE_GL = 1,
  38. GDK_GL_BUFFER_SIZE = 2,
  39. GDK_GL_LEVEL = 3,
  40. GDK_GL_RGBA = 4,
  41. GDK_GL_DOUBLEBUFFER = 5,
  42. GDK_GL_STEREO = 6,
  43. GDK_GL_AUX_BUFFERS = 7,
  44. GDK_GL_RED_SIZE = 8,
  45. GDK_GL_GREEN_SIZE = 9,
  46. GDK_GL_BLUE_SIZE = 10,
  47. GDK_GL_ALPHA_SIZE = 11,
  48. GDK_GL_DEPTH_SIZE = 12,
  49. GDK_GL_STENCIL_SIZE = 13,
  50. GDK_GL_ACCUM_RED_SIZE = 14,
  51. GDK_GL_ACCUM_GREEN_SIZE = 15,
  52. GDK_GL_ACCUM_BLUE_SIZE = 16,
  53. GDK_GL_ACCUM_ALPHA_SIZE = 17,
  54. /* GLX_EXT_visual_info extension */
  55. GDK_GL_X_VISUAL_TYPE_EXT = 0x22,
  56. GDK_GL_TRANSPARENT_TYPE_EXT = 0x23,
  57. GDK_GL_TRANSPARENT_INDEX_VALUE_EXT = 0x24,
  58. GDK_GL_TRANSPARENT_RED_VALUE_EXT = 0x25,
  59. GDK_GL_TRANSPARENT_GREEN_VALUE_EXT = 0x26,
  60. GDK_GL_TRANSPARENT_BLUE_VALUE_EXT = 0x27,
  61. GDK_GL_TRANSPARENT_ALPHA_VALUE_EXT = 0x28
  62. };
  63. #define GDK_TYPE_GL_CONTEXT (gdk_gl_context_get_type())
  64. #define GDK_GL_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_GL_CONTEXT, GdkGLContext))
  65. #define GDK_GL_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST (klass, GDK_TYPE_GL_CONTEXT, GdkGLContextClass))
  66. #define GDK_IS_GL_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDK_TYPE_GL_CONTEXT))
  67. #define GDK_IS_GL_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_GL_CONTEXT))
  68. #define GDK_GL_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_GL_CONTEXT, GdkGLContext))
  69. typedef struct _GdkGLContext GdkGLContext;
  70. gint gdk_gl_query(void);
  71. gchar *gdk_gl_get_info(void);
  72. GdkVisual *gdk_gl_choose_visual(int *attrlist);
  73. int gdk_gl_get_config(GdkVisual *visual, int attrib);
  74. GType gdk_gl_context_get_type(void);
  75. GdkGLContext *gdk_gl_context_new(GdkVisual *visual);
  76. GdkGLContext *gdk_gl_context_share_new(GdkVisual *visual, GdkGLContext *sharelist, gint direct);
  77. GdkGLContext *gdk_gl_context_attrlist_share_new(int *attrlist, GdkGLContext *sharelist, gint direct);
  78. gint gdk_gl_make_current(GdkDrawable *drawable, GdkGLContext *context);
  79. void gdk_gl_swap_buffers(GdkDrawable *drawable);
  80. void gdk_gl_wait_gdk(void);
  81. void gdk_gl_wait_gl(void);
  82. /* glpixmap stuff */
  83. #define GDK_TYPE_GL_PIXMAP (gdk_gl_pixmap_get_type())
  84. #define GDK_GL_PIXMAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_GL_PIXMAP, GdkGLPixmap))
  85. #define GDK_GL_PIXMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST (klass, GDK_TYPE_GL_PIXMAP, GdkGLPixmapClass))
  86. #define GDK_IS_GL_PIXMAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDK_TYPE_GL_PIXMAP))
  87. #define GDK_IS_GL_PIXMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_GL_PIXMAP))
  88. #define GDK_GL_PIXMAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_GL_PIXMAP, GdkGLPixmap))
  89. typedef struct _GdkGLPixmap GdkGLPixmap;
  90. GType gdk_gl_pixmap_get_type(void);
  91. GdkGLPixmap *gdk_gl_pixmap_new(GdkVisual *visual, GdkPixmap *pixmap);
  92. gint gdk_gl_pixmap_make_current(GdkGLPixmap *glpixmap, GdkGLContext *context);
  93. /* fonts */
  94. void gdk_gl_use_gdk_font(GdkFont *font, int first, int count, int list_base);
  95. #ifndef GTKGL_DISABLE_DEPRECATED
  96. # define gdk_gl_context_ref(context) g_object_ref(context)
  97. # define gdk_gl_context_unref(context) g_object_unref(context)
  98. # define gdk_gl_pixmap_ref(pixmap) g_object_ref(pixmap)
  99. # define gdk_gl_pixmap_unref(pixmap) g_object_unref(pixmap)
  100. #endif
  101. G_END_DECLS
  102. #endif /* __GDK_GL_H__ */