gstglfeature.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. /*
  2. * GStreamer
  3. * Copyright (C) 2012 Matthew Waters <[email protected]>
  4. *
  5. * This library is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU Library General Public
  7. * License as published by the Free Software Foundation; either
  8. * version 2 of the License, or (at your option) any later version.
  9. *
  10. * This library is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * Library General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Library General Public
  16. * License along with this library; if not, write to the
  17. * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
  18. * Boston, MA 02110-1301, USA.
  19. */
  20. /*
  21. * Cogl
  22. *
  23. * An object oriented GL/GLES Abstraction/Utility Layer
  24. *
  25. * Copyright (C) 2009 Intel Corporation.
  26. *
  27. * This library is free software; you can redistribute it and/or
  28. * modify it under the terms of the GNU Lesser General Public
  29. * License as published by the Free Software Foundation; either
  30. * version 2 of the License, or (at your option) any later version.
  31. *
  32. * This library is distributed in the hope that it will be useful,
  33. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  34. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  35. * Lesser General Public License for more details.
  36. *
  37. * You should have received a copy of the GNU Lesser General Public
  38. * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  39. *
  40. *
  41. */
  42. #ifndef __COGL_FEATURE_PRIVATE_H
  43. #define __COGL_FEATURE_PRIVATE_H
  44. #include <gst/gst.h>
  45. #include <gst/gl/gstgl_fwd.h>
  46. G_BEGIN_DECLS
  47. #define GST_GL_CHECK_GL_VERSION(driver_major, driver_minor, \
  48. target_major, target_minor) \
  49. ((driver_major) > (target_major) || \
  50. ((driver_major) == (target_major) && (driver_minor) >= (target_minor)))
  51. typedef struct _GstGLFeatureFunction GstGLFeatureFunction;
  52. struct _GstGLFeatureFunction
  53. {
  54. /* The name of the function without the "EXT" or "ARB" suffix */
  55. const char *name;
  56. /* The offset in the context of where to store the function pointer */
  57. unsigned int pointer_offset;
  58. };
  59. typedef struct _GstGLFeatureData GstGLFeatureData;
  60. struct _GstGLFeatureData
  61. {
  62. /* name of the feature */
  63. const char *feature_name;
  64. /* Flags specifying which versions of GL the feature is available
  65. in core in */
  66. GstGLAPI gl_availability;
  67. /* A minimum GL version which the functions should be defined in
  68. without needing an extension. Set to 255, 255 if it's only
  69. provided in an extension */
  70. int min_gl_major, min_gl_minor;
  71. /* A minimum GLES version which the functions should be defined in
  72. without needing an extension. Set to 255, 255 if it's only
  73. provided in an extension */
  74. int min_gles_major, min_gles_minor;
  75. /* \0 separated list of namespaces to try. Eg "EXT\0ARB\0" */
  76. const char *namespaces;
  77. /* \0 separated list of required extension names without the GL_EXT
  78. or GL_ARB prefix. Any of the extensions must be available for the
  79. feature to be considered available. If the suffix for an
  80. extension is different from the namespace, you can specify it
  81. with a ':' after the namespace */
  82. const char *extension_names;
  83. /* A list of functions required for this feature. Terminated with a
  84. NULL name */
  85. const GstGLFeatureFunction *functions;
  86. };
  87. gboolean
  88. gst_gl_check_extension (const char *name, const gchar * ext);
  89. gboolean
  90. _gst_gl_feature_check (GstGLContext *context,
  91. const char *driver_prefix,
  92. const GstGLFeatureData *data,
  93. int gl_major,
  94. int gl_minor,
  95. const char *extensions_string);
  96. void
  97. _gst_gl_feature_check_ext_functions (GstGLContext *context,
  98. int gl_major,
  99. int gl_minor,
  100. const char *gl_extensions);
  101. G_END_DECLS
  102. #endif /* __COGL_FEATURE_PRIVATE_H */