cl_gl.h

Go to the documentation of this file.
00001 /**********************************************************************************
00002  * Copyright (c) 2008-2009 The Khronos Group Inc.
00003  *
00004  * Permission is hereby granted, free of charge, to any person obtaining a
00005  * copy of this software and/or associated documentation files (the
00006  * "Materials"), to deal in the Materials without restriction, including
00007  * without limitation the rights to use, copy, modify, merge, publish,
00008  * distribute, sublicense, and/or sell copies of the Materials, and to
00009  * permit persons to whom the Materials are furnished to do so, subject to
00010  * the following conditions:
00011  *
00012  * The above copyright notice and this permission notice shall be included
00013  * in all copies or substantial portions of the Materials.
00014  *
00015  * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00016  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00017  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00018  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
00019  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
00020  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
00021  * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
00022  **********************************************************************************/
00023 
00024 #ifndef __OPENCL_CL_GL_H
00025 #define __OPENCL_CL_GL_H
00026 
00027 #ifdef __APPLE__
00028 #include <OpenCL/cl_platform.h>
00029 #else
00030 #include <MiniCL/cl_platform.h>
00031 #endif  
00032 
00033 #ifdef __cplusplus
00034 extern "C" {
00035 #endif
00036 
00037 // NOTE:  Make sure that appropriate GL header file is included separately
00038 
00039 typedef cl_uint     cl_gl_object_type;
00040 typedef cl_uint     cl_gl_texture_info;
00041 typedef cl_uint     cl_gl_platform_info;
00042 
00043 // cl_gl_object_type
00044 #define CL_GL_OBJECT_BUFFER             0x2000
00045 #define CL_GL_OBJECT_TEXTURE2D          0x2001
00046 #define CL_GL_OBJECT_TEXTURE3D          0x2002
00047 #define CL_GL_OBJECT_RENDERBUFFER       0x2003
00048 
00049 // cl_gl_texture_info
00050 #define CL_GL_TEXTURE_TARGET            0x2004
00051 #define CL_GL_MIPMAP_LEVEL              0x2005
00052 
00053 extern CL_API_ENTRY cl_mem CL_API_CALL
00054 clCreateFromGLBuffer(cl_context     /* context */,
00055                      cl_mem_flags   /* flags */,
00056                      GLuint         /* bufobj */,
00057                      int *          /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
00058 
00059 extern CL_API_ENTRY cl_mem CL_API_CALL
00060 clCreateFromGLTexture2D(cl_context      /* context */,
00061                         cl_mem_flags    /* flags */,
00062                         GLenum          /* target */,
00063                         GLint           /* miplevel */,
00064                         GLuint          /* texture */,
00065                         cl_int *        /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
00066 
00067 extern CL_API_ENTRY cl_mem CL_API_CALL
00068 clCreateFromGLTexture3D(cl_context      /* context */,
00069                         cl_mem_flags    /* flags */,
00070                         GLenum          /* target */,
00071                         GLint           /* miplevel */,
00072                         GLuint          /* texture */,
00073                         cl_int *        /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
00074 
00075 extern CL_API_ENTRY cl_mem CL_API_CALL
00076 clCreateFromGLRenderbuffer(cl_context   /* context */,
00077                            cl_mem_flags /* flags */,
00078                            GLuint       /* renderbuffer */,
00079                            cl_int *     /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
00080 
00081 extern CL_API_ENTRY cl_int CL_API_CALL
00082 clGetGLObjectInfo(cl_mem                /* memobj */,
00083                   cl_gl_object_type *   /* gl_object_type */,
00084                   GLuint *              /* gl_object_name */) CL_API_SUFFIX__VERSION_1_0;
00085                   
00086 extern CL_API_ENTRY cl_int CL_API_CALL
00087 clGetGLTextureInfo(cl_mem               /* memobj */,
00088                    cl_gl_texture_info   /* param_name */,
00089                    size_t               /* param_value_size */,
00090                    void *               /* param_value */,
00091                    size_t *             /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
00092 
00093 extern CL_API_ENTRY cl_int CL_API_CALL
00094 clEnqueueAcquireGLObjects(cl_command_queue      /* command_queue */,
00095                           cl_uint               /* num_objects */,
00096                           const cl_mem *        /* mem_objects */,
00097                           cl_uint               /* num_events_in_wait_list */,
00098                           const cl_event *      /* event_wait_list */,
00099                           cl_event *            /* event */) CL_API_SUFFIX__VERSION_1_0;
00100 
00101 extern CL_API_ENTRY cl_int CL_API_CALL
00102 clEnqueueReleaseGLObjects(cl_command_queue      /* command_queue */,
00103                           cl_uint               /* num_objects */,
00104                           const cl_mem *        /* mem_objects */,
00105                           cl_uint               /* num_events_in_wait_list */,
00106                           const cl_event *      /* event_wait_list */,
00107                           cl_event *            /* event */) CL_API_SUFFIX__VERSION_1_0;
00108 
00109 #ifdef __cplusplus
00110 }
00111 #endif
00112 
00113 #endif  // __OPENCL_CL_GL_H