OptiX  3.9
NVIDIA OptiX Acceleration Engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
optix_gl_interop.h
Go to the documentation of this file.
1 
2 /*
3  * Copyright (c) 2008 - 2010 NVIDIA Corporation. All rights reserved.
4  *
5  * NVIDIA Corporation and its licensors retain all intellectual property and proprietary
6  * rights in and to this software, related documentation and any modifications thereto.
7  * Any use, reproduction, disclosure or distribution of this software and related
8  * documentation without an express license agreement from NVIDIA Corporation is strictly
9  * prohibited.
10  *
11  * TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED *AS IS*
12  * AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED,
13  * INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
14  * PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY
15  * SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT
16  * LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF
17  * BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
18  * INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF
19  * SUCH DAMAGES
20  */
21 
30 #ifndef __optix_optix_gl_interop_h__
31 #define __optix_optix_gl_interop_h__
32 
33 #include "optix.h"
34 
35 /************************************
36  **
37  ** OpenGL Interop functions
38  **
39  ***********************************/
40 
41 /*
42 
43 On Windows you will need to include windows.h before this file:
44 
45 #ifdef _WIN32
46 # ifndef WIN32_LEAN_AND_MEAN
47 # define WIN32_LEAN_AND_MEAN
48 # endif
49 # include<windows.h>
50 #endif
51 #include <optix_gl_interop.h>
52 
53 */
54 
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58 
115  RTresult RTAPI rtBufferCreateFromGLBO ( RTcontext context, unsigned int bufferdesc, unsigned int glId, RTbuffer* buffer );
116 
204  RTresult RTAPI rtTextureSamplerCreateFromGLImage( RTcontext context, unsigned int glId, RTgltarget target, RTtexturesampler* textureSampler );
205 
236  RTresult RTAPI rtBufferGetGLBOId ( RTbuffer buffer, unsigned int* glId );
237 
268  RTresult RTAPI rtTextureSamplerGetGLImageId ( RTtexturesampler textureSampler, unsigned int* glId );
269 
304  RTresult RTAPI rtBufferGLRegister ( RTbuffer buffer );
305 
337  RTresult RTAPI rtBufferGLUnregister ( RTbuffer buffer );
338 
371  RTresult RTAPI rtTextureSamplerGLRegister ( RTtexturesampler textureSampler );
372 
404  RTresult RTAPI rtTextureSamplerGLUnregister ( RTtexturesampler textureSampler );
405 
406 
407 #if defined(_WIN32)
408 #if !defined(WGL_NV_gpu_affinity)
409  typedef void* HGPUNV;
410 #endif
411 
441  RTresult RTAPI rtDeviceGetWGLDevice(int* device, HGPUNV gpu);
442 #endif
443 
444 #ifdef __cplusplus
445 }
446 #endif
447 
448 #endif /* __optix_optix_gl_interop_h__ */
RTresult
Definition: optix_declarations.h:236
RTresult RTAPI rtBufferGLRegister(RTbuffer buffer)
Declares an OpenGL buffer as immutable and accessible by OptiX.
RTresult RTAPI rtTextureSamplerGLUnregister(RTtexturesampler textureSampler)
Declares an OpenGL texture as mutable and inaccessible by OptiX.
RTresult RTAPI rtBufferGLUnregister(RTbuffer buffer)
Declares an OpenGL buffer as mutable and inaccessible by OptiX.
RTgltarget
Definition: optix_declarations.h:172
struct RTtexturesampler_api * RTtexturesampler
Definition: optix_host.h:96
struct RTbuffer_api * RTbuffer
Definition: optix_host.h:69
RTresult RTAPI rtTextureSamplerGetGLImageId(RTtexturesampler textureSampler, unsigned int *glId)
Gets the OpenGL image object id associated with this texture sampler.
RTresult RTAPI rtBufferGetGLBOId(RTbuffer buffer, unsigned int *glId)
Gets the OpenGL Buffer Object ID associated with this buffer.
RTresult RTAPI rtTextureSamplerCreateFromGLImage(RTcontext context, unsigned int glId, RTgltarget target, RTtexturesampler *textureSampler)
Creates a new texture sampler object from an OpenGL image.
RTresult RTAPI rtTextureSamplerGLRegister(RTtexturesampler textureSampler)
Declares an OpenGL texture as immutable and accessible by OptiX.
RTresult RTAPI rtBufferCreateFromGLBO(RTcontext context, unsigned int bufferdesc, unsigned int glId, RTbuffer *buffer)
Creates a new buffer object from an OpenGL buffer object.
struct RTcontext_api * RTcontext
Definition: optix_host.h:72
OptiX public API header.
RTresult RTAPI rtDeviceGetWGLDevice(int *device, HGPUNV gpu)
returns the OptiX device number associated with the specified GPU