Bullet Collision Detection & Physics Library
cl_gl.h
Go to the documentation of this file.
1 /**********************************************************************************
2  * Copyright (c) 2008-2009 The Khronos Group Inc.
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and/or associated documentation files (the
6  * "Materials"), to deal in the Materials without restriction, including
7  * without limitation the rights to use, copy, modify, merge, publish,
8  * distribute, sublicense, and/or sell copies of the Materials, and to
9  * permit persons to whom the Materials are furnished to do so, subject to
10  * the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included
13  * in all copies or substantial portions of the Materials.
14  *
15  * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21  * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
22  **********************************************************************************/
23 
24 #ifndef __OPENCL_CL_GL_H
25 #define __OPENCL_CL_GL_H
26 
27 #ifdef __APPLE__
28 #include <OpenCL/cl_platform.h>
29 #else
30 #include <MiniCL/cl_platform.h>
31 #endif
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 // NOTE: Make sure that appropriate GL header file is included separately
38 
42 
43 // cl_gl_object_type
44 #define CL_GL_OBJECT_BUFFER 0x2000
45 #define CL_GL_OBJECT_TEXTURE2D 0x2001
46 #define CL_GL_OBJECT_TEXTURE3D 0x2002
47 #define CL_GL_OBJECT_RENDERBUFFER 0x2003
48 
49 // cl_gl_texture_info
50 #define CL_GL_TEXTURE_TARGET 0x2004
51 #define CL_GL_MIPMAP_LEVEL 0x2005
52 
54 clCreateFromGLBuffer(cl_context /* context */,
55  cl_mem_flags /* flags */,
56  GLuint /* bufobj */,
57  int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
58 
61  cl_mem_flags /* flags */,
62  GLenum /* target */,
63  GLint /* miplevel */,
64  GLuint /* texture */,
65  cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
66 
68 clCreateFromGLTexture3D(cl_context /* context */,
69  cl_mem_flags /* flags */,
70  GLenum /* target */,
71  GLint /* miplevel */,
72  GLuint /* texture */,
73  cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
74 
76 clCreateFromGLRenderbuffer(cl_context /* context */,
77  cl_mem_flags /* flags */,
78  GLuint /* renderbuffer */,
79  cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0;
80 
82 clGetGLObjectInfo(cl_mem /* memobj */,
83  cl_gl_object_type * /* gl_object_type */,
84  GLuint * /* gl_object_name */) CL_API_SUFFIX__VERSION_1_0;
85 
87 clGetGLTextureInfo(cl_mem /* memobj */,
88  cl_gl_texture_info /* param_name */,
89  size_t /* param_value_size */,
90  void * /* param_value */,
91  size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0;
92 
95  cl_uint /* num_objects */,
96  const cl_mem * /* mem_objects */,
97  cl_uint /* num_events_in_wait_list */,
98  const cl_event * /* event_wait_list */,
99  cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
100 
102 clEnqueueReleaseGLObjects(cl_command_queue /* command_queue */,
103  cl_uint /* num_objects */,
104  const cl_mem * /* mem_objects */,
105  cl_uint /* num_events_in_wait_list */,
106  const cl_event * /* event_wait_list */,
107  cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0;
108 
109 #ifdef __cplusplus
110 }
111 #endif
112 
113 #endif // __OPENCL_CL_GL_H
uint32_t cl_uint
Definition: cl_platform.h:71
cl_uint cl_gl_texture_info
Definition: cl_gl.h:40
struct _cl_context * cl_context
Definition: cl.h:41
CL_API_ENTRY cl_mem CL_API_CALL clCreateFromGLTexture3D(cl_context, cl_mem_flags, GLenum, GLint, GLuint, cl_int *) CL_API_SUFFIX__VERSION_1_0
cl_uint cl_gl_platform_info
Definition: cl_gl.h:41
CL_API_ENTRY cl_int CL_API_CALL clGetGLObjectInfo(cl_mem, cl_gl_object_type *, GLuint *) CL_API_SUFFIX__VERSION_1_0
int32_t cl_int
Definition: cl_platform.h:70
CL_API_ENTRY cl_int CL_API_CALL clGetGLTextureInfo(cl_mem, cl_gl_texture_info, size_t, void *, size_t *) CL_API_SUFFIX__VERSION_1_0
#define CL_API_ENTRY
Definition: cl_platform.h:46
CL_API_ENTRY cl_mem CL_API_CALL clCreateFromGLTexture2D(cl_context, cl_mem_flags, GLenum, GLint, GLuint, cl_int *) CL_API_SUFFIX__VERSION_1_0
CL_API_ENTRY cl_int CL_API_CALL clEnqueueReleaseGLObjects(cl_command_queue, cl_uint, const cl_mem *, cl_uint, const cl_event *, cl_event *) CL_API_SUFFIX__VERSION_1_0
struct _cl_mem * cl_mem
Definition: cl.h:43
CL_API_ENTRY cl_mem CL_API_CALL clCreateFromGLBuffer(cl_context, cl_mem_flags, GLuint, int *) CL_API_SUFFIX__VERSION_1_0
struct _cl_event * cl_event
Definition: cl.h:46
struct _cl_command_queue * cl_command_queue
Definition: cl.h:42
CL_API_ENTRY cl_int CL_API_CALL clEnqueueAcquireGLObjects(cl_command_queue, cl_uint, const cl_mem *, cl_uint, const cl_event *, cl_event *) CL_API_SUFFIX__VERSION_1_0
#define CL_API_SUFFIX__VERSION_1_0
Definition: cl_platform.h:52
CL_API_ENTRY cl_mem CL_API_CALL clCreateFromGLRenderbuffer(cl_context, cl_mem_flags, GLuint, cl_int *) CL_API_SUFFIX__VERSION_1_0
#define CL_API_CALL
Definition: cl_platform.h:47
cl_uint cl_gl_object_type
Definition: cl_gl.h:39
cl_bitfield cl_mem_flags
Definition: cl.h:66