cl_gl.pp 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. (**********************************************************************************
  2. * Copyright (c) 2008-2009 The Khronos Group Inc.
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and/or associated documentation files (the
  6. * "Materials"), to deal in the Materials without restriction, including
  7. * without limitation the rights to use, copy, modify, merge, publish,
  8. * distribute, sublicense, and/or sell copies of the Materials, and to
  9. * permit persons to whom the Materials are furnished to do so, subject to
  10. * the following conditions:
  11. *
  12. * The above copyright notice and this permission notice shall be included
  13. * in all copies or substantial portions of the Materials.
  14. *
  15. * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  16. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  17. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  18. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  19. * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  20. * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  21. * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
  22. **********************************************************************************)
  23. // ported to FPC by Dmitry 'skalogryz' Boyarintsev: 28th apr 2009
  24. unit cl_gl;
  25. interface
  26. uses
  27. cl, gl, ctypes;
  28. // NOTE: Make sure that appropriate GL header file is included separately
  29. type
  30. cl_gl_object_type = cl_uint;
  31. cl_gl_texture_info = cl_uint;
  32. cl_gl_platform_info = cl_uint;
  33. const
  34. // cl_gl_object_type
  35. CL_GL_OBJECT_BUFFER = $2000;
  36. CL_GL_OBJECT_TEXTURE2D = $2001;
  37. CL_GL_OBJECT_TEXTURE3D = $2002;
  38. CL_GL_OBJECT_RENDERBUFFER = $2003;
  39. // cl_gl_texture_info
  40. CL_GL_TEXTURE_TARGET = $2004;
  41. CL_GL_MIPMAP_LEVEL = $2005;
  42. CL_GL_CONTEXT_KHR = $2008;
  43. CL_EGL_DISPLAY_KHR = $2009;
  44. CL_GLX_DISPLAY_KHR = $200A;
  45. CL_WGL_HDC_KHR = $200B;
  46. CL_CGL_SHAREGROUP_KHR = $200C;
  47. function clCreateFromGLBuffer(context: cl_context; falgs: cl_mem_flags;
  48. bufobj: GLuint; var errcode_ret: cl_int
  49. ): cl_mem; cdecl; external name 'clCreateFromGLBuffer';
  50. function clCreateFromGLTexture2D(context: cl_context;
  51. flags: cl_mem_flags; target: GLenum; miplevel: GLint;
  52. texture: GLuint; var errcode_ret: cl_int
  53. ): cl_mem; cdecl; external name 'clCreateFromGLTexture2D';
  54. function clCreateFromGLTexture3D(context: cl_context; flags: cl_mem_flags;
  55. target: GLenum; miplevel: GLint; texture: GLuint; var errorcode: cl_int
  56. ): cl_mem; cdecl; external name 'clCreateFromGLTexture3D';
  57. function clCreateFromGLRenderbuffer(context: cl_context;
  58. flags: cl_mem_flags; renderbuffer: GLuint; var errcode: cl_int
  59. ): cl_mem; cdecl; external name 'clCreateFromGLRenderbuffer';
  60. function clGetGLObjectInfo(memobj: cl_mem; gl_object_type: cl_gl_object_type;
  61. object_name: GLuint
  62. ): cl_int; cdecl; external name 'clGetGLObjectInfo';
  63. function clGetGLTextureInfo(memobj: cl_mem; param_name: cl_gl_texture_info;
  64. value_size: csize_t; value: Pointer; var size_ret: pcsize_t
  65. ): cl_int; cdecl; external name 'clGetGLTextureInfo';
  66. function clEnqueueAcquireGLObjects(command_queue: cl_command_queue;
  67. num_objects: cl_uint; mem_objects: Pcl_mem;
  68. num_events: cl_uint; events_list : Pcl_event; event: Pcl_event
  69. ): cl_int; cdecl; external name 'clEnqueueAcquireGLObjects';
  70. function clEnqueueReleaseGLObjects(command_queue: cl_command_queue;
  71. num_objects: cl_uint; mem_objects: Pcl_mem;
  72. num_events: cl_uint; events_list : Pcl_event; event: Pcl_event
  73. ): cl_int; cdecl; external name 'clEnqueueReleaseGLObjects';
  74. implementation
  75. end.