CL_GL_Ext.pas 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. (*******************************************************************************
  2. * Copyright (c) 2008-2010 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. (************************************************)
  24. (* *)
  25. (* OpenCL1.2 and Delphi and Windows *)
  26. (* *)
  27. (* created by : Maksym Tymkovych *)
  28. (* (niello) *)
  29. (* *)
  30. (* headers versions: 0.07 *)
  31. (* file name : CL_gl_ext.pas *)
  32. (* last modify : 10.12.11 *)
  33. (* license : BSD *)
  34. (* *)
  35. (* Site : www.niello.org.ua *)
  36. (* e-mail : [email protected] *)
  37. (* ICQ : 446-769-253 *)
  38. (* *)
  39. (* updated by : Alexander Kiselev *)
  40. (* (Igroman) *)
  41. (* Site : http://Igroman14.livejournal.com *)
  42. (* e-mail : [email protected] *)
  43. (* ICQ : 207-381-695 *)
  44. (* (c) 2010 *)
  45. (* *)
  46. (***********Copyright (c) niello 2008-2011*******)
  47. (* cl_gl_ext.h contains vendor (non-KHR) OpenCL extensions which have *)
  48. (* OpenGL dependencies. *)
  49. unit CL_GL_Ext;
  50. interface
  51. {$INCLUDE OpenCL.inc}
  52. (*
  53. * cl_khr_gl_event extension
  54. * See section 9.9 in the OpenCL 1.1 spec for more information
  55. *)
  56. uses
  57. CL,
  58. OpenGL,
  59. CL_GL,
  60. CL_Platform;
  61. {$IFDEF CL_VERSION_1_1}
  62. const
  63. CL_COMMAND_GL_FENCE_SYNC_OBJECT_KHR = $200D;
  64. type
  65. TclCreateEventFromGLsyncKHR = function(
  66. context: Pcl_context; (* context *)
  67. cl_GLsync: TCL_GLsync; (* cl_GLsync *)
  68. errcode_ret: Pcl_int (* errcode_ret *)
  69. ): PCL_event;
  70. {$IFDEF CDECL}cdecl{$ELSE}stdcall{$ENDIF};
  71. var
  72. clCreateEventFromGLsyncKHR: TclCreateEventFromGLsyncKHR;
  73. {$ENDIF}
  74. function InitCL_GL_EXT: Boolean;
  75. implementation
  76. function InitCL_GL_EXT: Boolean;
  77. begin
  78. Result := False;
  79. if OCL_LibHandle <> nil then
  80. begin
  81. {$IFDEF CL_VERSION_1_1}
  82. clCreateEventFromGLsyncKHR := TclCreateEventFromGLsyncKHR(oclGetProcAddress('clCreateEventFromGLsyncKHR', OCL_LibHandle));
  83. {$ENDIF}
  84. Result := True;
  85. end;
  86. end;
  87. end.