2
0

CL_D3D9.pas 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. (**********************************************************************************
  2. * Copyright (c) 2008-2011 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_d3d9.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. unit CL_D3D9;
  48. interface
  49. {$INCLUDE OpenCL.inc}
  50. uses
  51. CL,
  52. Direct3D9,
  53. CL_Platform;
  54. const
  55. CL_INVALID_D3D_OBJECT = CL_INVALID_GL_OBJECT;
  56. const
  57. CL_D3D9_DEVICE = $1072;
  58. type
  59. PIDirect3DResource9 = ^IDirect3DResource9;
  60. {$IFDEF CL_VERSION_1_0}
  61. TclCreateFromD3D9Buffer = function (
  62. context: Tcl_context; (* context *)
  63. flags: Tcl_mem_flags; (* flags *)
  64. pD3DResource: PIDirect3DResource9; (* pD3DResource *) //IDirect3DResource9 *
  65. shared_handle: Pointer; (* shared_handle *)
  66. errcode_ret: PInteger (* errcode_ret *)
  67. ):Tcl_mem;
  68. {$IFDEF CDECL}cdecl{$ELSE}stdcall{$ENDIF};
  69. TclCreateImageFromD3D9Resource = function (context: Tcl_context; (* context *)
  70. flags: Tcl_mem_flags; (* flags *)
  71. pD3DResource: PIDirect3DResource9; (* pD3DResource *) //IDirect3DResource9 *
  72. shared_handle: Pointer; (* shared_handle *)
  73. errcode_ret: PInteger (* errcode_ret *)
  74. ):Tcl_mem;
  75. {$IFDEF CDECL}cdecl{$ELSE}stdcall{$ENDIF};
  76. var
  77. clCreateFromD3D9Buffer: TclCreateFromD3D9Buffer;
  78. clCreateImageFromD3D9Resource: TclCreateImageFromD3D9Resource;
  79. {$ENDIF}
  80. function InitCL_D3D9: Boolean;
  81. implementation
  82. function InitCL_D3D9: Boolean;
  83. begin
  84. Result := False;
  85. if OCL_LibHandle <> nil then
  86. begin
  87. {$IFDEF CL_VERSION_1_0}
  88. clCreateFromD3D9Buffer := TclCreateFromD3D9Buffer(oclGetProcAddress('clCreateFromD3D9Buffer', OCL_LibHandle));
  89. clCreateImageFromD3D9Resource := TclCreateImageFromD3D9Resource(oclGetProcAddress('clCreateImageFromD3D9Resource', OCL_LibHandle));
  90. {$ENDIF}
  91. Result := True;
  92. end;
  93. end;
  94. end.