├── Source ├── DelphiCL.inc ├── CLExt.pas ├── SimpleImageLoader.pas ├── CL_GL_Ext.pas ├── CL_D3D9.pas ├── OpenCL.inc ├── CL_D3D11.pas ├── CL_DX9_Media_Sharing.pas ├── CL_Platform.pas ├── CL_D3D10.pas └── CL_GL.pas ├── Resources ├── Lena.bmp ├── Example1.cl ├── Filter02.cl ├── Filter03.cl ├── Filter05.cl ├── Filter06.cl ├── Filter04.cl ├── Filter07.cl ├── Example4.cl ├── Example2.cl ├── SimpleGL.cl ├── Filter01.cl ├── Filter09.cl └── Filter08.cl ├── Examples ├── OpenCL Info │ ├── OpenCL_Info.dpr │ └── OpenCL_Info.dproj ├── Example5 │ ├── MainUnit.dfm │ ├── Example5.dpr │ ├── MainUnit.pas │ └── Example5.dproj ├── Example1 │ ├── Example1.dpr │ └── Example1.dproj ├── Example4 │ ├── Example4.dpr │ └── Example4.dproj ├── Example2 │ ├── Example2.dpr │ └── Example2.dproj └── Example3 │ ├── Example3.dpr │ └── Example3.dproj ├── Readme.md └── LICENSE /Source/DelphiCL.inc: -------------------------------------------------------------------------------- 1 | {$DEFINE LOGGING} 2 | {$DEFINE PROFILING} -------------------------------------------------------------------------------- /Resources/Lena.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CWBudde/PasOpenCL/HEAD/Resources/Lena.bmp -------------------------------------------------------------------------------- /Resources/Example1.cl: -------------------------------------------------------------------------------- 1 | __kernel void somekernel(__global int *src,__global int *dst) 2 | { 3 | int id = get_global_id(0); 4 | dst[id] = (int)pown((float)src[id],4); 5 | } 6 | -------------------------------------------------------------------------------- /Resources/Filter02.cl: -------------------------------------------------------------------------------- 1 | __kernel void render(__global char * input,__global char * output, int width, int height) 2 | { 3 | 4 | unsigned int i = get_global_id(0); 5 | 6 | unsigned int i_mul_4 = i*4; 7 | 8 | unsigned char temp; 9 | temp = 0.1*input[i_mul_4]+0.6*input[i_mul_4+1]+0.3*input[i_mul_4+2]; 10 | output[i_mul_4] =temp;//Blue 11 | output[i_mul_4+1]=temp;//Green 12 | output[i_mul_4+2]=temp;//Red 13 | 14 | 15 | output[i_mul_4+3]=input[i_mul_4+3];//Alpha 16 | 17 | 18 | } -------------------------------------------------------------------------------- /Resources/Filter03.cl: -------------------------------------------------------------------------------- 1 | __kernel void render(__global char * input,__global char * output, int width, int height) 2 | { 3 | 4 | unsigned int i = get_global_id(0); 5 | 6 | unsigned int i_mul_4 = i*4; 7 | 8 | 9 | unsigned char temp; 10 | 11 | //swap rgb 12 | temp = input[i_mul_4]; 13 | output[i_mul_4] = input[i_mul_4+2];//Blue 14 | output[i_mul_4] = input[i_mul_4+1]; 15 | output[i_mul_4+2]= temp; //Red 16 | 17 | 18 | output[i_mul_4+3]=input[i_mul_4+3];//Alpha 19 | 20 | 21 | } -------------------------------------------------------------------------------- /Resources/Filter05.cl: -------------------------------------------------------------------------------- 1 | 2 | unsigned char invert(unsigned char in) 3 | { 4 | return 255-in; 5 | } 6 | 7 | __kernel void render(__global char * input,__global char * output, int width, int height) 8 | { 9 | 10 | unsigned int i = get_global_id(0); 11 | 12 | unsigned int i_mul_4 = i*4; 13 | 14 | output[i_mul_4] = invert(input[i_mul_4]); 15 | output[i_mul_4+1] = invert(input[i_mul_4+1]); 16 | output[i_mul_4+2] = invert(input[i_mul_4+2]); 17 | output[i_mul_4+3] = input[i_mul_4+3];//Alpha 18 | 19 | 20 | } -------------------------------------------------------------------------------- /Resources/Filter06.cl: -------------------------------------------------------------------------------- 1 | #define LOG_VALUE 25 //some const value 2 | 3 | unsigned char logconv(unsigned char in) 4 | { 5 | return LOG_VALUE*log((float)in+1); 6 | } 7 | 8 | __kernel void render(__global char * input,__global char * output, int width, int height) 9 | { 10 | 11 | unsigned int i = get_global_id(0); 12 | 13 | unsigned int i_mul_4 = i*4; 14 | 15 | output[i_mul_4] = logconv(input[i_mul_4]); 16 | output[i_mul_4+1] = logconv(input[i_mul_4+1]); 17 | output[i_mul_4+2] = logconv(input[i_mul_4+2]); 18 | output[i_mul_4+3] = input[i_mul_4+3];//Alpha 19 | 20 | 21 | } -------------------------------------------------------------------------------- /Resources/Filter04.cl: -------------------------------------------------------------------------------- 1 | #define THRESHOLD_VALUE 100 2 | 3 | unsigned char threshold(unsigned char in) 4 | { 5 | if (in>THRESHOLD_VALUE) return 255; 6 | return 0; 7 | } 8 | 9 | __kernel void render(__global char * input,__global char * output, int width, int height) 10 | { 11 | 12 | unsigned int i = get_global_id(0); 13 | 14 | unsigned int i_mul_4 = i*4; 15 | 16 | output[i_mul_4] = threshold(input[i_mul_4]); 17 | output[i_mul_4+1] = threshold(input[i_mul_4+1]); 18 | output[i_mul_4+2] = threshold(input[i_mul_4+2]); 19 | output[i_mul_4+3]=input[i_mul_4+3];//Alpha 20 | 21 | 22 | } -------------------------------------------------------------------------------- /Examples/OpenCL Info/OpenCL_Info.dpr: -------------------------------------------------------------------------------- 1 | program OpenCL_Info; 2 | 3 | uses 4 | CL_Platform in '..\..\Source\CL_Platform.pas', 5 | CL in '..\..\Source\CL.pas', 6 | CL_GL in '..\..\Source\CL_GL.pas', 7 | CLExt in '..\..\Source\CLExt.pas', 8 | CL_D3D9 in '..\..\Source\CL_D3D9.pas', 9 | CL_Ext in '..\..\Source\CL_Ext.pas', 10 | Forms, 11 | Main in 'Main.pas' {FormOpenCLInfo}, 12 | oclUtils in 'oclUtils.pas'; 13 | 14 | {$R *.res} 15 | 16 | begin 17 | Application.Initialize; 18 | Application.MainFormOnTaskbar := True; 19 | Application.CreateForm(TFormOpenCLInfo, FormOpenCLInfo); 20 | Application.Run; 21 | end. 22 | -------------------------------------------------------------------------------- /Resources/Filter07.cl: -------------------------------------------------------------------------------- 1 | 2 | __kernel void render(__global char * input,__global char * output, int width, int height) 3 | { 4 | 5 | unsigned int i = get_global_id(0); 6 | 7 | unsigned int x,y; 8 | 9 | unsigned int i_mul_4 = i*4; 10 | 11 | y = i / width; 12 | x = i % width; 13 | 14 | unsigned int x2,y2; 15 | 16 | x2 = y; 17 | y2 = x; 18 | 19 | 20 | if ((x2=0)&&(y2>=0)*/) 21 | { 22 | unsigned int i_mul_4_new = ((y2*width+x2)*4); 23 | 24 | 25 | output[i_mul_4_new] =input[i_mul_4];//Blue 26 | output[i_mul_4_new+1]=input[i_mul_4+1];//Green 27 | output[i_mul_4_new+2]=input[i_mul_4+2];//Red 28 | 29 | output[i_mul_4_new+3]=input[i_mul_4+3];//Alpha 30 | } 31 | 32 | 33 | } -------------------------------------------------------------------------------- /Resources/Example4.cl: -------------------------------------------------------------------------------- 1 | __constant sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE | 2 | CLK_ADDRESS_CLAMP | CLK_FILTER_NEAREST; 3 | 4 | __kernel void main(read_only image2d_t src_image, 5 | write_only image2d_t dst_image) { 6 | 7 | /* Compute value to be subtracted from each pixel */ 8 | uint offset = get_global_id(1) * 0x4000 + get_global_id(0) * 0x1000; 9 | uint4 offset_vec = (uint4)(offset, 0, 0, 0); 10 | 11 | /* Read pixel value */ 12 | int2 coord = (int2)(get_global_id(0), get_global_id(1)); 13 | uint4 pixel = read_imageui(src_image, sampler, coord); 14 | 15 | /* Subtract offset from pixel */ 16 | pixel -= offset_vec; 17 | 18 | /* Write new pixel value to output */ 19 | write_imageui(dst_image, coord, pixel); 20 | } -------------------------------------------------------------------------------- /Examples/Example5/MainUnit.dfm: -------------------------------------------------------------------------------- 1 | object FormMain: TFormMain 2 | Left = 378 3 | Top = 138 4 | BorderStyle = bsDialog 5 | Caption = 'SimpleGL' 6 | ClientHeight = 487 7 | ClientWidth = 506 8 | Color = clBtnFace 9 | Font.Charset = DEFAULT_CHARSET 10 | Font.Color = clWindowText 11 | Font.Height = -11 12 | Font.Name = 'MS Sans Serif' 13 | Font.Style = [] 14 | OldCreateOrder = False 15 | OnCreate = FormCreate 16 | OnDestroy = FormDestroy 17 | OnKeyPress = FormKeyPress 18 | OnMouseDown = FormMouseDown 19 | OnMouseUp = FormMouseUp 20 | PixelsPerInch = 96 21 | TextHeight = 13 22 | object TimerRecalculate: TTimer 23 | Enabled = False 24 | Interval = 100 25 | OnTimer = TimerRecalculateTimer 26 | Left = 96 27 | Top = 80 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /Resources/Example2.cl: -------------------------------------------------------------------------------- 1 | float mapX(float x) 2 | { 3 | return x*3.25 - 2; 4 | } 5 | 6 | float mapY(float y) 7 | { 8 | return y*2.5 - 1.25; 9 | } 10 | 11 | int index(int x, int y, int width) 12 | { 13 | return x*4+4*width*y; 14 | } 15 | 16 | char mynormalize(char v) 17 | { 18 | if (v>255) return 0; 19 | return v; 20 | } 21 | 22 | __kernel void render(__global char * output) 23 | { 24 | 25 | int x_dim = get_global_id(0); 26 | int y_dim = get_global_id(1); 27 | size_t width = get_global_size(0); 28 | size_t height = get_global_size(1); 29 | int idx = index(x_dim, y_dim, width); 30 | 31 | float x_0 = mapX((float) x_dim / width); 32 | float y_0 = mapY((float) y_dim / height); 33 | 34 | float x = 0.0; 35 | float y = 0.0; 36 | 37 | char iteration = 0; 38 | 39 | char max_iteration = 127; 40 | while( (x*x + y*y <= 4) && (iteration < max_iteration) ) 41 | { 42 | float xtemp = x*x - y*y + x_0; 43 | y = 2*x*y + y_0; 44 | x = xtemp; 45 | iteration++; 46 | } 47 | 48 | if(iteration == max_iteration) 49 | { 50 | output[idx] = 0; 51 | output[idx + 1] = 0; 52 | output[idx + 2] = 0; 53 | } 54 | else 55 | { 56 | output[idx] = mynormalize(iteration*5*x*y/100); 57 | output[idx + 1] = mynormalize(iteration*x/10); 58 | output[idx + 2] = mynormalize(iteration*y/10); 59 | } 60 | output[idx + 3] = 255; 61 | } -------------------------------------------------------------------------------- /Resources/SimpleGL.cl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1993-2009 NVIDIA Corporation. All rights reserved. 3 | * 4 | * NVIDIA Corporation and its licensors retain all intellectual property and 5 | * proprietary rights in and to this software and related documentation. 6 | * Any use, reproduction, disclosure, or distribution of this software 7 | * and related documentation without an express license agreement from 8 | * NVIDIA Corporation is strictly prohibited. 9 | * 10 | * Please refer to the applicable NVIDIA end user license agreement (EULA) 11 | * associated with this source code for terms and conditions that govern 12 | * your use of this NVIDIA software. 13 | * 14 | */ 15 | 16 | /* This example demonstrates how to use the OpenCL/OpenGL bindings */ 17 | 18 | /////////////////////////////////////////////////////////////////////////////// 19 | //! Simple kernel to modify vertex positions in sine wave pattern 20 | //! @param data data in global memory 21 | /////////////////////////////////////////////////////////////////////////////// 22 | __kernel void sine_wave(__global float4* pos, unsigned int width, unsigned int height, float time) 23 | { 24 | unsigned int x = get_global_id(0); 25 | unsigned int y = get_global_id(1); 26 | 27 | // calculate uv coordinates 28 | float u = x / (float) width; 29 | float v = y / (float) height; 30 | u = u*2.0f - 1.0f; 31 | v = v*2.0f - 1.0f; 32 | 33 | // calculate simple sine wave pattern 34 | float freq = 4.0f; 35 | float w = sin(u*freq + time) * cos(v*freq + time) * 0.5f; 36 | 37 | // write output vertex 38 | pos[y*width+x] = (float4)(u, w, v, 1.0f); 39 | } 40 | -------------------------------------------------------------------------------- /Source/CLExt.pas: -------------------------------------------------------------------------------- 1 | (* 2 | ** Copyright 1998-2002, NVIDIA Corporation. 3 | ** All Rights Reserved. 4 | ** 5 | ** THE INFORMATION CONTAINED HEREIN IS PROPRIETARY AND CONFIDENTIAL TO 6 | ** NVIDIA, CORPORATION. USE, REPRODUCTION OR DISCLOSURE TO ANY THIRD PARTY 7 | ** IS SUBJECT TO WRITTEN PRE-APPROVAL BY NVIDIA, CORPORATION. 8 | ** 9 | ** 10 | *) 11 | (********************************************) 12 | (* *) 13 | (* OpenCL1.1 and Delphi and Windows *) 14 | (* *) 15 | (* created by : Maksym Tymkovych *) 16 | (* (niello) *) 17 | (* *) 18 | (* headers versions: 0.03 *) 19 | (* file name : clext.pas *) 20 | (* last modify : 13.02.10 *) 21 | (* license : BSD *) 22 | (* *) 23 | (* Site : www.niello.org.ua *) 24 | (* e-mail : muxamed13@ukr.net *) 25 | (* ICQ : 446-769-253 *) 26 | (* *) 27 | (*********Copyright (c) niello 2008-2011*****) 28 | unit CLExt; 29 | 30 | interface 31 | 32 | const 33 | 34 | CL_NV_DEVICE_COMPUTE_CAPABILITY_MAJOR = $4000; 35 | CL_NV_DEVICE_COMPUTE_CAPABILITY_MINOR = $4001; 36 | CL_NV_DEVICE_REGISTERS_PER_BLOCK = $4002; 37 | CL_NV_DEVICE_WARP_SIZE = $4003; 38 | CL_NV_DEVICE_GPU_OVERLAP = $4004; 39 | CL_NV_DEVICE_KERNEL_EXEC_TIMEOUT = $4005; 40 | CL_NV_DEVICE_INTEGRATED_MEMORY = $4006; 41 | 42 | implementation 43 | 44 | end. -------------------------------------------------------------------------------- /Examples/Example5/Example5.dpr: -------------------------------------------------------------------------------- 1 | (************************************************************************) 2 | (* *) 3 | (* OpenCL1.2 and Delphi *) 4 | (* *) 5 | (* project site : http://code.google.com/p/delphi-opencl/ *) 6 | (* *) 7 | (* file name : Example5.dpr *) 8 | (* last modify : 24.12.11 *) 9 | (* license : BSD *) 10 | (* *) 11 | (* created by : Maksym Tymkovych (niello) *) 12 | (* Site : www.niello.org.ua *) 13 | (* e-mail : muxamed13@ukr.net *) 14 | (* ICQ : 446-769-253 *) 15 | (* *) 16 | (* and : Alexander Kiselev (Igroman) *) 17 | (* Site : http://Igroman14.livejournal.com *) 18 | (* e-mail : Igroman14@yandex.ru *) 19 | (* ICQ : 207-381-695 *) 20 | (* *) 21 | (************************delphi-opencl2010-2011**************************) 22 | 23 | program Example5; 24 | 25 | uses 26 | CL_Platform in '..\..\Source\CL_Platform.pas', 27 | CL in '..\..\Source\CL.pas', 28 | CL_GL in '..\..\Source\CL_GL.pas', 29 | DelphiCL in '..\..\Source\DelphiCL.pas', 30 | SimpleImageLoader in '..\..\Source\SimpleImageLoader.pas', 31 | Forms, 32 | MainUnit in 'MainUnit.pas' {FormMain}; 33 | 34 | {$R *.res} 35 | 36 | begin 37 | Application.Initialize; 38 | Application.CreateForm(TFormMain, FormMain); 39 | Application.Run; 40 | end. 41 | -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | PasOpenCL 2 | ========= 3 | 4 | PasOpenCL is a fork of 'delphi-opencl' hosted on Google Code (http://code.google.com/p/delphi-opencl/). The code of the fork is kept more or less unchanged, but the structure of the repository has changed a bit. For this reason a different name has been picked. 5 | 6 | One prominent change is the absense of the dglOpenGL.pas header, which can be found at the personal fork at: 7 | https://github.com/CWBudde/dglOpenGL 8 | or at the original location at 9 | https://bitbucket.org/saschawillems/dglopengl 10 | 11 | Below you can read the information given to the original project. 12 | 13 | Original Project 14 | ---------------- 15 | 16 | This project is intended to make possible the use of OpenCL in Delphi and Free Pascal (Lazarus). 17 | 18 | Authors: 19 | niello Site: http://www.niello.org.ua 20 | 21 | Igroman Site: http://Igroman14.livejournal.com 22 | 23 | What OpenCL platforms / Operating Systems / Compilers are supported? 24 | 25 | OpenCL Platforms: 26 | tested on AMD, Nvidia 27 | if you are running on a different platform, please contact us 28 | Operating Systems: 29 | Windows XP, Windows Vista, Windows 7 30 | Code for Linux added but not tested 31 | if you are running on a different OS, please contact us 32 | Compilers: 33 | Delphi (6, 7, 2010, XE2) 34 | FPC (2.2.0, 2.4.2) 35 | if you are running on a different compiler, please contact us 36 | 37 | 38 | How to use it? 39 | * CL, CL_Platforms, CL_GL, CL_D3D9, CL_D3D10, CL_D3D11, CL_DX9_Media_Sharing, CL_Ext, CL_GL_Ext (.pas) are OpenCL headers for Pascal compilers. 40 | * OpenCL (.inc) - is the include file for them. 41 | * DelphiCL (.pas) - OOP classes for OpenCL. 42 | * DelphiCL (.inc) - is the include file for the above. (LOGGING for logging in file "DELPHI_LOG.log", PROFILING for profiling). 43 | 44 | 45 | Before using the TDCLClasses, need execute procedure: 46 | InitOpenCL();// default library name = OpenCL.dll for Windows, libOpenCL.so for Linux 47 | 48 | if you are using CL_GL sharing, need added InitCL_GL() procedure: 49 | InitCL_GL(); 50 | 51 | 52 | 53 | The TDCLPlatforms allow get access to the all platforms on the computer (AMD, NVidia, Intel etc.). 54 | You need to create specimen of this class: 55 | var 56 | platforms: TDCLPlatforms; 57 | ... 58 | begin 59 | platforms := TDCLPlatforms.Create(); 60 | //Your code here 61 | FreeAndNil(platforms); 62 | end; 63 | 64 | 65 | 66 | The TDCLPlatforms have property Platforms (array of PDCLPlatform - Pointer to the TDCLPlatform). 67 | More in the source files. 68 | Maybe later we'll write a more detailed guide. -------------------------------------------------------------------------------- /Resources/Filter01.cl: -------------------------------------------------------------------------------- 1 | __kernel void render(__global char * input,__global char * output, int width, int height) 2 | { 3 | 4 | unsigned int i = get_global_id(0); 5 | 6 | unsigned int i_mul_4 = i*4; 7 | 8 | unsigned int x,y; 9 | 10 | y = i / width; 11 | 12 | x = i % width; 13 | 14 | if ((x0)&&(y>0)&&(y255) 34 | { 35 | output[i_mul_4] = 255; 36 | } 37 | else 38 | { 39 | output[i_mul_4] = temp; 40 | } 41 | 42 | temp = 43 | -input[i_mul_4-3]+ //x-1; y ; 44 | 8*input[i_mul_4+1]+ //x ; y ; 45 | -input[i_mul_4+5]+ //x+1; y ; 46 | 47 | -input[i_mul_4-3-4*width]+ //x-1; y-1; 48 | -input[i_mul_4-3+4*width]+ //x-1; y+1; 49 | 50 | -input[i_mul_4+5-4*width]+ //x+1; y-1; 51 | -input[i_mul_4+5+4*width]+ //x+1; y+1; 52 | 53 | -input[i_mul_4-4*width+1]+ //x ; y-1; 54 | -input[i_mul_4+4*width+1]; //x ; y+1; 55 | 56 | temp = temp; 57 | if (temp>255) 58 | { 59 | output[i_mul_4+1] = 255; 60 | } 61 | else 62 | { 63 | output[i_mul_4+1] = temp; 64 | } 65 | 66 | temp = 67 | -input[i_mul_4-2]+ //x-1; y ; 68 | 8*input[i_mul_4+2]+ //x ; y ; 69 | -input[i_mul_4+6]+ //x+1; y ; 70 | 71 | -input[i_mul_4-2-4*width]+ //x-1; y-1; 72 | -input[i_mul_4-2+4*width]+ //x-1; y+1; 73 | 74 | -input[i_mul_4+6-4*width]+ //x+1; y-1; 75 | -input[i_mul_4+6+4*width]+ //x+1; y+1; 76 | 77 | -input[i_mul_4-4*width+2]+ //x ; y-1; 78 | -input[i_mul_4+4*width+2]; //x ; y+1; 79 | 80 | temp = temp; 81 | if (temp>255) 82 | { 83 | output[i_mul_4+2] = 255; 84 | } 85 | else 86 | { 87 | output[i_mul_4+2] = temp; 88 | } 89 | 90 | 91 | } 92 | else 93 | { 94 | output[i_mul_4] =input[i_mul_4];//Blue 95 | output[i_mul_4+1]=input[i_mul_4+1];//Green 96 | output[i_mul_4+2]=input[i_mul_4+2];//Red 97 | 98 | } 99 | 100 | output[i_mul_4+3]=input[i_mul_4+3];//Alpha 101 | 102 | 103 | } -------------------------------------------------------------------------------- /Resources/Filter09.cl: -------------------------------------------------------------------------------- 1 | #define FILTER_SIZE 7 2 | #define FILTER_SIZE_SQUARE (FILTER_SIZE*FILTER_SIZE) 3 | __kernel void render(__global unsigned char * input,__global unsigned char * output, int width, int height) 4 | { 5 | 6 | unsigned int pos = get_global_id(0); 7 | 8 | unsigned int x,y; 9 | 10 | unsigned int i_mul_4 = pos*4; 11 | 12 | x = pos / width; 13 | y = pos % width; 14 | 15 | 16 | 17 | unsigned char i_00[FILTER_SIZE_SQUARE]; 18 | unsigned int summ,aver,disp,len,curr_disp, curr_aver; 19 | unsigned int c; 20 | 21 | unsigned int i_mul_4_new = ((y*width+x)*4); 22 | 23 | if ((x<=(width-FILTER_SIZE-1))&&(y<=(height-FILTER_SIZE-1))&&(x>=FILTER_SIZE)&&(y>=FILTER_SIZE)) 24 | { 25 | 26 | c = 0; 27 | for(int i=0;i255) { 130 | output[i_mul_4_new] =255; 131 | output[i_mul_4_new+1]=255; 132 | output[i_mul_4_new+2]=255; 133 | } else { 134 | output[i_mul_4_new] =aver; 135 | output[i_mul_4_new+1]=aver; 136 | output[i_mul_4_new+2]=aver; 137 | } 138 | 139 | output[i_mul_4_new+3]=input[i_mul_4+3]; 140 | } else { 141 | 142 | output[i_mul_4_new] = 0; 143 | output[i_mul_4_new+1]= 0; 144 | output[i_mul_4_new+2]= 0; 145 | output[i_mul_4_new+3]= 0; 146 | } 147 | 148 | } -------------------------------------------------------------------------------- /Examples/Example1/Example1.dpr: -------------------------------------------------------------------------------- 1 | (************************************************************************) 2 | (* *) 3 | (* OpenCL1.2 and Delphi *) 4 | (* *) 5 | (* project site : http://code.google.com/p/delphi-opencl/ *) 6 | (* *) 7 | (* file name : Example5.dpr *) 8 | (* last modify : 24.12.11 *) 9 | (* license : BSD *) 10 | (* *) 11 | (* created by : Maksym Tymkovych (niello) *) 12 | (* Site : www.niello.org.ua *) 13 | (* e-mail : muxamed13@ukr.net *) 14 | (* ICQ : 446-769-253 *) 15 | (* *) 16 | (* and : Alexander Kiselev (Igroman) *) 17 | (* Site : http://Igroman14.livejournal.com *) 18 | (* e-mail : Igroman14@yandex.ru *) 19 | (* ICQ : 207-381-695 *) 20 | (* *) 21 | (************************delphi-opencl2010-2011**************************) 22 | 23 | program Example1; 24 | 25 | {$APPTYPE CONSOLE} 26 | {$INCLUDE ..\..\Source\OpenCL.inc} 27 | 28 | uses 29 | CL_Platform in '..\..\Source\CL_Platform.pas', 30 | CL in '..\..\Source\CL.pas', 31 | CL_GL in '..\..\Source\CL_GL.pas', 32 | DelphiCL in '..\..\Source\DelphiCL.pas', 33 | SysUtils; 34 | 35 | const 36 | COUNT = 100; 37 | SIZE = COUNT * SizeOf(TCL_int); 38 | 39 | var 40 | Platforms: TDCLPlatforms; 41 | CommandQueue: TDCLCommandQueue; 42 | FileName: TFileName; 43 | SimpleProgram: TDCLProgram; 44 | Kernel: TDCLKernel; 45 | Input, Output: array [0 .. COUNT - 1] of TCL_int; 46 | InputBuffer, OutputBuffer: TDCLBuffer; 47 | i: Integer; 48 | begin 49 | // specify program 50 | FileName := ExtractFilePath(ParamStr(0)) + '..\..\Resources\Example1.cl'; 51 | Assert(FileExists(FileName)); 52 | 53 | InitOpenCL; 54 | Platforms := TDCLPlatforms.Create; 55 | with Platforms.Platforms[0]^.DeviceWithMaxClockFrequency^ do 56 | try 57 | CommandQueue := CreateCommandQueue; 58 | try 59 | for i := 0 to COUNT - 1 do 60 | Input[i] := i; 61 | InputBuffer := CreateBuffer(SIZE, @Input, [mfReadOnly, mfUseHostPtr]); // If dynamical array @Input[0] 62 | OutputBuffer := CreateBuffer(SIZE, nil, [mfWriteOnly]); 63 | 64 | SimpleProgram := CreateProgram(FileName); 65 | SimpleProgram.SaveToFile('Example1.bin'); 66 | 67 | // create program and set arguments 68 | Kernel := SimpleProgram.CreateKernel('somekernel'); 69 | Kernel.SetArg(0, InputBuffer); 70 | Kernel.SetArg(1, OutputBuffer); 71 | 72 | // execute kernel (and write execution time) 73 | CommandQueue.Execute(Kernel, COUNT); 74 | Writeln('Execution time: ', CommandQueue.ExecuteTime, ' ns.'); 75 | 76 | // read buffer 77 | CommandQueue.ReadBuffer(OutputBuffer, SIZE, @Output); // If dynamical array @Output[0] 78 | 79 | FreeAndNil(Kernel); 80 | FreeAndNil(SimpleProgram); 81 | FreeAndNil(OutputBuffer); 82 | FreeAndNil(InputBuffer); 83 | finally 84 | FreeAndNil(CommandQueue); 85 | end; 86 | finally 87 | FreeAndNil(Platforms); 88 | end; 89 | 90 | for i := 0 to COUNT - 1 do 91 | Writeln(Output[i], ' '); 92 | 93 | Writeln('press any key...'); 94 | Readln; 95 | end. 96 | -------------------------------------------------------------------------------- /Resources/Filter08.cl: -------------------------------------------------------------------------------- 1 | 2 | __kernel void render(__global char * input,__global char * output, int width, int height) 3 | { 4 | 5 | unsigned int i = get_global_id(0); 6 | 7 | unsigned int x,y; 8 | 9 | unsigned int i_mul_4 = i*4; 10 | 11 | x = i / width; 12 | y = i % width; 13 | 14 | 15 | 16 | unsigned char i_00[9]; 17 | unsigned int summ,aver,disp,len,curr_disp, curr_aver; 18 | 19 | unsigned int i_mul_4_new = ((y*width+x)*4); 20 | 21 | if ((x<=(width-4))&&(y<=(height-4))&&(x>=3)&&(y>=3)) 22 | { 23 | 24 | i_00[0] = input[(((y-2)*width+(x-2))*4)]; 25 | i_00[1] = input[(((y-2)*width+(x-1))*4)]; 26 | i_00[2] = input[(((y-2)*width+(x ))*4)]; 27 | i_00[3] = input[(((y-1)*width+(x-2))*4)]; 28 | i_00[4] = input[(((y-1)*width+(x-1))*4)]; 29 | i_00[5] = input[(((y-1)*width+(x ))*4)]; 30 | i_00[6] = input[(((y )*width+(x-2))*4)]; 31 | i_00[7] = input[(((y )*width+(x-1))*4)]; 32 | i_00[8] = input[(((y )*width+(x ))*4)]; 33 | 34 | summ = 0; 35 | for(int i=0; i<=8; ++i) { 36 | summ+=i_00[i]; 37 | } 38 | aver = summ/9; 39 | 40 | disp = 0; 41 | for(int i=0; i<=8; ++i) { 42 | len = i_00[i]-aver; 43 | disp += len*len; 44 | } 45 | disp = disp/9; 46 | 47 | i_00[0] = input[(((y-2)*width+(x ))*4)]; 48 | i_00[1] = input[(((y-2)*width+(x+1))*4)]; 49 | i_00[2] = input[(((y-2)*width+(x+2))*4)]; 50 | i_00[3] = input[(((y-1)*width+(x ))*4)]; 51 | i_00[4] = input[(((y-1)*width+(x+1))*4)]; 52 | i_00[5] = input[(((y-1)*width+(x+2))*4)]; 53 | i_00[6] = input[(((y )*width+(x ))*4)]; 54 | i_00[7] = input[(((y )*width+(x+1))*4)]; 55 | i_00[8] = input[(((y )*width+(x+2))*4)]; 56 | 57 | summ = 0; 58 | for(int i=0; i<=8; ++i) { 59 | summ+=i_00[i]; 60 | } 61 | curr_aver = summ/9; 62 | 63 | curr_disp = 0; 64 | for(int i=0; i<=8; ++i) { 65 | len = i_00[i]-curr_aver; 66 | curr_disp += len*len; 67 | } 68 | curr_disp = curr_disp/9; 69 | 70 | if (curr_disp nil then 90 | begin 91 | {$IFDEF CL_VERSION_1_1} 92 | clCreateEventFromGLsyncKHR := TclCreateEventFromGLsyncKHR(oclGetProcAddress('clCreateEventFromGLsyncKHR', OCL_LibHandle)); 93 | {$ENDIF} 94 | Result := True; 95 | end; 96 | end; 97 | 98 | end. 99 | -------------------------------------------------------------------------------- /Source/CL_D3D9.pas: -------------------------------------------------------------------------------- 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 : muxamed13@ukr.net *) 37 | (* ICQ : 446-769-253 *) 38 | (* *) 39 | (* updated by : Alexander Kiselev *) 40 | (* (Igroman) *) 41 | (* Site : http://Igroman14.livejournal.com *) 42 | (* e-mail : Igroman14@yandex.ru *) 43 | (* ICQ : 207-381-695 *) 44 | (* (c) 2010 *) 45 | (* *) 46 | (***********Copyright (c) niello 2008-2011*******) 47 | unit CL_D3D9; 48 | 49 | interface 50 | 51 | {$INCLUDE OpenCL.inc} 52 | 53 | uses 54 | CL, 55 | Direct3D9, 56 | CL_Platform; 57 | 58 | const 59 | CL_INVALID_D3D_OBJECT = CL_INVALID_GL_OBJECT; 60 | 61 | const 62 | CL_D3D9_DEVICE = $1072; 63 | 64 | type 65 | PIDirect3DResource9 = ^IDirect3DResource9; 66 | 67 | {$IFDEF CL_VERSION_1_0} 68 | TclCreateFromD3D9Buffer = function ( 69 | 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 | 77 | 78 | TclCreateImageFromD3D9Resource = function (context: Tcl_context; (* context *) 79 | flags: Tcl_mem_flags; (* flags *) 80 | pD3DResource: PIDirect3DResource9; (* pD3DResource *) //IDirect3DResource9 * 81 | shared_handle: Pointer; (* shared_handle *) 82 | errcode_ret: PInteger (* errcode_ret *) 83 | ):Tcl_mem; 84 | {$IFDEF CDECL}cdecl{$ELSE}stdcall{$ENDIF}; 85 | 86 | var 87 | clCreateFromD3D9Buffer: TclCreateFromD3D9Buffer; 88 | clCreateImageFromD3D9Resource: TclCreateImageFromD3D9Resource; 89 | {$ENDIF} 90 | 91 | function InitCL_D3D9: Boolean; 92 | 93 | implementation 94 | 95 | function InitCL_D3D9: Boolean; 96 | begin 97 | Result := False; 98 | if OCL_LibHandle <> nil then 99 | begin 100 | {$IFDEF CL_VERSION_1_0} 101 | clCreateFromD3D9Buffer := TclCreateFromD3D9Buffer(oclGetProcAddress('clCreateFromD3D9Buffer', OCL_LibHandle)); 102 | clCreateImageFromD3D9Resource := TclCreateImageFromD3D9Resource(oclGetProcAddress('clCreateImageFromD3D9Resource', OCL_LibHandle)); 103 | {$ENDIF} 104 | Result := True; 105 | end; 106 | end; 107 | 108 | end. -------------------------------------------------------------------------------- /Examples/Example2/Example2.dpr: -------------------------------------------------------------------------------- 1 | (************************************************************************) 2 | (* *) 3 | (* OpenCL1.2 and Delphi *) 4 | (* *) 5 | (* project site : http://code.google.com/p/delphi-opencl/ *) 6 | (* *) 7 | (* file name : Example5.dpr *) 8 | (* last modify : 24.12.11 *) 9 | (* license : BSD *) 10 | (* *) 11 | (* created by : Maksym Tymkovych (niello) *) 12 | (* Site : www.niello.org.ua *) 13 | (* e-mail : muxamed13@ukr.net *) 14 | (* ICQ : 446-769-253 *) 15 | (* *) 16 | (* and : Alexander Kiselev (Igroman) *) 17 | (* Site : http://Igroman14.livejournal.com *) 18 | (* e-mail : Igroman14@yandex.ru *) 19 | (* ICQ : 207-381-695 *) 20 | (* *) 21 | (************************delphi-opencl2010-2011**************************) 22 | 23 | program Example2; 24 | 25 | {$APPTYPE CONSOLE} 26 | {$INCLUDE ..\..\Source\OpenCL.inc} 27 | 28 | uses 29 | CL_Platform in '..\..\Source\CL_Platform.pas', 30 | CL in '..\..\Source\CL.pas', 31 | CL_GL in '..\..\Source\CL_GL.pas', 32 | DelphiCL in '..\..\Source\DelphiCL.pas', 33 | SysUtils; 34 | 35 | const 36 | Width = 512; 37 | Height = 512; 38 | 39 | var 40 | host_image: array [0 .. Width * Height * 4] of Byte; 41 | 42 | {$IFNDEF DEFINE_REGION_NOT_IMPLEMENTED}{$REGION 'SaveToFile'}{$ENDIF} 43 | procedure SaveToFile(const FileName: String); 44 | type 45 | DWORD = LongWord; 46 | 47 | TBitmapFileHeader = packed record 48 | bfType: Word; 49 | bfSize: DWORD; 50 | bfReserved1: Word; 51 | bfReserved2: Word; 52 | bfOffBits: DWORD; 53 | end; 54 | 55 | TBitmapInfoHeader = packed record 56 | biSize: DWORD; 57 | biWidth: Longint; 58 | biHeight: Longint; 59 | biPlanes: Word; 60 | biBitCount: Word; 61 | biCompression: DWORD; 62 | biSizeImage: DWORD; 63 | biXPelsPerMeter: Longint; 64 | biYPelsPerMeter: Longint; 65 | biClrUsed: DWORD; 66 | biClrImportant: DWORD; 67 | end; 68 | 69 | const 70 | BI_RGB = 0; 71 | var 72 | F: File; 73 | BFH: TBitmapFileHeader; 74 | BIH: TBitmapInfoHeader; 75 | begin 76 | Assign(F, FileName); 77 | Rewrite(F, 1); 78 | FillChar(BFH, SizeOf(BFH), 0); 79 | FillChar(BIH, SizeOf(BIH), 0); 80 | with BFH do 81 | begin 82 | bfType := $4D42; 83 | bfSize := SizeOf(BFH) + SizeOf(BIH) + Width * Height * 4; 84 | bfOffBits := SizeOf(BIH) + SizeOf(BFH); 85 | end; 86 | BlockWrite(F, BFH, SizeOf(BFH)); 87 | with BIH do 88 | begin 89 | biSize := SizeOf(BIH); 90 | biWidth := Width; 91 | biHeight := Height; 92 | biPlanes := 1; 93 | biBitCount := 32; 94 | biCompression := BI_RGB; 95 | biSizeImage := Width * Height * 4; 96 | end; 97 | BlockWrite(F, BIH, SizeOf(BIH)); 98 | BlockWrite(F, host_image, Width * Height * 4 * SizeOf(Byte)); 99 | Close(F); 100 | end; 101 | {$IFNDEF DEFINE_REGION_NOT_IMPLEMENTED}{$ENDREGION}{$ENDIF} 102 | 103 | var 104 | Platforms: TDCLPlatforms; 105 | CommandQueue: TDCLCommandQueue; 106 | FractalProgram: TDCLProgram; 107 | Kernel : TDCLKernel; 108 | FractalBuffer: TDCLBuffer; 109 | FileName: TFileName; 110 | begin 111 | // specify program 112 | FileName := ExtractFilePath(ParamStr(0)) + '..\..\Resources\Example2.cl'; 113 | Assert(FileExists(FileName)); 114 | 115 | InitOpenCL; 116 | Platforms := TDCLPlatforms.Create; 117 | with Platforms.Platforms[0]^.DeviceWithMaxClockFrequency^ do 118 | try 119 | CommandQueue := CreateCommandQueue; 120 | try 121 | FractalBuffer := CreateBuffer(Width * Height * 4 * SizeOf(Byte), nil, [mfWriteOnly]); 122 | FractalProgram := CreateProgram(FileName); 123 | 124 | // create kernel and specify arguments 125 | Kernel := FractalProgram.CreateKernel('render'); 126 | Kernel.SetArg(0, FractalBuffer); 127 | 128 | CommandQueue.Execute(Kernel, [TSize_t(Width), TSize_t(Height)]); 129 | CommandQueue.ReadBuffer(FractalBuffer, Width * Height * 4 * SizeOf(Byte), 130 | @host_image[0]); 131 | SaveToFile(ExtractFilePath(ParamStr(0)) + 'Example2.bmp'); 132 | 133 | FreeAndNil(Kernel); 134 | FreeAndNil(FractalProgram); 135 | FreeAndNil(FractalBuffer); 136 | finally 137 | FreeAndNil(CommandQueue); 138 | end; 139 | finally 140 | FreeAndNil(Platforms); 141 | end; 142 | Writeln('press any key...'); 143 | Readln; 144 | end. 145 | -------------------------------------------------------------------------------- /Source/OpenCL.inc: -------------------------------------------------------------------------------- 1 | (********************************************) 2 | (* *) 3 | (* OpenCL1.2 and Delphi and Windows *) 4 | (* *) 5 | (* created by : Maksym Tymkovych *) 6 | (* (niello) *) 7 | (* *) 8 | (* headers versions: 0.07 *) 9 | (* file name : OpenCL.inc *) 10 | (* last modify : 10.12.11 *) 11 | (* license : BSD *) 12 | (* *) 13 | (* Site : www.niello.org.ua *) 14 | (* e-mail : muxamed13@ukr.net *) 15 | (* ICQ : 446-769-253 *) 16 | (* *) 17 | (*********Copyright (c) niello 2008-2011*****) 18 | 19 | 20 | {$IFDEF MSWINDOWS} 21 | {$DEFINE WINDOWS} 22 | {$ENDIF} 23 | {$IFDEF WINDOWS} 24 | {$IF DEFINED(WIN32) or DEFINED(WIN64)} 25 | {$DEFINE WINDESKTOP} 26 | {$ELSE} 27 | {$DEFINE WINMOBILE} 28 | {$IFEND} 29 | {$DEFINE STDCALL} 30 | {$ENDIF} 31 | {$IFDEF LINUX} 32 | {$DEFINE CDECL} 33 | {$ENDIF} 34 | {$IFDEF DARWIN} 35 | {$IF DEFINED(iPHONESIM) or (DEFINED(DARWIN) and DEFINED(CPUARM))} 36 | {$DEFINE iOS} 37 | {$ELSE} 38 | {$DEFINE MACOSX} 39 | {$IFEND} 40 | {$DEFINE CDECL} 41 | {$ENDIF} 42 | 43 | 44 | {$DEFINE USE_LOG} //Use default procedure Writeln() 45 | 46 | //{$DEFINE PURE_OPENCL_1_0} 47 | {$DEFINE PURE_OPENCL_1_1} //Actual now 48 | //{$DEFINE PURE_OPENCL_1_2} 49 | //{$DEFINE PURE_OPENCL_2_0} //TODO: work in progress 50 | 51 | //{$DEFINE WITH_DEPERCATED_OPENCL_1_1} 52 | //{$DEFINE WITH_DEPERCATED_OPENCL_1_2} 53 | //{$DEFINE WITH_DEPERCATED_OPENCL_2_0} 54 | 55 | 56 | //use Defines PURE_OPENCL_1_0 or PURE_OPENCL_1_1 or PURE_OPENCL_1_2 57 | // WITH_DEPERCATED_OPENCL_1_1 or WITH_DEPERCATED_OPENCL_1_2 58 | //{$DEFINE CL_VERSION_1_1} 59 | //{$DEFINE CL_VERSION_1_2} //wait drivers support 60 | //{$DEFINE CL_USE_DEPRECATED_OPENCL_1_0_APIS} 61 | //{$DEFINE CL_USE_DEPRECATED_OPENCL_1_1_APIS} 62 | //{$DEFINE CL_USE_DEPRECATED_OPENCL_1_2_APIS} 63 | //{$DEFINE CL_USE_DEPRECATED_OPENCL_2_0_APIS} //next OpenCL API version 64 | 65 | {$IFDEF PURE_OPENCL_1_0} 66 | {$DEFINE CL_VERSION_1_0} 67 | {$DEFINE CL_USE_DEPRECATED_OPENCL_1_0_APIS} 68 | 69 | {$UNDEF CL_VERSION_1_1} 70 | {$UNDEF CL_VERSION_1_2} 71 | {$UNDEF CL_USE_DEPRECATED_OPENCL_1_1_APIS} 72 | {$UNDEF CL_USE_DEPRECATED_OPENCL_1_2_APIS} 73 | {$UNDEF CL_USE_DEPRECATED_OPENCL_2_0_APIS} 74 | {$ENDIF} 75 | 76 | {$IFDEF PURE_OPENCL_1_1} 77 | {$DEFINE CL_VERSION_1_0} 78 | {$DEFINE CL_VERSION_1_1} 79 | {$DEFINE CL_USE_DEPRECATED_OPENCL_1_1_APIS} 80 | 81 | {$UNDEF CL_VERSION_1_2} 82 | {$UNDEF CL_USE_DEPRECATED_OPENCL_1_0_APIS} 83 | {$UNDEF CL_USE_DEPRECATED_OPENCL_1_2_APIS} 84 | {$UNDEF CL_USE_DEPRECATED_OPENCL_2_0_APIS} 85 | {$ENDIF} 86 | 87 | {$IFDEF PURE_OPENCL_1_2} 88 | {$DEFINE CL_VERSION_1_0} 89 | {$DEFINE CL_VERSION_1_1} 90 | {$DEFINE CL_VERSION_1_2} 91 | {$DEFINE CL_USE_DEPRECATED_OPENCL_1_2_APIS} 92 | 93 | {$UNDEF CL_USE_DEPRECATED_OPENCL_1_0_APIS} 94 | {$UNDEF CL_USE_DEPRECATED_OPENCL_1_1_APIS} 95 | {$UNDEF CL_USE_DEPRECATED_OPENCL_2_0_APIS} 96 | {$ENDIF} 97 | 98 | {$IFDEF PURE_OPENCL_2_0} 99 | {$DEFINE CL_VERSION_1_0} 100 | {$DEFINE CL_VERSION_1_1} 101 | {$DEFINE CL_VERSION_1_2} 102 | {$DEFINE CL_VERSION_2_0} 103 | {$DEFINE CL_USE_DEPRECATED_OPENCL_2_0_APIS} 104 | 105 | {$UNDEF CL_USE_DEPRECATED_OPENCL_1_0_APIS} 106 | {$UNDEF CL_USE_DEPRECATED_OPENCL_1_1_APIS} 107 | {$UNDEF CL_USE_DEPRECATED_OPENCL_1_2_APIS} 108 | {$ENDIF} 109 | 110 | {$IFDEF WITH_DEPERCATED_OPENCL_1_1} 111 | {$DEFINE CL_VERSION_1_0} 112 | {$DEFINE CL_VERSION_1_1} 113 | {$DEFINE CL_USE_DEPRECATED_OPENCL_1_1_APIS} 114 | {$DEFINE CL_USE_DEPRECATED_OPENCL_1_0_APIS} 115 | 116 | {$UNDEF CL_VERSION_1_2} 117 | {$UNDEF CL_VERSION_2_0} 118 | {$UNDEF CL_USE_DEPRECATED_OPENCL_1_2_APIS} 119 | {$UNDEF CL_USE_DEPRECATED_OPENCL_2_0_APIS} 120 | {$ENDIF} 121 | 122 | 123 | {$IFDEF WITH_DEPERCATED_OPENCL_1_2} 124 | {$DEFINE CL_VERSION_1_0} 125 | {$DEFINE CL_VERSION_1_1} 126 | {$DEFINE CL_VERSION_1_2} 127 | {$DEFINE CL_USE_DEPRECATED_OPENCL_1_1_APIS} 128 | {$DEFINE CL_USE_DEPRECATED_OPENCL_1_0_APIS} 129 | {$DEFINE CL_USE_DEPRECATED_OPENCL_1_2_APIS} 130 | 131 | {$UNDEF CL_VERSION_2_0} 132 | {$UNDEF CL_USE_DEPRECATED_OPENCL_2_0_APIS} 133 | {$ENDIF} 134 | 135 | {$IFDEF WITH_DEPERCATED_OPENCL_2_0} 136 | {$DEFINE CL_VERSION_1_0} 137 | {$DEFINE CL_VERSION_1_1} 138 | {$DEFINE CL_VERSION_1_2} 139 | {$DEFINE CL_VERSION_2_0} 140 | {$DEFINE CL_USE_DEPRECATED_OPENCL_1_1_APIS} 141 | {$DEFINE CL_USE_DEPRECATED_OPENCL_1_0_APIS} 142 | {$DEFINE CL_USE_DEPRECATED_OPENCL_1_2_APIS} 143 | {$DEFINE CL_USE_DEPRECATED_OPENCL_2_0_APIS} 144 | {$ENDIF} 145 | 146 | 147 | 148 | {$IFDEF FPC} 149 | {$MODE Delphi} 150 | {$ENDIF} 151 | 152 | {$IFNDEF FPC} 153 | {$IFDEF VER110}//Builder 3 154 | {$DEFINE DEFINE_8087CW_NOT_IMPLEMENTED} 155 | {$DEFINE DEFINE_UINT64_EQU_INT64} 156 | {$DEFINE DEFINE_REGION_NOT_IMPLEMENTED} 157 | {$ENDIF} 158 | {$IFDEF VER100}//Delphi3 159 | {$DEFINE DEFINE_8087CW_NOT_IMPLEMENTED} 160 | {$DEFINE DEFINE_UINT64_EQU_INT64} 161 | {$DEFINE DEFINE_REGION_NOT_IMPLEMENTED} 162 | {$ENDIF} 163 | {$IFDEF VER120}//Delphi 4 164 | {$DEFINE DEFINE_8087CW_NOT_IMPLEMENTED} 165 | {$DEFINE DEFINE_UINT64_EQU_INT64} 166 | {$DEFINE DEFINE_REGION_NOT_IMPLEMENTED} 167 | {$ENDIF} 168 | {$IFDEF VER130}//Delphi 5 169 | {$DEFINE DEFINE_UINT64_EQU_INT64} 170 | {$DEFINE DEFINE_UINT64_EQU_INT64} 171 | {$ENDIF} 172 | {$IFDEF VER140}//Delphi 6 173 | {$DEFINE DEFINE_UINT64_EQU_INT64} 174 | {$DEFINE DEFINE_REGION_NOT_IMPLEMENTED} 175 | {$ENDIF} 176 | {$IFDEF VER150}//Delphi 7 177 | {$DEFINE DEFINE_REGION_NOT_IMPLEMENTED} 178 | {$ENDIF} 179 | {$ENDIF} 180 | 181 | 182 | 183 | 184 | 185 | -------------------------------------------------------------------------------- /Source/CL_D3D11.pas: -------------------------------------------------------------------------------- 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_d3d11.pas *) 32 | (* last modify : 10.12.11 *) 33 | (* license : BSD *) 34 | (* *) 35 | (* Site : www.niello.org.ua *) 36 | (* e-mail : muxamed13@ukr.net *) 37 | (* ICQ : 446-769-253 *) 38 | (* *) 39 | (* updated by : Alexander Kiselev *) 40 | (* (Igroman) *) 41 | (* Site : http://Igroman14.livejournal.com *) 42 | (* e-mail : Igroman14@yandex.ru *) 43 | (* ICQ : 207-381-695 *) 44 | (* (c) 2010 *) 45 | (* *) 46 | (***********Copyright (c) niello 2008-2011*******) 47 | unit CL_D3D11; 48 | 49 | interface 50 | 51 | {$INCLUDE OpenCL.inc} 52 | 53 | uses 54 | CL_Platform, 55 | CL; 56 | 57 | (****************************************************************************** 58 | * cl_khr_d3d11_sharing *) 59 | const 60 | cl_khr_d3d11_sharing = 1; 61 | 62 | type 63 | TCL_d3d11_device_source_khr = TCL_uint; 64 | PCL_d3d11_device_source_khr = ^TCL_d3d11_device_source_khr; 65 | 66 | TCL_d3d11_device_set_khr = TCL_uint; 67 | PCL_d3d11_device_set_khr = ^TCL_d3d11_device_set_khr; 68 | 69 | (******************************************************************************) 70 | const 71 | // Error Codes 72 | CL_INVALID_D3D11_DEVICE_KHR = -1006; 73 | CL_INVALID_D3D11_RESOURCE_KHR = -1007; 74 | CL_D3D11_RESOURCE_ALREADY_ACQUIRED_KHR = -1008; 75 | CL_D3D11_RESOURCE_NOT_ACQUIRED_KHR = -1009; 76 | 77 | // cl_d3d11_device_source 78 | CL_D3D11_DEVICE_KHR = $4019; 79 | CL_D3D11_DXGI_ADAPTER_KHR = $401A; 80 | 81 | // cl_d3d11_device_set 82 | CL_PREFERRED_DEVICES_FOR_D3D11_KHR = $401B; 83 | CL_ALL_DEVICES_FOR_D3D11_KHR = $401C; 84 | 85 | // cl_context_info 86 | CL_CONTEXT_D3D11_DEVICE_KHR = $401D; 87 | CL_CONTEXT_D3D11_PREFER_SHARED_RESOURCES_KHR = $402D; 88 | 89 | // cl_mem_info 90 | CL_MEM_D3D11_RESOURCE_KHR = $401E; 91 | 92 | // cl_image_info 93 | CL_IMAGE_D3D11_SUBRESOURCE_KHR = $401F; 94 | 95 | // cl_command_type 96 | CL_COMMAND_ACQUIRE_D3D11_OBJECTS_KHR = $4020; 97 | CL_COMMAND_RELEASE_D3D11_OBJECTS_KHR = $4021; 98 | 99 | (******************************************************************************) 100 | 101 | 102 | {$IFDEF CL_VERSION_1_0} 103 | type 104 | TclGetDeviceIDsFromD3D11KHR_fn = function ( 105 | cl_platform_id platform, 106 | cl_d3d11_device_source_khr d3d_device_source, 107 | void * d3d_object, 108 | cl_d3d11_device_set_khr d3d_device_set, 109 | cl_uint num_entries, 110 | cl_device_id * devices, 111 | cl_uint * num_devices 112 | ): TCL_int; 113 | {$IFDEF CDECL}cdecl{$ELSE}stdcall{$ENDIF}; 114 | 115 | TclCreateFromD3D11BufferKHR_fn = function ( 116 | cl_context context, 117 | cl_mem_flags flags, 118 | ID3D11Buffer * resource, 119 | cl_int * errcode_ret 120 | ): PCL_mem; 121 | {$IFDEF CDECL}cdecl{$ELSE}stdcall{$ENDIF}; 122 | 123 | TclCreateFromD3D11Texture2DKHR_fn = function ( 124 | cl_context context, 125 | cl_mem_flags flags, 126 | ID3D11Texture2D * resource, 127 | UINT subresource, 128 | cl_int * errcode_ret 129 | ): PCL_mem; 130 | {$IFDEF CDECL}cdecl{$ELSE}stdcall{$ENDIF}; 131 | 132 | TclCreateFromD3D11Texture3DKHR_fn = function ( 133 | cl_context context, 134 | cl_mem_flags flags, 135 | ID3D11Texture3D * resource, 136 | UINT subresource, 137 | cl_int * errcode_ret 138 | ): PCL_mem; 139 | {$IFDEF CDECL}cdecl{$ELSE}stdcall{$ENDIF}; 140 | 141 | TclEnqueueAcquireD3D11ObjectsKHR_fn = function ( 142 | cl_command_queue command_queue, 143 | cl_uint num_objects, 144 | const cl_mem * mem_objects, 145 | cl_uint num_events_in_wait_list, 146 | const cl_event * event_wait_list, 147 | cl_event * event 148 | ): TCL_int; 149 | {$IFDEF CDECL}cdecl{$ELSE}stdcall{$ENDIF}; 150 | 151 | TclEnqueueReleaseD3D11ObjectsKHR_fn = function ( 152 | cl_command_queue command_queue, 153 | cl_uint num_objects, 154 | const cl_mem * mem_objects, 155 | cl_uint num_events_in_wait_list, 156 | const cl_event * event_wait_list, 157 | cl_event * event 158 | ): TCL_int; 159 | {$IFDEF CDECL}cdecl{$ELSE}stdcall{$ENDIF}; 160 | {$ENDIF} 161 | 162 | implementation 163 | 164 | end. -------------------------------------------------------------------------------- /Source/CL_DX9_Media_Sharing.pas: -------------------------------------------------------------------------------- 1 | (******************************************************************************* 2 | * Copyright (c) 2008-2012 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_dx9_media_sharing.pas*) 32 | (* last modify : 10.12.11 *) 33 | (* license : BSD *) 34 | (* *) 35 | (* Site : www.niello.org.ua *) 36 | (* e-mail : muxamed13@ukr.net *) 37 | (* ICQ : 446-769-253 *) 38 | (* *) 39 | (* updated by : Alexander Kiselev *) 40 | (* (Igroman) *) 41 | (* Site : http://Igroman14.livejournal.com *) 42 | (* e-mail : Igroman14@yandex.ru *) 43 | (* ICQ : 207-381-695 *) 44 | (* (c) 2010 *) 45 | (* *) 46 | (***********Copyright (c) niello 2008-2011*******) 47 | unit CL_DX9_Media_Sharing; 48 | 49 | interface 50 | 51 | {$INCLUDE OpenCL.inc} 52 | 53 | uses 54 | CL_Platform, 55 | CL, 56 | Direct3D9; 57 | 58 | (****************************************************************************** 59 | (* cl_khr_dx9_media_sharing *) 60 | const 61 | cl_khr_dx9_media_sharing = 1; 62 | type 63 | 64 | PIDirect3DSurface9 = ^IDirect3DSurface9; 65 | 66 | Pcl_dx9_surface_info_khr = ^Tcl_dx9_surface_info_khr; 67 | Tcl_dx9_surface_info_khr = packed record 68 | resource: PIDirect3DSurface9; 69 | shared_handle: THandle; 70 | end; 71 | 72 | (******************************************************************************) 73 | const 74 | // Error Codes 75 | CL_INVALID_DX9_MEDIA_ADAPTER_KHR = -1010; 76 | CL_INVALID_DX9_MEDIA_SURFACE_KHR = -1011; 77 | CL_DX9_MEDIA_SURFACE_ALREADY_ACQUIRED_KHR = -1012; 78 | CL_DX9_MEDIA_SURFACE_NOT_ACQUIRED_KHR = -1013; 79 | 80 | // cl_media_adapter_type_khr 81 | CL_ADAPTER_D3D9_KHR = $2020; 82 | CL_ADAPTER_D3D9EX_KHR = $2021; 83 | CL_ADAPTER_DXVA_KHR = $2022; 84 | 85 | // cl_media_adapter_set_khr 86 | CL_PREFERRED_DEVICES_FOR_DX9_MEDIA_ADAPTER_KHR = $2023; 87 | CL_ALL_DEVICES_FOR_DX9_MEDIA_ADAPTER_KHR = $2024; 88 | 89 | // cl_context_info 90 | CL_CONTEXT_D3D9_DEVICE_KHR = $2025; 91 | CL_CONTEXT_D3D9EX_DEVICE_KHR = $2026; 92 | CL_CONTEXT_DXVA_DEVICE_KHR = $2027; 93 | 94 | // cl_mem_info 95 | CL_MEM_DX9_MEDIA_ADAPTER_TYPE_KHR = $2028; 96 | CL_MEM_DX9_MEDIA_SURFACE_INFO_KHR = $2029; 97 | 98 | // cl_image_info 99 | CL_IMAGE_DX9_MEDIA_PLANE_KHR = $202A; 100 | 101 | // cl_command_type 102 | CL_COMMAND_ACQUIRE_DX9_MEDIA_SURFACES_KHR = $202B; 103 | CL_COMMAND_RELEASE_DX9_MEDIA_SURFACES_KHR = $202C; 104 | 105 | (******************************************************************************) 106 | 107 | {$IFDEF CL_VERSION_1_2} 108 | 109 | type 110 | TclGetDeviceIDsForDX9MediaAdapterKHR_fn = function 111 | ( 112 | _platform: Pcl_platform_id; 113 | //media_adapter_type: Tcl_dx9_media_adapter_type_khr; 114 | //media_adapter: Pointer; media_adapter_set: Tcl_dx9_media_adapter_set_khr; 115 | num_entries: Tcl_uint; devices: PPcl_device_id; 116 | num_devices: Pcl_uint 117 | ): TCL_int; {$IFDEF CDECL} cdecl {$ELSE} stdcall{$ENDIF}; 118 | 119 | TclCreateFromDX9MediaSurfaceKHR_fn = function 120 | ( 121 | context: Pcl_context; 122 | flags: Tcl_mem_flags; 123 | //adapter_type: Tcl_dx9_media_adapter_type_khr; 124 | surface_info: Pointer; 125 | plane: Tcl_uint; 126 | errcode_ret: Pcl_int 127 | ): PCL_mem; {$IFDEF CDECL} cdecl {$ELSE} stdcall{$ENDIF}; 128 | 129 | TclEnqueueAcquireDX9MediaSurfacesKHR_fn = function 130 | ( 131 | command_queue: Pcl_command_queue; 132 | num_objects: Tcl_uint; 133 | const mem_objects: PPcl_mem; 134 | num_events_in_wait_list: Tcl_uint; 135 | const event_wait_list: PPcl_event; 136 | event: PPcl_event 137 | ): TCL_int; {$IFDEF CDECL} cdecl {$ELSE} stdcall{$ENDIF}; 138 | 139 | TclEnqueueReleaseDX9MediaSurfacesKHR_fn = function 140 | ( 141 | command_queue: Pcl_command_queue; 142 | num_objects: Tcl_uint; 143 | const mem_objects: PPcl_mem; 144 | num_events_in_wait_list: Tcl_uint; 145 | const event_wait_list: PPcl_event; 146 | event: PPcl_event 147 | ): TCL_int; {$IFDEF CDECL} cdecl {$ELSE} stdcall{$ENDIF}; 148 | 149 | {$ENDIF} 150 | 151 | {$IFDEF CL_VERSION_1_2} 152 | var 153 | clGetDeviceIDsForDX9MediaAdapterKHR_fn: TclGetDeviceIDsForDX9MediaAdapterKHR_fn; 154 | clCreateFromDX9MediaSurfaceKHR_fn: TclCreateFromDX9MediaSurfaceKHR_fn; 155 | clEnqueueAcquireDX9MediaSurfacesKHR_fn: TclEnqueueAcquireDX9MediaSurfacesKHR_fn; 156 | clEnqueueReleaseDX9MediaSurfacesKHR_fn: TclEnqueueReleaseDX9MediaSurfacesKHR_fn; 157 | {$ENDIF} 158 | 159 | function InitCL_DX9MediaSharing: Boolean; 160 | 161 | implementation 162 | 163 | function InitCL_DX9MediaSharing: Boolean; 164 | begin 165 | Result := False; 166 | if OCL_LibHandle <> nil then 167 | begin 168 | {$IFDEF CL_VERSION_1_2} 169 | clGetDeviceIDsForDX9MediaAdapterKHR_fn := TclGetDeviceIDsForDX9MediaAdapterKHR_fn(oclGetProcAddress('clGetDeviceIDsForDX9MediaAdapterKHR_fn', OCL_LibHandle)); 170 | clCreateFromDX9MediaSurfaceKHR_fn := TclCreateFromDX9MediaSurfaceKHR_fn(oclGetProcAddress('clCreateFromDX9MediaSurfaceKHR_fn', OCL_LibHandle)); 171 | clEnqueueAcquireDX9MediaSurfacesKHR_fn := TclEnqueueAcquireDX9MediaSurfacesKHR_fn(oclGetProcAddress('clEnqueueAcquireDX9MediaSurfacesKHR_fn', OCL_LibHandle)); 172 | clEnqueueReleaseDX9MediaSurfacesKHR_fn := TclEnqueueReleaseDX9MediaSurfacesKHR_fn(oclGetProcAddress('clEnqueueReleaseDX9MediaSurfacesKHR_fn', OCL_LibHandle)); 173 | {$ENDIF} 174 | Result := True; 175 | end; 176 | end; 177 | 178 | end. 179 | -------------------------------------------------------------------------------- /Examples/Example3/Example3.dpr: -------------------------------------------------------------------------------- 1 | (************************************************************************) 2 | (* *) 3 | (* OpenCL1.2 and Delphi *) 4 | (* *) 5 | (* project site : http://code.google.com/p/delphi-opencl/ *) 6 | (* *) 7 | (* file name : Example5.dpr *) 8 | (* last modify : 24.12.11 *) 9 | (* license : BSD *) 10 | (* *) 11 | (* created by : Maksym Tymkovych (niello) *) 12 | (* Site : www.niello.org.ua *) 13 | (* e-mail : muxamed13@ukr.net *) 14 | (* ICQ : 446-769-253 *) 15 | (* *) 16 | (* and : Alexander Kiselev (Igroman) *) 17 | (* Site : http://Igroman14.livejournal.com *) 18 | (* e-mail : Igroman14@yandex.ru *) 19 | (* ICQ : 207-381-695 *) 20 | (* *) 21 | (************************delphi-opencl2010-2011**************************) 22 | 23 | program Example3; 24 | 25 | {$APPTYPE CONSOLE} 26 | {$INCLUDE ..\..\Source\OpenCL.inc} 27 | 28 | uses 29 | CL_Platform in '..\..\Source\CL_Platform.pas', 30 | CL in '..\..\Source\CL.pas', 31 | CL_GL in '..\..\Source\CL_GL.pas', 32 | DelphiCL in '..\..\Source\DelphiCL.pas', 33 | Graphics, 34 | SysUtils; 35 | 36 | var 37 | Width, 38 | Height : TCL_int; 39 | 40 | type 41 | PAByte = ^TAByte; 42 | TAByte = array of Byte; 43 | 44 | var 45 | HostImageIn, 46 | HostImageOut: TAByte; 47 | 48 | {$IFNDEF DEFINE_REGION_NOT_IMPLEMENTED}{$REGION 'Load and Save'}{$ENDIF} 49 | procedure LoadFromFile(const FileName: string); 50 | type 51 | TRGBTriple = packed record 52 | rgbtBlue: Byte; 53 | rgbtGreen: Byte; 54 | rgbtRed: Byte; 55 | end; 56 | PRGBTripleArray = ^TRGBTripleArray; 57 | TRGBTripleArray = array [0..0] of TRGBTriple; 58 | var 59 | bmp: Graphics.TBitmap; 60 | i, j, pos: integer; 61 | row: PRGBTripleArray; 62 | begin 63 | bmp := Graphics.TBitmap.Create; 64 | bmp.LoadFromFile(FileName); 65 | bmp.PixelFormat := pf24bit; 66 | Width := bmp.Width; 67 | Height := bmp.Height; 68 | 69 | pos := 0; 70 | SetLength(HostImageIn, Width * Height * 4 * SizeOf(Byte)); 71 | SetLength(HostImageOut, Width * Height * 4 * SizeOf(Byte)); 72 | for i := Height - 1 downto 0 do 73 | begin 74 | row := bmp.ScanLine[i]; 75 | for j := 0 to Width - 1 do 76 | begin 77 | HostImageIn[pos] := row[j].rgbtBlue; 78 | inc(pos); 79 | HostImageIn[pos] := row[j].rgbtGreen; 80 | inc(pos); 81 | HostImageIn[pos] := row[j].rgbtRed; 82 | inc(pos); 83 | HostImageIn[pos] := 0; 84 | inc(pos); 85 | end; 86 | end; 87 | bmp.Free; 88 | end; 89 | 90 | procedure SaveToFile(const FileName: string); 91 | type 92 | DWORD = LongWord; 93 | 94 | TBitmapFileHeader = packed record 95 | bfType: Word; 96 | bfSize: DWORD; 97 | bfReserved1: Word; 98 | bfReserved2: Word; 99 | bfOffBits: DWORD; 100 | end; 101 | 102 | TBitmapInfoHeader = packed record 103 | biSize: DWORD; 104 | biWidth: Longint; 105 | biHeight: Longint; 106 | biPlanes: Word; 107 | biBitCount: Word; 108 | biCompression: DWORD; 109 | biSizeImage: DWORD; 110 | biXPelsPerMeter: Longint; 111 | biYPelsPerMeter: Longint; 112 | biClrUsed: DWORD; 113 | biClrImportant: DWORD; 114 | end; 115 | const 116 | BI_RGB = 0; 117 | var 118 | F: File; 119 | BFH: TBitmapFileHeader; 120 | BIH: TBitmapInfoHeader; 121 | begin 122 | Assign(F, FileName); 123 | Rewrite(F, 1); 124 | FillChar(BFH, SizeOf(BFH), 0); 125 | FillChar(BIH, SizeOf(BIH), 0); 126 | with BFH do 127 | begin 128 | bfType := $4D42; 129 | bfSize := SizeOf(BFH) + SizeOf(BIH) + Width * Height * 4; 130 | bfOffBits := SizeOf(BIH) + SizeOf(BFH); 131 | end; 132 | BlockWrite(F, BFH, SizeOf(BFH)); 133 | with BIH do 134 | begin 135 | biSize := SizeOf(BIH); 136 | biWidth := Width; 137 | biHeight := Height; 138 | biPlanes := 1; 139 | biBitCount := 32; 140 | biCompression := BI_RGB; 141 | biSizeImage := Width * Height * 4; 142 | end; 143 | BlockWrite(F, BIH, SizeOf(BIH)); 144 | BlockWrite(F, HostImageOut[0], Width * Height * 4 * SizeOf(Byte)); 145 | Close(F); 146 | end; 147 | {$IFNDEF DEFINE_REGION_NOT_IMPLEMENTED}{$ENDREGION}{$ENDIF} 148 | 149 | var 150 | Platforms: TDCLPlatforms; 151 | CommandQueue: TDCLCommandQueue; 152 | MainProgram: TDCLProgram; 153 | Kernel : TDCLKernel; 154 | InputBuffer, OutputBuffer: TDCLBuffer; 155 | FilterType: Byte; 156 | SourceName: string; 157 | FileName: TFileName; 158 | begin 159 | // specify & load image resource 160 | FileName := ExtractFilePath(ParamStr(0)) + '..\..\Resources\Lena.bmp'; 161 | Assert(FileExists(FileName)); 162 | LoadFromFile(FileName); 163 | 164 | Writeln('Select filter kenel:'); 165 | Writeln(' 0 - Filter01.cl - "Mask 3x3"'); 166 | Writeln(' 1 - Filter02.cl - "RGB->Gray"'); 167 | Writeln(' 2 - Filter03.cl - "RGB<->BGR"'); 168 | Writeln(' 3 - Filter04.cl - "if (c>value) then 255 else 0"'); 169 | Writeln(' 4 - Filter05.cl - "invert"'); 170 | Writeln(' 5 - Filter06.cl - "log"'); 171 | Writeln(' 6 - Filter07.cl - "rotation"'); 172 | Writeln(' 7 - Filter08.cl - "Kuwahara (5x5)"'); 173 | Writeln(' 8 - Filter09.cl - "Kuwahara (13x13)"'); 174 | 175 | Readln(FilterType); 176 | 177 | case FilterType of 178 | 0: 179 | SourceName := 'Filter01.cl'; 180 | 1: 181 | SourceName := 'Filter02.cl'; 182 | 2: 183 | SourceName := 'Filter03.cl'; 184 | 3: 185 | SourceName := 'Filter04.cl'; 186 | 4: 187 | SourceName := 'Filter05.cl'; 188 | 5: 189 | SourceName := 'Filter06.cl'; 190 | 6: 191 | SourceName := 'Filter07.cl'; 192 | 7: 193 | SourceName := 'Filter08.cl'; 194 | 8: 195 | SourceName := 'Filter09.cl'; 196 | else 197 | SourceName := 'Filter09.cl'; 198 | end; 199 | 200 | // specify source name 201 | FileName := ExtractFilePath(ParamStr(0)) + '..\..\Resources\' + SourceName; 202 | Assert(FileExists(FileName)); 203 | 204 | InitOpenCL; 205 | 206 | Platforms := TDCLPlatforms.Create; 207 | with Platforms.Platforms[0]^.DeviceWithMaxClockFrequency^ do 208 | try 209 | CommandQueue := CreateCommandQueue; 210 | try 211 | InputBuffer := CreateBuffer(Width * Height * 4 * SizeOf(TCL_Char), nil, 212 | [mfReadOnly]); 213 | CommandQueue.WriteBuffer(InputBuffer, Width * Height * 4 * SizeOf(TCL_Char), 214 | @HostImageIn[0]); 215 | OutputBuffer := CreateBuffer(Width * Height * 4 * SizeOf(TCL_Char), nil, 216 | [mfWriteOnly]); 217 | MainProgram := CreateProgram(FileName); 218 | 219 | // create kernel and specify arguments 220 | Kernel := MainProgram.CreateKernel('render'); 221 | Kernel.SetArg(0, InputBuffer); 222 | Kernel.SetArg(1, OutputBuffer); 223 | Kernel.SetArg(2, SizeOf(@Width), @Width); 224 | Kernel.SetArg(3, SizeOf(@Height), @Height); 225 | 226 | // execute kernel 227 | CommandQueue.Execute(Kernel, Width * Height); 228 | 229 | CommandQueue.ReadBuffer(OutputBuffer, Width * Height * 4 * SizeOf(Byte), 230 | @HostImageOut[0]); 231 | SaveToFile(ExtractFilePath(ParamStr(0)) + 'Example3.bmp'); 232 | FreeAndNil(Kernel); 233 | FreeAndNil(MainProgram); 234 | FreeAndNil(OutputBuffer); 235 | FreeAndNil(InputBuffer); 236 | finally 237 | FreeAndNil(CommandQueue); 238 | end; 239 | finally 240 | FreeAndNil(Platforms); 241 | end; 242 | 243 | Writeln('press any key...'); 244 | Readln; 245 | end. 246 | -------------------------------------------------------------------------------- /Examples/Example1/Example1.dproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | True 4 | Console 5 | Debug 6 | DCC32 7 | None 8 | Example1.dpr 9 | Win32 10 | {B404A580-7D7D-4756-B0D1-4048C6417186} 11 | 18.3 12 | 3 13 | 14 | 15 | true 16 | 17 | 18 | true 19 | Base 20 | true 21 | 22 | 23 | true 24 | Base 25 | true 26 | 27 | 28 | true 29 | Base 30 | true 31 | 32 | 33 | true 34 | Base 35 | true 36 | 37 | 38 | true 39 | Cfg_2 40 | true 41 | true 42 | 43 | 44 | Example1 45 | ..\..\DCU\$(PLATFORM) 46 | Example1.exe 47 | false 48 | ..\..\Binaries\$(PLATFORM) 49 | false 50 | 00400000 51 | false 52 | true 53 | System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) 54 | x86 55 | false 56 | 1 57 | ..\..\Source;$(DCC_UnitSearchPath) 58 | vcl;rtl;dbrtl;adortl;vcldb;vclx;bdertl;ibxpress;dsnap;cds;bdecds;qrpt;teeui;teedb;tee;vcldbx;dss;teeqr;visualclx;visualdbclx;dsnapcrba;dsnapcon;VclSmp;vclshlctrls;vclie;xmlrtl;inet;inetdbbde;inetdbxpress;inetdb;nmfast;webdsnap;websnap;dbexpress;dbxcds;indy;dclOffice2k;ADOX;$(DCC_UsePackage) 59 | $(BDS)\bin\delphi_PROJECTICNS.icns 60 | $(BDS)\bin\delphi_PROJECTICON.ico 61 | None 62 | CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= 63 | 1058 64 | 65 | 66 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) 67 | 1033 68 | 69 | 70 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) 71 | 1033 72 | 73 | 74 | 0 75 | RELEASE;$(DCC_Define) 76 | false 77 | 0 78 | 79 | 80 | DEBUG;$(DCC_Define) 81 | 82 | 83 | 1033 84 | 85 | 86 | 87 | MainSource 88 | 89 | 90 | 91 | 92 | 93 | 94 | Base 95 | 96 | 97 | Cfg_1 98 | Base 99 | 100 | 101 | Cfg_2 102 | Base 103 | 104 | 105 | 106 | 107 | Delphi.Personality.12 108 | VCLApplication 109 | 110 | 111 | 112 | Example1.dpr 113 | 114 | 115 | False 116 | True 117 | False 118 | 119 | 120 | False 121 | False 122 | 1 123 | 0 124 | 0 125 | 0 126 | False 127 | False 128 | False 129 | False 130 | False 131 | 1058 132 | 1251 133 | 134 | 135 | 136 | 137 | 1.0.0.0 138 | 139 | 140 | 141 | 142 | 143 | 1.0.0.0 144 | 145 | 146 | 147 | Microsoft Office 2000 Beispiele für gekapselte Komponenten für Automatisierungsserver 148 | Microsoft Office XP Beispiele für gekapselte Komponenten für Automation Server 149 | 150 | 151 | 152 | False 153 | True 154 | True 155 | 156 | 157 | 12 158 | 159 | 160 | 161 | -------------------------------------------------------------------------------- /Examples/Example4/Example4.dproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | True 4 | Console 5 | Debug 6 | DCC32 7 | None 8 | Example4.dpr 9 | Win32 10 | {CC1B28A1-4336-4FB6-A6CF-45E5ABC577F1} 11 | 18.3 12 | 3 13 | 14 | 15 | true 16 | 17 | 18 | true 19 | Base 20 | true 21 | 22 | 23 | true 24 | Base 25 | true 26 | 27 | 28 | true 29 | Base 30 | true 31 | 32 | 33 | true 34 | Base 35 | true 36 | 37 | 38 | true 39 | Cfg_2 40 | true 41 | true 42 | 43 | 44 | Example4 45 | ..\..\DCU\$(PLATFORM) 46 | Example4.exe 47 | false 48 | ..\..\Binaries\$(PLATFORM) 49 | false 50 | 00400000 51 | false 52 | true 53 | System;Xml;Data;Datasnap;Web;Soap;Vcl;$(DCC_Namespace) 54 | x86 55 | false 56 | 1 57 | ..\..\Source;$(DCC_UnitSearchPath) 58 | vcl;rtl;dbrtl;adortl;vcldb;vclx;bdertl;ibxpress;dsnap;cds;bdecds;qrpt;teeui;teedb;tee;vcldbx;dss;teeqr;visualclx;visualdbclx;dsnapcrba;dsnapcon;VclSmp;vclshlctrls;vclie;xmlrtl;inet;inetdbbde;inetdbxpress;inetdb;nmfast;webdsnap;websnap;dbexpress;dbxcds;indy;dclOffice2k;ADOX;$(DCC_UsePackage) 59 | $(BDS)\bin\delphi_PROJECTICNS.icns 60 | $(BDS)\bin\delphi_PROJECTICON.ico 61 | None 62 | CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= 63 | 1058 64 | 65 | 66 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) 67 | 1033 68 | 69 | 70 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) 71 | 1033 72 | 73 | 74 | 0 75 | RELEASE;$(DCC_Define) 76 | false 77 | 0 78 | 79 | 80 | DEBUG;$(DCC_Define) 81 | 82 | 83 | 1033 84 | 85 | 86 | 87 | MainSource 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | Base 96 | 97 | 98 | Cfg_1 99 | Base 100 | 101 | 102 | Cfg_2 103 | Base 104 | 105 | 106 | 107 | 108 | Delphi.Personality.12 109 | VCLApplication 110 | 111 | 112 | 113 | Example4.dpr 114 | 115 | 116 | False 117 | True 118 | False 119 | 120 | 121 | False 122 | False 123 | 1 124 | 0 125 | 0 126 | 0 127 | False 128 | False 129 | False 130 | False 131 | False 132 | 1058 133 | 1251 134 | 135 | 136 | 137 | 138 | 1.0.0.0 139 | 140 | 141 | 142 | 143 | 144 | 1.0.0.0 145 | 146 | 147 | 148 | Microsoft Office 2000 Beispiele für gekapselte Komponenten für Automatisierungsserver 149 | Microsoft Office XP Beispiele für gekapselte Komponenten für Automation Server 150 | 151 | 152 | 153 | False 154 | True 155 | True 156 | 157 | 158 | 12 159 | 160 | 161 | 162 | -------------------------------------------------------------------------------- /Examples/OpenCL Info/OpenCL_Info.dproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | True 4 | Application 5 | Debug 6 | DCC32 7 | VCL 8 | OpenCL_Info.dpr 9 | Win32 10 | {BF2E8E72-9936-4FE3-ABC7-965B32F1DBA7} 11 | 18.3 12 | 1 13 | 14 | 15 | true 16 | Base 17 | true 18 | 19 | 20 | true 21 | 22 | 23 | true 24 | Base 25 | true 26 | 27 | 28 | true 29 | Base 30 | true 31 | 32 | 33 | true 34 | Base 35 | true 36 | 37 | 38 | true 39 | Cfg_2 40 | true 41 | true 42 | 43 | 44 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png 45 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png 46 | 47 | 48 | OpenCL_Info 49 | ..\..\DCU\$(PLATFORM) 50 | OpenCL_Info.exe 51 | false 52 | ..\..\Binaries\$(PLATFORM) 53 | false 54 | 00400000 55 | false 56 | false 57 | Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi;$(DCC_Namespace) 58 | x86 59 | false 60 | ..\..\Source;$(DCC_UnitSearchPath) 61 | None 62 | CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= 63 | 1049 64 | 65 | 66 | true 67 | System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) 68 | $(BDS)\bin\default_app.manifest 69 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png 70 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png 71 | true 72 | 1033 73 | 74 | 75 | 0 76 | RELEASE;$(DCC_Define) 77 | false 78 | 0 79 | 80 | 81 | DEBUG;$(DCC_Define) 82 | 83 | 84 | true 85 | Debug 86 | $(BDS)\bin\default_app.manifest 87 | true 88 | 1033 89 | 90 | 91 | 92 | MainSource 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 |
FormOpenCLInfo
102 |
103 | 104 | 105 | Base 106 | 107 | 108 | Cfg_1 109 | Base 110 | 111 | 112 | Cfg_2 113 | Base 114 | 115 |
116 | 117 | 118 | Delphi.Personality.12 119 | 120 | 121 | 122 | 123 | OpenCL_Info.dpr 124 | 125 | 126 | False 127 | True 128 | False 129 | 130 | 131 | False 132 | False 133 | 1 134 | 0 135 | 0 136 | 0 137 | False 138 | False 139 | False 140 | False 141 | False 142 | 1049 143 | 1251 144 | 145 | 146 | 147 | 148 | 1.0.0.0 149 | 150 | 151 | 152 | 153 | 154 | 1.0.0.0 155 | 156 | 157 | 158 | Microsoft Office 2000 Beispiele für gekapselte Komponenten für Automatisierungsserver 159 | Microsoft Office XP Beispiele für gekapselte Komponenten für Automation Server 160 | 161 | 162 | 163 | True 164 | False 165 | 166 | 167 | 12 168 | 169 | 170 |
171 | -------------------------------------------------------------------------------- /Examples/Example5/MainUnit.pas: -------------------------------------------------------------------------------- 1 | (************************************************************************) 2 | (* *) 3 | (* OpenCL1.2 and Delphi *) 4 | (* *) 5 | (* project site : http://code.google.com/p/delphi-opencl/ *) 6 | (* *) 7 | (* file name : MainUnit.pas *) 8 | (* last modify : 24.12.11 *) 9 | (* license : BSD *) 10 | (* *) 11 | (* created by : Maksym Tymkovych *) 12 | (* (niello) *) 13 | (* Site : www.niello.org.ua *) 14 | (* e-mail : muxamed13@ukr.net *) 15 | (* ICQ : 446-769-253 *) 16 | (* *) 17 | (* and : Alexander Kiselev *) 18 | (* (Igroman) *) 19 | (* Site : http://Igroman14.livejournal.com *) 20 | (* e-mail : Igroman14@yandex.ru *) 21 | (* ICQ : 207-381-695 *) 22 | (* *) 23 | (************************delphi-opencl2010-2011**************************) 24 | 25 | unit MainUnit; 26 | 27 | interface 28 | 29 | {$DEFINE GL_INTEROP} 30 | 31 | uses 32 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, ExtCtrls, 33 | Dialogs, dglOpenGL, CL_Platform, CL, CL_GL, DelphiCL; 34 | 35 | type 36 | TFormMain = class(TForm) 37 | TimerRecalculate: TTimer; 38 | procedure FormCreate(Sender: TObject); 39 | procedure FormDestroy(Sender: TObject); 40 | procedure FormKeyPress(Sender: TObject; var Key: Char); 41 | procedure FormMouseDown(Sender: TObject; Button: TMouseButton; 42 | Shift: TShiftState; X, Y: Integer); 43 | procedure FormMouseUp(Sender: TObject; Button: TMouseButton; 44 | Shift: TShiftState; X, Y: Integer); 45 | procedure TimerRecalculateTimer(Sender: TObject); 46 | private 47 | FDC: HDC; 48 | FRC: HGLRC; 49 | 50 | FPlatforms: TDCLPlatforms; 51 | FDevice: PDCLDevice; 52 | FCommand: TDCLCommandQueue; 53 | FProgram: TDCLProgram; 54 | FKernel: TDCLKernel; 55 | 56 | FRotateX, FRotateY: TCL_float; 57 | FTranslateZ: TCL_float; 58 | FAnim: TCL_float; 59 | 60 | FMouseOldX, FMouseOldY: Integer; 61 | FMouseButtons: Integer; 62 | 63 | procedure InitGL; 64 | procedure IdleHandler(Sender: TObject; var Done: Boolean); 65 | procedure Render; 66 | procedure CreateVBO(const VBO: PGLuint); 67 | procedure DeleteVBO(const VBO: PGLuint); 68 | procedure Motion(x,y: Integer); 69 | procedure CleanUp; 70 | procedure DisplayGL; 71 | procedure RunKernel; 72 | public 73 | end; 74 | 75 | var 76 | FormMain: TFormMain; 77 | 78 | vbo_cl: TDCLBuffer; 79 | vbo: TGLuint; 80 | 81 | iFrameCount: Integer = 0; 82 | iFrameTrigger: Integer = 90; 83 | iFramePerSec: Integer = 0; 84 | iTestSets: Integer = 3; 85 | 86 | g_Index: Integer = 0; 87 | bQATest: Boolean = False; 88 | g_bFBODisplay: Boolean = False; 89 | bNoPrompt: Boolean = False; 90 | 91 | const 92 | iRefFrameNumber: Integer = 4; 93 | window_width = 512; 94 | window_height = 512; 95 | mesh_width: TCL_uint = 256; 96 | mesh_height: TCL_uint = 256; 97 | 98 | implementation 99 | 100 | {$R *.dfm} 101 | 102 | procedure TFormMain.FormCreate(Sender: TObject); 103 | var 104 | FileName: TFileName; 105 | begin 106 | FDC := GetDC(Handle); 107 | if (not InitOpenGL)or(not InitOpenCL) then 108 | Application.Terminate; 109 | ReadExtensions; 110 | InitCL_GL; 111 | FRC := CreateRenderingContext(FDC, [opDoubleBuffered], 32, 24, 0, 0, 0, 0); 112 | ActivateRenderingContext(FDC, FRC); 113 | InitGL; 114 | 115 | FRotateX := 0.0; 116 | FRotateY := 0.0; 117 | FTranslateZ := -3.0; 118 | FAnim := 0.0; 119 | FMouseButtons := 0; 120 | 121 | // specify program 122 | FileName := ExtractFilePath(ParamStr(0)) + '..\..\Resources\SimpleGL.cl'; 123 | Assert(FileExists(FileName)); 124 | 125 | FPlatforms := TDCLPlatforms.Create; 126 | FDevice := FPlatforms.Platforms[0]^.DeviceWithMaxClockFrequency; 127 | FCommand := FDevice.CreateCommandQueue({$IFDEF GL_INTEROP}FDevice.CreateContextGL{$ENDIF}); 128 | FProgram := FDevice.CreateProgram(FileName); 129 | FKernel := FProgram.CreateKernel('sine_wave'); 130 | 131 | CreateVBO(@vbo); 132 | 133 | FKernel.SetArg(0, vbo_cl); 134 | FKernel.SetArg(1, SizeOf(TCL_uint), @mesh_width); 135 | FKernel.SetArg(2, SizeOf(TCL_uint), @mesh_height); 136 | FCommand.Execute(FKernel, [mesh_width, mesh_height]); 137 | 138 | TimerRecalculate.Enabled := True; 139 | Application.OnIdle := IdleHandler; 140 | end; 141 | 142 | procedure TFormMain.IdleHandler(Sender: TObject; var Done: Boolean); 143 | begin 144 | Render; 145 | Sleep(1); 146 | Done := False; 147 | end; 148 | 149 | procedure TFormMain.InitGL; 150 | begin 151 | glClearColor(0.0, 0.0, 0.0, 1.0); 152 | glDisable(GL_DEPTH_TEST); 153 | glViewport(0, 0, window_width, window_height); 154 | glMatrixMode(GL_PROJECTION); 155 | glLoadIdentity; 156 | gluPerspective(60.0, window_width / window_height, 0.1, 10.0); 157 | glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT); 158 | glMatrixMode(GL_MODELVIEW); 159 | glLoadIdentity; 160 | glTranslatef(0.0, 0.0, FTranslateZ); 161 | glRotatef(FRotateX, 1.0, 0.0, 0.0); 162 | glRotatef(FRotateY, 0.0, 1.0, 0.0); 163 | end; 164 | 165 | procedure TFormMain.FormDestroy(Sender: TObject); 166 | begin 167 | TimerRecalculate.Enabled := False; 168 | CleanUp; 169 | DeactivateRenderingContext; 170 | DestroyRenderingContext(FRC); 171 | ReleaseDC(Handle, FDC); 172 | end; 173 | 174 | procedure TFormMain.Render; 175 | begin 176 | DisplayGL; 177 | SwapBuffers(FDC); 178 | end; 179 | 180 | procedure TFormMain.FormKeyPress(Sender: TObject; var Key: Char); 181 | begin 182 | if (Key = #27) or (Key = 'Q') or (Key = 'q') then 183 | Application.Terminate; 184 | end; 185 | 186 | procedure TFormMain.CreateVBO(const VBO: PGLuint); 187 | var 188 | Size: TGLsizei; 189 | begin 190 | glGenBuffers(1, vbo); 191 | glBindBuffer(GL_ARRAY_BUFFER, vbo^); 192 | Size := mesh_width * mesh_height * 4 * SizeOf(TCL_float); 193 | glBufferData(GL_ARRAY_BUFFER, Size, nil, GL_DYNAMIC_DRAW); 194 | {$IFDEF GL_INTEROP} 195 | vbo_cl := FDevice.CreateFromGLBuffer(vbo, [mfWriteOnly]); 196 | {$ELSE} 197 | vbo_cl := FDevice.CreateBuffer(Size, nil, [mfWriteOnly]); 198 | {$ENDIF} 199 | end; 200 | 201 | procedure TFormMain.DeleteVBO(const VBO: PGLuint); 202 | begin 203 | FreeAndNil(vbo_cl); 204 | glBindBuffer(1, vbo^); 205 | glDeleteBuffers(1, vbo); 206 | vbo^ := 0; 207 | end; 208 | 209 | procedure TFormMain.CleanUp; 210 | begin 211 | DeleteVBO(@vbo); 212 | FreeAndNil(FKernel); 213 | FreeAndNil(FProgram); 214 | FreeAndNil(FCommand); 215 | FreeAndNil(FPlatforms); 216 | end; 217 | 218 | procedure TFormMain.Motion(x, y: Integer); 219 | var 220 | dx, dy: TCL_float; 221 | begin 222 | dx := x - FMouseOldX; 223 | dy := y - FMouseOldy; 224 | if (FMouseButtons and 1) <> 0 then 225 | begin 226 | FRotateX := FRotateX + dy * 0.2; 227 | FRotateY := FRotateY + dx * 0.2; 228 | end 229 | else 230 | if (FMouseButtons and 4) <> 0 then 231 | FTranslateZ := FTranslateZ + dy * 0.01; 232 | FMouseOldX := x; 233 | FMouseOldy := y; 234 | glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT); 235 | glMatrixMode(GL_MODELVIEW); 236 | glLoadIdentity; 237 | glTranslatef(0.0, 0.0, FTranslateZ); 238 | glRotatef(FRotateX, 1.0, 0.0, 0.0); 239 | glRotatef(FRotateY, 0.0, 1.0, 0.0); 240 | end; 241 | 242 | procedure TFormMain.FormMouseDown(Sender: TObject; Button: TMouseButton; 243 | Shift: TShiftState; X, Y: Integer); 244 | begin 245 | FMouseButtons := FMouseButtons or (1 shl Integer(button)); 246 | FMouseOldX := x; 247 | FMouseOldy := y; 248 | end; 249 | 250 | procedure TFormMain.FormMouseUp(Sender: TObject; Button: TMouseButton; 251 | Shift: TShiftState; X, Y: Integer); 252 | begin 253 | FMouseButtons := 0; 254 | FMouseOldX := x; 255 | FMouseOldy := y; 256 | end; 257 | 258 | procedure TFormMain.DisplayGL; 259 | begin 260 | glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT); 261 | glBindBuffer(GL_ARRAY_BUFFER, vbo); 262 | glVertexPointer(4, GL_FLOAT, 0, nil); 263 | glEnableClientState(GL_VERTEX_ARRAY); 264 | glColor3f(1.0, 0.0, 0.0); 265 | glDrawArrays(GL_POINTS, 0, mesh_width * mesh_height); 266 | glDisableClientState(GL_VERTEX_ARRAY); 267 | end; 268 | 269 | procedure TFormMain.RunKernel; 270 | var 271 | szGlobalWorkSize: Array [0..1] of TSize_t; 272 | {$IFNDEF GL_INTEROP} 273 | ptr: PGLvoid; 274 | {$ENDIF} 275 | begin 276 | {$IFDEF GL_INTEROP} 277 | FCommand.AcquireGLObject(vbo_cl); 278 | {$ENDIF} 279 | szGlobalWorkSize[0] := mesh_width; 280 | szGlobalWorkSize[1] := mesh_height; 281 | FKernel.SetArg(3, SizeOf(TCL_float), @FAnim); 282 | FCommand.Execute(FKernel, szGlobalWorkSize); 283 | {$IFDEF GL_INTEROP} 284 | FCommand.ReleaseGLObject(vbo_cl); 285 | {$ELSE} 286 | glBindBufferARB(GL_ARRAY_BUFFER, vbo); 287 | ptr := glMapBufferARB(GL_ARRAY_BUFFER, GL_WRITE_ONLY_ARB); 288 | FCommand.ReadBuffer(vbo_cl, SizeOf(TCL_float) * 4 * mesh_height * mesh_width,ptr); 289 | glUnmapBufferARB(GL_ARRAY_BUFFER); 290 | {$ENDIF} 291 | end; 292 | 293 | procedure TFormMain.TimerRecalculateTimer(Sender: TObject); 294 | begin 295 | Motion(Mouse.CursorPos.X, Mouse.CursorPos.Y); 296 | FAnim := FAnim + 0.1; 297 | RunKernel; 298 | end; 299 | 300 | end. 301 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The code license of the original project was specified as Apache License on GoogleCode, but BSD inside the source code. Since it is unclear what license applies here, you can find both licenses in this file. 2 | 3 | The first license in this file is the Apache license, followed by the BSD license at the end of this document. 4 | 5 | 6 | --- 7 | 8 | 9 | Apache License 10 | 11 | Version 2.0, January 2004 12 | 13 | http://www.apache.org/licenses/ 14 | 15 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 16 | 17 | 1. Definitions. 18 | 19 | "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. 20 | 21 | "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. 22 | 23 | "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. 24 | 25 | "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. 28 | 29 | "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. 30 | 31 | "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). 32 | 33 | "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. 34 | 35 | "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." 36 | 37 | "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 38 | 39 | 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 40 | 41 | 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 42 | 43 | 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: 44 | You must give any other recipients of the Work or Derivative Works a copy of this License; and 45 | You must cause any modified files to carry prominent notices stating that You changed the files; and 46 | You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and 47 | If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. 48 | 49 | You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 50 | 51 | 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 52 | 53 | 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 54 | 55 | 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 56 | 57 | 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 58 | 59 | 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. 60 | 61 | END OF TERMS AND CONDITIONS 62 | 63 | 64 | ---- 65 | 66 | 67 | BSD License 68 | 69 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 70 | 71 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 72 | 73 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 74 | 75 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /Examples/Example5/Example5.dproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | True 4 | Application 5 | Debug 6 | VCL 7 | Example5.dpr 8 | Win32 9 | {4071BD0F-8F85-486E-9C41-E86099801824} 10 | 18.3 11 | 3 12 | 13 | 14 | true 15 | 16 | 17 | true 18 | Base 19 | true 20 | 21 | 22 | true 23 | Base 24 | true 25 | 26 | 27 | true 28 | Base 29 | true 30 | 31 | 32 | true 33 | Cfg_1 34 | true 35 | true 36 | 37 | 38 | true 39 | Base 40 | true 41 | 42 | 43 | true 44 | Cfg_2 45 | true 46 | true 47 | 48 | 49 | true 50 | Cfg_2 51 | true 52 | true 53 | 54 | 55 | Example5 56 | ..\..\DCU\$(PLATFORM) 57 | false 58 | ..\..\Binaries\$(PLATFORM) 59 | false 60 | 00400000 61 | false 62 | true 63 | Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi;$(DCC_Namespace) 64 | false 65 | 1 66 | ..\..\Source;$(DCC_UnitSearchPath) 67 | vcl;rtl;dbrtl;adortl;vcldb;vclx;bdertl;ibxpress;dsnap;cds;bdecds;qrpt;teeui;teedb;tee;vcldbx;dss;teeqr;visualclx;visualdbclx;dsnapcrba;dsnapcon;VclSmp;vclshlctrls;vclie;xmlrtl;inet;inetdbbde;inetdbxpress;inetdb;nmfast;webdsnap;websnap;dbexpress;dbxcds;indy;dclOffice2k;ADOX;$(DCC_UsePackage) 68 | None 69 | CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= 70 | 1058 71 | 72 | 73 | true 74 | System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) 75 | $(BDS)\bin\default_app.manifest 76 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png 77 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png 78 | true 79 | 1033 80 | 81 | 82 | true 83 | System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) 84 | Example5_Icon.ico 85 | $(BDS)\bin\default_app.manifest 86 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png 87 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png 88 | true 89 | 1033 90 | 91 | 92 | 0 93 | RELEASE;$(DCC_Define) 94 | false 95 | 0 96 | 97 | 98 | true 99 | $(BDS)\bin\default_app.manifest 100 | true 101 | 1033 102 | 103 | 104 | DEBUG;$(DCC_Define) 105 | true 106 | false 107 | 108 | 109 | true 110 | Debug 111 | $(BDS)\bin\default_app.manifest 112 | true 113 | 1033 114 | 115 | 116 | Debug 117 | 118 | 119 | 120 | MainSource 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 |
FormMain
129 |
130 | 131 | Base 132 | 133 | 134 | Cfg_1 135 | Base 136 | 137 | 138 | Cfg_2 139 | Base 140 | 141 |
142 | 143 | Delphi.Personality.12 144 | 145 | 146 | 147 | 148 | Example5.dpr 149 | 150 | 151 | False 152 | False 153 | 1 154 | 0 155 | 0 156 | 0 157 | False 158 | False 159 | False 160 | False 161 | False 162 | 1058 163 | 1251 164 | 165 | 166 | 167 | 168 | 1.0.0.0 169 | 170 | 171 | 172 | 173 | 174 | 1.0.0.0 175 | 176 | 177 | 178 | Microsoft Office 2000 Beispiele für gekapselte Komponenten für Automatisierungsserver 179 | Microsoft Office XP Beispiele für gekapselte Komponenten für Automation Server 180 | 181 | 182 | 183 | True 184 | True 185 | 186 | 187 | 12 188 | 189 | 190 | 191 |
192 | -------------------------------------------------------------------------------- /Source/CL_Platform.pas: -------------------------------------------------------------------------------- 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_Platform.pas *) 32 | (* last modify : 10.12.11 *) 33 | (* license : BSD *) 34 | (* *) 35 | (* Site : www.niello.org.ua *) 36 | (* e-mail : muxamed13@ukr.net *) 37 | (* ICQ : 446-769-253 *) 38 | (* *) 39 | (*********Copyright (c) niello 2008-2011*****) 40 | 41 | //Fixed By Dmitry Belkevich 42 | //Site www.makhaon.com 43 | //E-mail dmitry@makhaon.com 44 | //(c) 2009 45 | //Beta release 1.0 46 | 47 | unit CL_Platform; 48 | 49 | interface 50 | 51 | (* 52 | Delphi 6 and down don't support UInt64; 53 | *) 54 | 55 | {$INCLUDE 'OpenCL.inc'} 56 | 57 | type 58 | PCL_char = ^TCL_char; 59 | TCL_char = Shortint;//-127..+128; 60 | 61 | PCL_uchar = ^TCL_uchar; 62 | TCL_uchar = Byte;//0..255; 63 | 64 | PCL_short = ^TCL_short; 65 | TCL_short = Smallint;//- 32767..+32768; 66 | 67 | PCL_ushort = ^TCL_ushort; 68 | TCL_ushort = Word;//0..+65535; 69 | 70 | PCL_int = ^TCL_int; 71 | TCL_int = Longint;//-2147483647..+2147483648; 72 | 73 | PCL_uint = ^TCL_uint; 74 | TCL_uint = Longword;//0..4294967295; 75 | 76 | PCL_long = ^TCL_long; 77 | TCL_long = Int64; 78 | 79 | PCL_ulong = ^TCL_ulong; 80 | //The error is found by Andrew Terekhov 81 | TCL_ulong = {$IFDEF DEFINE_UINT64_EQU_INT64} Int64;{$ELSE} UInt64;{$ENDIF} 82 | 83 | PCL_half = ^TCL_half; 84 | TCL_half = TCL_ushort; 85 | 86 | PCL_float = ^TCL_float; 87 | TCL_float = Single; 88 | 89 | PCL_double = ^TCL_double; 90 | TCL_double = Double; 91 | 92 | PCL_half2 = ^TCL_half2; 93 | TCL_half2 = record 94 | i16 : Array [0..1]of TCL_half; 95 | end; 96 | 97 | PCL_half4 = ^TCL_half4; 98 | TCL_half4 = record 99 | i16 : Array [0..3]of TCL_half; 100 | end; 101 | 102 | PCL_half8 = ^TCL_half8; 103 | TCL_half8 = record 104 | i16 : Array [0..7]of TCL_half; 105 | end; 106 | 107 | PCL_half16 = ^TCL_half16; 108 | TCL_half16 = record 109 | i16 : Array [0..15]of TCL_half; 110 | end; 111 | 112 | PCL_char2 = ^TCL_char2; 113 | TCL_char2 = record 114 | i8 : Array [0..1]of TCL_char; 115 | end; 116 | 117 | PCL_char4 = ^TCL_char4; 118 | TCL_char4 = record 119 | i8 : Array [0..3]of TCL_char; 120 | end; 121 | 122 | PCL_char8 = ^TCL_char8; 123 | TCL_char8 = record 124 | i8 : Array [0..7]of TCL_char; 125 | end; 126 | 127 | PCL_char16 = ^TCL_char16; 128 | TCL_char16 = record 129 | i8 : Array [0..15]of TCL_char; 130 | end; 131 | 132 | PCL_uchar2 = ^TCL_uchar2; 133 | TCL_uchar2 = record 134 | u8 : Array [0..1]of TCL_uchar; 135 | end; 136 | 137 | PCL_uchar4 = ^TCL_uchar4; 138 | TCL_uchar4 = record 139 | u8 : Array [0..3]of TCL_uchar; 140 | end; 141 | 142 | PCL_uchar8 = ^TCL_uchar8; 143 | TCL_uchar8 = record 144 | u8 : Array [0..7]of TCL_uchar; 145 | end; 146 | 147 | PCL_uchar16 = ^TCL_uchar16; 148 | TCL_uchar16 = record 149 | u8 : Array [0..15]of TCL_uchar; 150 | end; 151 | 152 | PCL_short2 = ^TCL_short2; 153 | TCL_short2 = record 154 | i16 : Array [0..1]of TCL_short; 155 | end; 156 | 157 | PCL_short4 = ^TCL_short4; 158 | TCL_short4 = record 159 | i16 : Array [0..3]of TCL_short; 160 | end; 161 | 162 | PCL_short8 = ^TCL_short8; 163 | TCL_short8 = record 164 | i16 : Array [0..7]of TCL_short; 165 | end; 166 | 167 | PCL_short16 = ^TCL_short16; 168 | TCL_short16 = record 169 | i16 : Array [0..15]of TCL_short; 170 | end; 171 | 172 | PCL_ushort2 = ^TCL_ushort2; 173 | TCL_ushort2 = record 174 | u16 : Array [0..1]of TCL_ushort; 175 | end; 176 | 177 | PCL_ushort4 = ^TCL_ushort4; 178 | TCL_ushort4 = record 179 | u16 : Array [0..3]of TCL_ushort; 180 | end; 181 | 182 | PCL_ushort8 = ^TCL_ushort8; 183 | TCL_ushort8 = record 184 | u16 : Array [0..7]of TCL_ushort; 185 | end; 186 | 187 | PCL_ushort16 = ^TCL_ushort16; 188 | TCL_ushort16 = record 189 | u16 : Array [0..15]of TCL_ushort; 190 | end; 191 | 192 | PCL_int2 = ^TCL_int2; 193 | TCL_int2 = record 194 | i32 : Array [0..1]of TCL_int; 195 | end; 196 | 197 | PCL_int4 = ^TCL_int4; 198 | TCL_int4 = record 199 | i32 : Array [0..3]of TCL_int; 200 | end; 201 | 202 | PCL_int8 = ^TCL_int8; 203 | TCL_int8 = record 204 | i32 : Array [0..7]of TCL_int; 205 | end; 206 | 207 | PCL_int16 = ^TCL_int16; 208 | TCL_int16 = record 209 | i32 : Array [0..15]of TCL_int; 210 | end; 211 | 212 | PCL_uint2 = ^TCL_uint2; 213 | TCL_uint2 = record 214 | u32 : Array [0..1]of TCL_uint; 215 | end; 216 | 217 | PCL_uint4 = ^TCL_uint4; 218 | TCL_uint4 = record 219 | u32 : Array [0..3]of TCL_uint; 220 | end; 221 | 222 | PCL_uint8 = ^TCL_uint8; 223 | TCL_uint8 = record 224 | u32 : Array [0..7]of TCL_uint; 225 | end; 226 | 227 | PCL_uint16 = ^TCL_uint16; 228 | TCL_uint16 = record 229 | u32 : Array [0..15]of TCL_uint; 230 | end; 231 | 232 | PCL_long2 = ^TCL_long2; 233 | TCL_long2 = record 234 | i64 : Array [0..1]of TCL_long; 235 | end; 236 | 237 | PCL_long4 = ^TCL_long4; 238 | TCL_long4 = record 239 | i64 : Array [0..3]of TCL_long; 240 | end; 241 | 242 | PCL_long8 = ^TCL_long8; 243 | TCL_long8 = record 244 | i64 : Array [0..7]of TCL_long; 245 | end; 246 | 247 | PCL_long16 = ^TCL_long16; 248 | TCL_long16 = record 249 | i64 : Array [0..15]of TCL_long; 250 | end; 251 | 252 | PCL_ulong2 = ^TCL_ulong2; 253 | TCL_ulong2 = record 254 | u64 : Array [0..1]of TCL_ulong; 255 | end; 256 | 257 | PCL_ulong4 = ^TCL_ulong4; 258 | TCL_ulong4 = record 259 | u64 : Array [0..3]of TCL_ulong; 260 | end; 261 | 262 | PCL_ulong8 = ^TCL_ulong8; 263 | TCL_ulong8 = record 264 | u64 : Array [0..7]of TCL_ulong; 265 | end; 266 | 267 | PCL_ulong16 = ^TCL_ulong16; 268 | TCL_ulong16 = record 269 | u64 : Array [0..15]of TCL_ulong; 270 | end; 271 | 272 | PCL_float2 = ^TCL_float2; 273 | TCL_float2 = record 274 | f32 : Array [0..1]of TCL_float; 275 | end; 276 | 277 | PCL_float4 = ^TCL_float4; 278 | TCL_float4 = record 279 | f32 : Array [0..3]of TCL_float; 280 | end; 281 | 282 | PCL_float8 = ^TCL_float8; 283 | TCL_float8 = record 284 | f32 : Array [0..7]of TCL_float; 285 | end; 286 | 287 | PCL_float16 = ^TCL_float16; 288 | TCL_float16 = record 289 | f32 : Array [0..15]of TCL_float; 290 | end; 291 | 292 | PCL_double2 = ^TCL_double2; 293 | TCL_double2 = record 294 | f64 : Array [0..1]of TCL_double; 295 | end; 296 | 297 | PCL_double4 = ^TCL_double4; 298 | TCL_double4 = record 299 | f64 : Array [0..3]of TCL_double; 300 | end; 301 | 302 | PCL_double8 = ^TCL_double8; 303 | TCL_double8 = record 304 | f64 : Array [0..7]of TCL_double; 305 | end; 306 | 307 | PCL_double16 = ^TCL_double16; 308 | TCL_double16 = record 309 | f64 : Array [0..15]of TCL_double; 310 | end; 311 | 312 | const 313 | CL_CHAR_BIT = 8; 314 | CL_SCHAR_MAX = 127; 315 | CL_SCHAR_MIN = (-127-1); 316 | CL_CHAR_MAX = CL_SCHAR_MAX; 317 | CL_CHAR_MIN = CL_SCHAR_MIN; 318 | CL_UCHAR_MAX = 255; 319 | CL_SHRT_MAX = 32767; 320 | CL_SHRT_MIN = (-32767-1); 321 | CL_USHRT_MAX = 65535; 322 | CL_INT_MAX = 2147483647; 323 | CL_INT_MIN = (-2147483647-1); 324 | CL_UINT_MAX = $ffffffff; 325 | CL_LONG_MAX = TCL_long ($7FFFFFFFFFFFFFFF); 326 | CL_LONG_MIN = TCL_long (-$7FFFFFFFFFFFFFFF) - 1; 327 | CL_ULONG_MAX = TCL_ulong($FFFFFFFFFFFFFFFF); 328 | 329 | CL_FLT_DIG = 6; 330 | CL_FLT_MANT_DIG = 24; 331 | CL_FLT_MAX_10_EXP = +38; 332 | CL_FLT_MAX_EXP = +128; 333 | CL_FLT_MIN_10_EXP = -37; 334 | CL_FLT_MIN_EXP = -125; 335 | CL_FLT_RADIX = 2; 336 | CL_FLT_MAX = 340282346638528859811704183484516925440.0; 337 | CL_FLT_MIN = 1.175494350822287507969e-38; 338 | //CL_FLT_EPSILON = 0x1.0p-23f; 339 | 340 | CL_DBL_DIG = 15; 341 | CL_DBL_MANT_DIG = 53; 342 | CL_DBL_MAX_10_EXP = +308; 343 | CL_DBL_MAX_EXP = +1024; 344 | CL_DBL_MIN_10_EXP = -307; 345 | CL_DBL_MIN_EXP = -1021; 346 | CL_DBL_RADIX = 2; 347 | CL_DBL_MAX = 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0; 348 | CL_DBL_MIN = 2.225073858507201383090e-308; 349 | CL_DBL_EPSILON = 2.220446049250313080847e-16; 350 | 351 | CL_M_E = 2.718281828459045090796; 352 | CL_M_LOG2E = 1.442695040888963387005; 353 | CL_M_LOG10E = 0.434294481903251816668; 354 | CL_M_LN2 = 0.693147180559945286227; 355 | CL_M_LN10 = 2.302585092994045901094; 356 | CL_M_PI = 3.141592653589793115998; 357 | CL_M_PI_2 = 1.570796326794896557999; 358 | CL_M_PI_4 = 0.785398163397448278999; 359 | CL_M_1_PI = 0.318309886183790691216; 360 | CL_M_2_PI = 0.636619772367581382433; 361 | CL_M_2_SQRTPI = 1.128379167095512558561; 362 | CL_M_SQRT2 = 1.414213562373095145475; 363 | CL_M_SQRT1_2 = 0.707106781186547572737; 364 | 365 | CL_M_E_F = 2.71828174591064; 366 | CL_M_LOG2E_F = 1.44269502162933; 367 | CL_M_LOG10E_F = 0.43429449200630; 368 | CL_M_LN2_F = 0.69314718246460; 369 | CL_M_LN10_F = 2.30258512496948; 370 | CL_M_PI_F = 3.14159274101257; 371 | CL_M_PI_2_F = 1.57079637050629; 372 | CL_M_PI_4_F = 0.78539818525314; 373 | CL_M_1_PI_F = 0.31830987334251; 374 | CL_M_2_PI_F = 0.63661974668503; 375 | CL_M_2_SQRTPI_F = 1.12837922573090; 376 | CL_M_SQRT2_F = 1.41421353816986; 377 | CL_M_SQRT1_2_F = 0.70710676908493; 378 | 379 | 380 | CL_HUGE_VALF : TCL_float = 1e50; 381 | CL_HUGE_VAL : TCL_double = 1e500; 382 | CL_MAXFLOAT = CL_FLT_MAX; 383 | CL_INFINITY : TCL_float = 1e50; //CL_HUGE_VALF 384 | CL_NAN = 0/0;//(CL_INFINITY - CL_INFINITY); 385 | 386 | implementation 387 | 388 | end. 389 | -------------------------------------------------------------------------------- /Source/CL_D3D10.pas: -------------------------------------------------------------------------------- 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_d3d10.pas *) 32 | (* last modify : 10.12.11 *) 33 | (* license : BSD *) 34 | (* *) 35 | (* Site : www.niello.org.ua *) 36 | (* e-mail : muxamed13@ukr.net *) 37 | (* ICQ : 446-769-253 *) 38 | (* *) 39 | (* updated by : Alexander Kiselev *) 40 | (* (Igroman) *) 41 | (* Site : http://Igroman14.livejournal.com *) 42 | (* e-mail : Igroman14@yandex.ru *) 43 | (* ICQ : 207-381-695 *) 44 | (* (c) 2010 *) 45 | (* *) 46 | (***********Copyright (c) niello 2008-2011*******) 47 | 48 | unit CL_D3D10; 49 | 50 | interface 51 | 52 | {$INCLUDE OpenCL.inc} 53 | 54 | uses 55 | OpenGL, 56 | CL, 57 | D3D10, 58 | CL_Platform; 59 | 60 | {$INCLUDE 'OpenCL.inc'} 61 | 62 | type 63 | UINT = Longword; 64 | 65 | (****************************************************************************** 66 | * cl_khr_d3d10_sharing *) 67 | const 68 | cl_khr_d3d10_sharing = 1; 69 | type 70 | Pcl_d3d10_device_source_khr = ^Tcl_d3d10_device_source_khr; 71 | Tcl_d3d10_device_source_khr = TCL_uint; 72 | 73 | Pcl_d3d10_device_set_khr = ^Tcl_d3d10_device_set_khr; 74 | Tcl_d3d10_device_set_khr = TCL_uint; 75 | 76 | (******************************************************************************) 77 | const 78 | // Error Codes 79 | CL_INVALID_D3D10_DEVICE_KHR = -1002; 80 | CL_INVALID_D3D10_RESOURCE_KHR = -1003; 81 | CL_D3D10_RESOURCE_ALREADY_ACQUIRED_KHR = -1004; 82 | CL_D3D10_RESOURCE_NOT_ACQUIRED_KHR = -1005; 83 | 84 | // cl_d3d10_device_source_nv 85 | CL_D3D10_DEVICE_KHR = $4010; 86 | CL_D3D10_DXGI_ADAPTER_KHR = $4011; 87 | 88 | // cl_d3d10_device_set_nv 89 | CL_PREFERRED_DEVICES_FOR_D3D10_KHR = $4012; 90 | CL_ALL_DEVICES_FOR_D3D10_KHR = $4013; 91 | 92 | // cl_context_info 93 | CL_CONTEXT_D3D10_DEVICE_KHR = $4014; 94 | CL_CONTEXT_D3D10_PREFER_SHARED_RESOURCES_KHR = $402C; 95 | 96 | // cl_mem_info 97 | CL_MEM_D3D10_RESOURCE_KHR = $4015; 98 | 99 | // cl_image_info 100 | CL_IMAGE_D3D10_SUBRESOURCE_KHR = $4016; 101 | 102 | // cl_command_type 103 | CL_COMMAND_ACQUIRE_D3D10_OBJECTS_KHR = $4017; 104 | CL_COMMAND_RELEASE_D3D10_OBJECTS_KHR = $4018; 105 | 106 | (******************************************************************************) 107 | {$IFDEF CL_VERSION_1_0} 108 | type 109 | 110 | TclGetDeviceIDsFromD3D10KHR_fn = function( 111 | platform: Tcl_platform_id; 112 | d3d_device_source: Tcl_d3d10_device_source_khr; 113 | d3d_object: Pointer; 114 | d3d_device_set: Tcl_d3d10_device_set_khr; 115 | num_entries: Tcl_uint; 116 | devices: PPcl_device_id; 117 | num_devices: Pcl_uint 118 | ): Tcl_int; 119 | {$IFDEF CDECL}cdecl{$ELSE}stdcall{$ENDIF}; 120 | {$ENDIF} 121 | 122 | {$IFDEF CL_VERSION_1_0} 123 | type 124 | 125 | TclCreateFromD3D10BufferKHR_fn = function( 126 | context: Pcl_context; 127 | flags: Tcl_mem_flags; 128 | resource: PID3D10Buffer; 129 | errcode_ret: Pcl_int 130 | ): Tcl_int; 131 | {$IFDEF CDECL}cdecl{$ELSE}stdcall{$ENDIF}; 132 | {$ENDIF} 133 | 134 | {$IFDEF CL_VERSION_1_0} 135 | type 136 | 137 | TclCreateFromD3D10Texture2DKHR_fn = function( 138 | context: Pcl_context; 139 | flags: Tcl_mem_flags; 140 | resource: PID3D10Texture2D; 141 | subresource: UINT; 142 | errcode_ret: Pcl_int 143 | ): Tcl_int; 144 | {$IFDEF CDECL}cdecl{$ELSE}stdcall{$ENDIF}; 145 | {$ENDIF} 146 | 147 | {$IFDEF CL_VERSION_1_0} 148 | type 149 | 150 | TclCreateFromD3D10Texture3DKHR_fn = function( 151 | context: Pcl_context; 152 | flags: Tcl_mem_flags; 153 | resource: PID3D10Texture3D; 154 | subresource: UINT; 155 | errcode_ret: Pcl_int 156 | ): Tcl_int; 157 | {$IFDEF CDECL}cdecl{$ELSE}stdcall{$ENDIF}; 158 | {$ENDIF} 159 | 160 | {$IFDEF CL_VERSION_1_0} 161 | type 162 | 163 | TclEnqueueAcquireD3D10ObjectsKHR_fn = function( 164 | command_queue: Pcl_command_queue; 165 | num_objects: Tcl_uint; 166 | const mem_objects: PPcl_mem; 167 | num_events_in_wait_list: Tcl_uint; 168 | const event_wait_list: PPcl_event; 169 | event: PPcl_event 170 | ): Tcl_int; 171 | {$IFDEF CDECL}cdecl{$ELSE}stdcall{$ENDIF}; 172 | {$ENDIF} 173 | 174 | {$IFDEF CL_VERSION_1_0} 175 | type 176 | 177 | TclEnqueueReleaseD3D10ObjectsKHR_fn = function( 178 | command_queue: Pcl_command_queue; 179 | num_objects: Tcl_uint; 180 | mem_objects: PPcl_mem; 181 | num_events_in_wait_list: Tcl_uint; 182 | const event_wait_list: PPcl_event; 183 | event: PPcl_event 184 | ): Tcl_int;{$IFDEF CDECL}cdecl{$ELSE}stdcall{$ENDIF}; 185 | {$ENDIF} 186 | 187 | 188 | const 189 | 190 | CL_D3D10_DEVICE = $1070; 191 | 192 | {$IFDEF CL_VERSION_1_0} 193 | type 194 | 195 | TclCreateFromD3D10Buffer = function ( 196 | context: Pcl_context; (* context *) 197 | flags: Tcl_mem_flags; (* flags *) 198 | pD3DResource: PID3D10Resource; (* pD3DResource *) //ID3D10Resource * 199 | errcode_ret: PInteger (* errcode_ret *) 200 | ) : Tcl_mem; 201 | {$IFDEF CDECL}cdecl{$ELSE}stdcall{$ENDIF}; 202 | {$ENDIF} 203 | 204 | {$IFDEF CL_VERSION_1_0} 205 | TclCreateImageFromD3D10Resource = function (context: Pcl_context; (* context *) 206 | flags: Tcl_mem_flags; (* flags *) 207 | pD3DResource: PID3D10Resource; (* pD3DResource *) //ID3D10Resource * 208 | errcode_ret: PInteger (* errcode_ret *) 209 | ) : Tcl_mem; 210 | {$IFDEF CDECL}cdecl{$ELSE}stdcall{$ENDIF}; 211 | {$ENDIF} 212 | 213 | {$IFDEF CL_VERSION_1_0} 214 | var 215 | clGetDeviceIDsFromD3D10KHR_fn: TclGetDeviceIDsFromD3D10KHR_fn; 216 | clCreateFromD3D10BufferKHR_fn: TclCreateFromD3D10BufferKHR_fn; 217 | clCreateFromD3D10Texture2DKHR_fn: TclCreateFromD3D10Texture2DKHR_fn; 218 | clCreateFromD3D10Texture3DKHR_fn: TclCreateFromD3D10Texture3DKHR_fn; 219 | clEnqueueAcquireD3D10ObjectsKHR_fn: TclEnqueueAcquireD3D10ObjectsKHR_fn; 220 | clEnqueueReleaseD3D10ObjectsKHR_fn: TclEnqueueReleaseD3D10ObjectsKHR_fn; 221 | 222 | clCreateFromD3D10Buffer: TclCreateFromD3D10Buffer; 223 | clCreateImageFromD3D10Resource: TclCreateImageFromD3D10Resource; 224 | {$ENDIF} 225 | 226 | function InitCL_D3D10: Boolean; 227 | 228 | implementation 229 | 230 | function InitCL_D3D10: Boolean; 231 | begin 232 | Result := False; 233 | if OCL_LibHandle <> nil then begin 234 | {$IFDEF CL_VERSION_1_0} 235 | clGetDeviceIDsFromD3D10KHR_fn := TclGetDeviceIDsFromD3D10KHR_fn(oclGetProcAddress('clGetDeviceIDsFromD3D10KHR_fn', OCL_LibHandle)); 236 | clCreateFromD3D10BufferKHR_fn := TclCreateFromD3D10BufferKHR_fn(oclGetProcAddress('clCreateFromD3D10BufferKHR_fn', OCL_LibHandle)); 237 | clCreateFromD3D10Texture2DKHR_fn := TclCreateFromD3D10Texture2DKHR_fn(oclGetProcAddress('clCreateFromD3D10Texture2DKHR_fn', OCL_LibHandle)); 238 | clCreateFromD3D10Texture3DKHR_fn := TclCreateFromD3D10Texture3DKHR_fn(oclGetProcAddress('clCreateFromD3D10Texture3DKHR_fn', OCL_LibHandle)); 239 | clEnqueueAcquireD3D10ObjectsKHR_fn := TclEnqueueAcquireD3D10ObjectsKHR_fn(oclGetProcAddress('clEnqueueAcquireD3D10ObjectsKHR_fn', OCL_LibHandle)); 240 | clEnqueueReleaseD3D10ObjectsKHR_fn := TclEnqueueReleaseD3D10ObjectsKHR_fn(oclGetProcAddress('clEnqueueReleaseD3D10ObjectsKHR_fn', OCL_LibHandle)); 241 | 242 | clCreateFromD3D10Buffer := TclCreateFromD3D10Buffer(oclGetProcAddress('clCreateFromD3D10Buffer', OCL_LibHandle)); 243 | clCreateImageFromD3D10Resource := TclCreateImageFromD3D10Resource(oclGetProcAddress('clCreateImageFromD3D10Resource', OCL_LibHandle)); 244 | {$ENDIF} 245 | Result := True; 246 | end; 247 | end; 248 | 249 | end. -------------------------------------------------------------------------------- /Source/CL_GL.pas: -------------------------------------------------------------------------------- 1 | (****************************************************************************** 2 | * Copyright (c) 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 | (* headers versions: 0.07 *) 28 | (* file name : CL_GL.pas *) 29 | (* last modify : 10.12.11 *) 30 | (* license : BSD *) 31 | (* *) 32 | (* created by : Maksym Tymkovych (niello) *) 33 | (* Site : www.niello.org.ua *) 34 | (* e-mail : muxamed13@ukr.net *) 35 | (* ICQ : 446-769-253 *) 36 | (* *) 37 | (* updated by : Alexander Kiselev (Igroman) *) 38 | (* Site : http://Igroman14.livejournal.com *) 39 | (* e-mail : Igroman14@yandex.ru *) 40 | (* ICQ : 207-381-695 *) 41 | (* (c) 2010 *) 42 | (* *) 43 | (********************** Copyright (c) niello 2008-2011 ******************) 44 | 45 | (* 46 | * cl_gl.h contains Khronos-approved (KHR) OpenCL extensions which have 47 | * OpenGL dependencies. The application is responsible for #including 48 | * OpenGL or OpenGL ES headers before #including cl_gl.h. 49 | *) 50 | unit CL_GL; 51 | 52 | interface 53 | 54 | {$INCLUDE OpenCL.inc} 55 | 56 | uses 57 | dglOpenGL, 58 | CL, 59 | CL_Platform; 60 | 61 | type 62 | 63 | PCL_gl_object_type = ^TCL_gl_object_type; 64 | TCL_gl_object_type = TCL_uint; 65 | PCL_gl_texture_info = ^TCL_gl_texture_info; 66 | TCL_gl_texture_info = TCL_uint; 67 | PCL_gl_platform_info= ^TCL_gl_platform_info; 68 | TCL_gl_platform_info= TCL_uint; 69 | 70 | Tcl_GLsync = ^Integer; 71 | 72 | const 73 | (* cl_gl_object_type *) 74 | CL_GL_OBJECT_BUFFER = $2000; 75 | CL_GL_OBJECT_TEXTURE2D = $2001; 76 | CL_GL_OBJECT_TEXTURE3D = $2002; 77 | CL_GL_OBJECT_RENDERBUFFER = $2003; 78 | 79 | (* cl_gl_texture_info *) 80 | CL_GL_TEXTURE_TARGET = $2004; 81 | CL_GL_MIPMAP_LEVEL = $2005; 82 | 83 | (* Additional Error Codes *) 84 | (* 85 | Returned by clCreateContext, clCreateContextFromType, and 86 | clGetGLContextInfoKHR when an invalid OpenGL context or share group 87 | object handle is specified in : 88 | *) 89 | CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR = -1000; 90 | 91 | (* cl_gl_context_info *) 92 | (* 93 | Accepted as the argument of clGetGLContextInfoKHR: 94 | *) 95 | CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR = $2006; 96 | CL_DEVICES_FOR_GL_CONTEXT_KHR = $2007; 97 | 98 | (* Additional cl_context_properties *) 99 | (* 100 | Accepted as an attribute name in the 'properties' argument of 101 | clCreateContext and clCreateContextFromType: 102 | *) 103 | CL_GL_CONTEXT_KHR = $2008; 104 | CL_EGL_DISPLAY_KHR = $2009; 105 | CL_GLX_DISPLAY_KHR = $200A; 106 | CL_WGL_HDC_KHR = $200B; 107 | CL_CGL_SHAREGROUP_KHR = $200C; 108 | 109 | 110 | type 111 | {$IFDEF CL_VERSION_1_0} 112 | TclCreateFromGLBuffer = function ( 113 | context: Pcl_context; (* context *) 114 | flags: Tcl_mem_flags; (* flags *) 115 | bufobj: GLuint; (* bufobj *) 116 | errcode_ret: PInteger (* errcode_ret *) 117 | ): PCL_mem; 118 | {$IFDEF CDECL}cdecl{$ELSE}stdcall{$ENDIF}; 119 | {$ENDIF} 120 | 121 | {$IFDEF CL_VERSION_1_0} 122 | {$IFDEF CL_USE_DEPRECATED_OPENCL_1_1_APIS} 123 | TclCreateFromGLTexture2D = function ( 124 | context: Pcl_context; (* context *) 125 | flags: Tcl_mem_flags; (* flags *) 126 | target: GLenum; (* target *) 127 | miplevel: GLint; (* miplevel *) 128 | texture: GLuint; (* texture *) 129 | errcode_ret: Pcl_int (* errcode_ret *) 130 | ): PCL_mem; 131 | {$IFDEF CDECL}cdecl{$ELSE}stdcall{$ENDIF}; 132 | {$ENDIF} 133 | {$ENDIF} 134 | 135 | {$IFDEF CL_VERSION_1_0} 136 | {$IFDEF CL_USE_DEPRECATED_OPENCL_1_1_APIS} 137 | TclCreateFromGLTexture3D = function ( 138 | context: Pcl_context; (* context *) 139 | flags: Tcl_mem_flags; (* flags *) 140 | target: GLenum; (* target *) 141 | miplevel: GLint; (* miplevel *) 142 | texture: GLuint; (* texture *) 143 | errcode_ret: Pcl_int (* errcode_ret *) 144 | ): PCL_mem; 145 | {$IFDEF CDECL}cdecl{$ELSE}stdcall{$ENDIF}; 146 | {$ENDIF} 147 | {$ENDIF} 148 | 149 | {$IFDEF CL_VERSION_1_2} 150 | TclCreateFromGLTexture = function( 151 | context: Pcl_context; (* context *) 152 | flags: Tcl_mem_flags; (* flags *) 153 | target: GLenum; (* target *) 154 | miplevel: GLint; (* miplevel *) 155 | texture: GLuint; (* texture *) 156 | errcode_ret: Pcl_int (* errcode_ret *) 157 | ): PCL_mem; 158 | {$IFDEF CDECL}cdecl{$ELSE}stdcall{$ENDIF}; 159 | {$ENDIF} 160 | 161 | {$IFDEF CL_VERSION_1_0} 162 | TclCreateFromGLRenderbuffer = function ( 163 | context: Pcl_context; (* context *) 164 | flags: Tcl_mem_flags; (* flags *) 165 | renderbuffer: GLuint; (* renderbuffer *) 166 | errcode_ret: Pcl_int (* errcode_ret *) 167 | ): Pcl_mem; 168 | {$IFDEF CDECL}cdecl{$ELSE}stdcall{$ENDIF}; 169 | {$ENDIF} 170 | 171 | {$IFDEF CL_VERSION_1_0} 172 | TclGetGLObjectInfo = function ( 173 | memobj: Pcl_mem; (* memobj *) 174 | gl_object_type: Pcl_gl_object_type; (* gl_object_type *) 175 | gl_object_name: PGLuint (* gl_object_name *) 176 | ): TCL_int; 177 | {$IFDEF CDECL}cdecl{$ELSE}stdcall{$ENDIF}; 178 | {$ENDIF} 179 | 180 | {$IFDEF CL_VERSION_1_0} 181 | TclGetGLTextureInfo = function ( 182 | memobj: Pcl_mem; (* memobj *) 183 | param_name: Tcl_gl_texture_info; (* param_name *) 184 | param_value_size: Tsize_t; (* param_value_size *) 185 | param_value: Pointer; (* param_value *) 186 | param_value_size_ret: Psize_t (* param_value_size_ret *) 187 | ): TCL_int; 188 | {$IFDEF CDECL}cdecl{$ELSE}stdcall{$ENDIF}; 189 | {$ENDIF} 190 | 191 | {$IFDEF CL_VERSION_1_0} 192 | TclEnqueueAcquireGLObjects = function ( 193 | command_queue: Pcl_command_queue; (* command_queue *) 194 | num_objects: Tcl_uint; (* num_objects *) 195 | const mem_objects: PPcl_mem; (* mem_objects *) 196 | num_events_in_wait_list: Tcl_uint; (* num_events_in_wait_list *) 197 | const event_wait_list: PPcl_event; (* event_wait_list *) 198 | event: PPcl_event (* event *) 199 | ): TCL_int; 200 | {$IFDEF CDECL}cdecl{$ELSE}stdcall{$ENDIF}; 201 | {$ENDIF} 202 | 203 | {$IFDEF CL_VERSION_1_0} 204 | TclEnqueueReleaseGLObjects = function ( 205 | command_queue: Pcl_command_queue; (* command_queue *) 206 | num_objects: Tcl_uint; (* num_objects *) 207 | const mem_objects: PPcl_mem; (* mem_objects *) 208 | num_events_in_wait_list: Tcl_uint; (* num_events_in_wait_list *) 209 | const event_wait_list: PPcl_event; (* event_wait_list *) 210 | event: PPcl_event (* event *) 211 | ): TCL_int; 212 | {$IFDEF CDECL}cdecl{$ELSE}stdcall{$ENDIF}; 213 | {$ENDIF} 214 | type 215 | Pcl_gl_context_info = ^Tcl_gl_context_info; 216 | Tcl_gl_context_info = Tcl_uint; 217 | 218 | 219 | {$IFDEF CL_VERSION_1_0} 220 | TclGetGLContextInfoKHR = function ( 221 | const properties: Pcl_context_properties;(* properties *) 222 | param_name: Tcl_gl_context_info; (* param_name *) 223 | param_value_size: Tsize_t; (* param_value_size *) 224 | param_value: Pointer; (* param_value *) 225 | param_value_size_ret : Psize_t (* param_value_size_ret *) 226 | ): TCL_int; 227 | {$IFDEF CDECL}cdecl{$ELSE}stdcall{$ENDIF}; 228 | {$ENDIF} 229 | var 230 | {$IFDEF CL_VERSION_1_0} 231 | clCreateFromGLBuffer: TclCreateFromGLBuffer; 232 | {$IFDEF CL_USE_DEPRECATED_OPENCL_1_1_APIS} 233 | clCreateFromGLTexture2D: TclCreateFromGLTexture2D; 234 | clCreateFromGLTexture3D: TclCreateFromGLTexture3D; 235 | {$ENDIF} 236 | clCreateFromGLRenderbuffer: TclCreateFromGLRenderbuffer; 237 | clGetGLObjectInfo: TclGetGLObjectInfo; 238 | clGetGLTextureInfo: TclGetGLTextureInfo; 239 | clEnqueueAcquireGLObjects: TclEnqueueAcquireGLObjects; 240 | clEnqueueReleaseGLObjects: TclEnqueueReleaseGLObjects; 241 | clGetGLContextInfoKHR: TclGetGLContextInfoKHR; 242 | {$ENDIF} 243 | 244 | {$IFDEF CL_VERSION_1_2} 245 | clCreateFromGLTexture: TclCreateFromGLTexture; 246 | {$ENDIF} 247 | 248 | function InitCL_GL: Boolean; 249 | 250 | implementation 251 | 252 | function InitCL_GL: Boolean; 253 | begin 254 | Result := False; 255 | if OCL_LibHandle <> nil then 256 | begin 257 | {$IFDEF CL_VERSION_1_0} 258 | clCreateFromGLBuffer := TclCreateFromGLBuffer(oclGetProcAddress('clCreateFromGLBuffer', OCL_LibHandle)); 259 | {$IFDEF CL_USE_DEPRECATED_OPENCL_1_1_APIS} 260 | clCreateFromGLTexture2D := TclCreateFromGLTexture2D(oclGetProcAddress('clCreateFromGLTexture2D', OCL_LibHandle)); 261 | clCreateFromGLTexture3D := TclCreateFromGLTexture3D(oclGetProcAddress('clCreateFromGLTexture3D', OCL_LibHandle)); 262 | {$ENDIF} 263 | clCreateFromGLRenderbuffer := TclCreateFromGLRenderbuffer(oclGetProcAddress('clCreateFromGLRenderbuffer', OCL_LibHandle)); 264 | clGetGLObjectInfo := TclGetGLObjectInfo(oclGetProcAddress('clGetGLObjectInfo', OCL_LibHandle)); 265 | clGetGLTextureInfo := TclGetGLTextureInfo(oclGetProcAddress('clGetGLTextureInfo', OCL_LibHandle)); 266 | clEnqueueAcquireGLObjects := TclEnqueueAcquireGLObjects(oclGetProcAddress('clEnqueueAcquireGLObjects', OCL_LibHandle)); 267 | clEnqueueReleaseGLObjects := TclEnqueueReleaseGLObjects(oclGetProcAddress('clEnqueueReleaseGLObjects', OCL_LibHandle)); 268 | clGetGLContextInfoKHR := TclGetGLContextInfoKHR(clGetExtensionFunctionAddress('clGetGLContextInfoKHR')); 269 | {$ENDIF} 270 | {$IFDEF CL_VERSION_1_2} 271 | clCreateFromGLTexture := TclCreateFromGLTexture(oclGetProcAddress('clCreateFromGLTexture', OCL_LibHandle)); 272 | {$ENDIF} 273 | Result := True; 274 | end; 275 | end; 276 | 277 | end. 278 | -------------------------------------------------------------------------------- /Examples/Example3/Example3.dproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | True 4 | Console 5 | Debug 6 | DCC32 7 | None 8 | Example3.dpr 9 | Win32 10 | {487298FA-8AF3-4E37-B4FA-F4848BC429E5} 11 | 18.3 12 | 3 13 | 14 | 15 | true 16 | Base 17 | true 18 | 19 | 20 | true 21 | Base 22 | true 23 | 24 | 25 | true 26 | Base 27 | true 28 | 29 | 30 | true 31 | Base 32 | true 33 | 34 | 35 | true 36 | 37 | 38 | true 39 | Base 40 | true 41 | 42 | 43 | true 44 | Base 45 | true 46 | 47 | 48 | true 49 | Base 50 | true 51 | 52 | 53 | true 54 | Base 55 | true 56 | 57 | 58 | true 59 | Cfg_2 60 | true 61 | true 62 | 63 | 64 | $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_152x152.png 65 | $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_76x76.png 66 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_1024x768.png 67 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_1536x2048.png 68 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2048x1536.png 69 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_768x1024.png 70 | $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_40x40.png 71 | $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_80x80.png 72 | $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_120x120.png 73 | $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_60x60.png 74 | $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_40x40.png 75 | $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_80x80.png 76 | 77 | 78 | $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_152x152.png 79 | $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_76x76.png 80 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_1024x768.png 81 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_1536x2048.png 82 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2048x1536.png 83 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_768x1024.png 84 | $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_40x40.png 85 | $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_80x80.png 86 | $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_120x120.png 87 | $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_60x60.png 88 | $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_40x40.png 89 | $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_80x80.png 90 | 91 | 92 | $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_152x152.png 93 | $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_76x76.png 94 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_1024x768.png 95 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_1536x2048.png 96 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2048x1536.png 97 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_768x1024.png 98 | $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_40x40.png 99 | $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_80x80.png 100 | $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_120x120.png 101 | $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_60x60.png 102 | $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_40x40.png 103 | $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_80x80.png 104 | 105 | 106 | true 107 | true 108 | true 109 | true 110 | true 111 | true 112 | true 113 | true 114 | true 115 | true 116 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_144x144.png 117 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_36x36.png 118 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_48x48.png 119 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_72x72.png 120 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_96x96.png 121 | $(BDS)\bin\Artwork\Android\FM_SplashImage_426x320.png 122 | $(BDS)\bin\Artwork\Android\FM_SplashImage_470x320.png 123 | $(BDS)\bin\Artwork\Android\FM_SplashImage_640x480.png 124 | $(BDS)\bin\Artwork\Android\FM_SplashImage_960x720.png 125 | 126 | 127 | Example3 128 | ..\..\DCU\$(PLATFORM) 129 | Example3.exe 130 | false 131 | ..\..\Binaries\$(PLATFORM) 132 | false 133 | 00400000 134 | false 135 | true 136 | System;Xml;Data;Datasnap;Web;Soap;Vcl;$(DCC_Namespace) 137 | x86 138 | false 139 | 1 140 | ..\..\Source;$(DCC_UnitSearchPath) 141 | vcl;rtl;dbrtl;adortl;vcldb;vclx;bdertl;ibxpress;dsnap;cds;bdecds;qrpt;teeui;teedb;tee;vcldbx;dss;teeqr;visualclx;visualdbclx;dsnapcrba;dsnapcon;VclSmp;vclshlctrls;vclie;xmlrtl;inet;inetdbbde;inetdbxpress;inetdb;nmfast;webdsnap;websnap;dbexpress;dbxcds;indy;dclOffice2k;ADOX;$(DCC_UsePackage) 142 | $(BDS)\bin\delphi_PROJECTICNS.icns 143 | $(BDS)\bin\delphi_PROJECTICON.ico 144 | None 145 | CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= 146 | 1058 147 | 148 | 149 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) 150 | 1033 151 | 152 | 153 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) 154 | 1033 155 | 156 | 157 | 0 158 | RELEASE;$(DCC_Define) 159 | false 160 | 0 161 | 162 | 163 | DEBUG;$(DCC_Define) 164 | 165 | 166 | 1033 167 | 168 | 169 | 170 | MainSource 171 | 172 | 173 | 174 | 175 | 176 | 177 | Base 178 | 179 | 180 | Cfg_1 181 | Base 182 | 183 | 184 | Cfg_2 185 | Base 186 | 187 | 188 | 189 | 190 | Delphi.Personality.12 191 | VCLApplication 192 | 193 | 194 | 195 | Example3.dpr 196 | 197 | 198 | False 199 | True 200 | False 201 | 202 | 203 | False 204 | False 205 | 1 206 | 0 207 | 0 208 | 0 209 | False 210 | False 211 | False 212 | False 213 | False 214 | 1058 215 | 1251 216 | 217 | 218 | 219 | 220 | 1.0.0.0 221 | 222 | 223 | 224 | 225 | 226 | 1.0.0.0 227 | 228 | 229 | 230 | Microsoft Office 2000 Beispiele für gekapselte Komponenten für Automatisierungsserver 231 | Microsoft Office XP Beispiele für gekapselte Komponenten für Automation Server 232 | 233 | 234 | 235 | False 236 | False 237 | False 238 | True 239 | True 240 | False 241 | False 242 | False 243 | 244 | 245 | 12 246 | 247 | 248 | 249 | -------------------------------------------------------------------------------- /Examples/Example2/Example2.dproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | True 4 | Console 5 | Debug 6 | DCC32 7 | None 8 | Example2.dpr 9 | Win32 10 | {3446EA75-884A-4B3D-80A0-2557E97284BF} 11 | 18.3 12 | 3 13 | 14 | 15 | true 16 | Base 17 | true 18 | 19 | 20 | true 21 | Base 22 | true 23 | 24 | 25 | true 26 | Base 27 | true 28 | 29 | 30 | true 31 | Base 32 | true 33 | 34 | 35 | true 36 | 37 | 38 | true 39 | Base 40 | true 41 | 42 | 43 | true 44 | Base 45 | true 46 | 47 | 48 | true 49 | Base 50 | true 51 | 52 | 53 | true 54 | Cfg_1 55 | true 56 | true 57 | 58 | 59 | true 60 | Base 61 | true 62 | 63 | 64 | true 65 | Cfg_2 66 | true 67 | true 68 | 69 | 70 | $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_152x152.png 71 | $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_76x76.png 72 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_1024x768.png 73 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_1536x2048.png 74 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2048x1536.png 75 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_768x1024.png 76 | $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_40x40.png 77 | $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_80x80.png 78 | $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_120x120.png 79 | $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_60x60.png 80 | $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_40x40.png 81 | $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_80x80.png 82 | 83 | 84 | $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_152x152.png 85 | $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_76x76.png 86 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_1024x768.png 87 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_1536x2048.png 88 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2048x1536.png 89 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_768x1024.png 90 | $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_40x40.png 91 | $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_80x80.png 92 | $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_120x120.png 93 | $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_60x60.png 94 | $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_40x40.png 95 | $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_80x80.png 96 | 97 | 98 | $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_152x152.png 99 | $(BDS)\bin\Artwork\iOS\iPad\FM_ApplicationIcon_76x76.png 100 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_1024x768.png 101 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_1536x2048.png 102 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_2048x1536.png 103 | $(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImagePortrait_768x1024.png 104 | $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_40x40.png 105 | $(BDS)\bin\Artwork\iOS\iPad\FM_SpotlightSearchIcon_80x80.png 106 | $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_120x120.png 107 | $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_60x60.png 108 | $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_40x40.png 109 | $(BDS)\bin\Artwork\iOS\iPhone\FM_SpotlightSearchIcon_80x80.png 110 | 111 | 112 | true 113 | true 114 | true 115 | true 116 | true 117 | true 118 | true 119 | true 120 | true 121 | true 122 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_144x144.png 123 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_36x36.png 124 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_48x48.png 125 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_72x72.png 126 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_96x96.png 127 | $(BDS)\bin\Artwork\Android\FM_SplashImage_426x320.png 128 | $(BDS)\bin\Artwork\Android\FM_SplashImage_470x320.png 129 | $(BDS)\bin\Artwork\Android\FM_SplashImage_640x480.png 130 | $(BDS)\bin\Artwork\Android\FM_SplashImage_960x720.png 131 | 132 | 133 | Example2 134 | ..\..\DCU\$(PLATFORM) 135 | Example2.exe 136 | false 137 | ..\..\Binaries\$(PLATFORM) 138 | false 139 | 00400000 140 | false 141 | true 142 | System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) 143 | x86 144 | false 145 | 1 146 | ..\..\Source;$(DCC_UnitSearchPath) 147 | vcl;rtl;dbrtl;adortl;vcldb;vclx;bdertl;ibxpress;dsnap;cds;bdecds;qrpt;teeui;teedb;tee;vcldbx;dss;teeqr;visualclx;visualdbclx;dsnapcrba;dsnapcon;VclSmp;vclshlctrls;vclie;xmlrtl;inet;inetdbbde;inetdbxpress;inetdb;nmfast;webdsnap;websnap;dbexpress;dbxcds;indy;dclOffice2k;ADOX;$(DCC_UsePackage) 148 | $(BDS)\bin\delphi_PROJECTICNS.icns 149 | $(BDS)\bin\delphi_PROJECTICON.ico 150 | None 151 | CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= 152 | 1058 153 | 154 | 155 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) 156 | 1033 157 | 158 | 159 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) 160 | 1033 161 | 162 | 163 | 0 164 | RELEASE;$(DCC_Define) 165 | false 166 | 0 167 | 168 | 169 | None 170 | 1033 171 | 172 | 173 | DEBUG;$(DCC_Define) 174 | 175 | 176 | 1033 177 | 178 | 179 | 180 | MainSource 181 | 182 | 183 | 184 | 185 | 186 | 187 | Base 188 | 189 | 190 | Cfg_1 191 | Base 192 | 193 | 194 | Cfg_2 195 | Base 196 | 197 | 198 | 199 | 200 | Delphi.Personality.12 201 | VCLApplication 202 | 203 | 204 | 205 | Example2.dpr 206 | 207 | 208 | False 209 | True 210 | False 211 | 212 | 213 | False 214 | False 215 | 1 216 | 0 217 | 0 218 | 0 219 | False 220 | False 221 | False 222 | False 223 | False 224 | 1058 225 | 1251 226 | 227 | 228 | 229 | 230 | 1.0.0.0 231 | 232 | 233 | 234 | 235 | 236 | 1.0.0.0 237 | 238 | 239 | 240 | Microsoft Office 2000 Beispiele für gekapselte Komponenten für Automatisierungsserver 241 | Microsoft Office XP Beispiele für gekapselte Komponenten für Automation Server 242 | 243 | 244 | 245 | False 246 | False 247 | False 248 | True 249 | True 250 | False 251 | False 252 | False 253 | 254 | 255 | 12 256 | 257 | 258 | 259 | --------------------------------------------------------------------------------