Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-09 07:49:38

0001 #pragma once
0002 
0003 #include "SOPTIX.h"
0004 #include "SGLFW_CUDA.h"
0005 
0006 struct SGLFW_SOPTIX
0007 {
0008     SGLFW& gl ;
0009     SGLM& gm ;
0010 
0011     SOPTIX ox ;
0012     SGLFW_CUDA interop ; // interop buffer display coordination
0013 
0014     SGLFW_SOPTIX( SGLFW& gl );
0015     void render();
0016 };
0017 
0018 inline SGLFW_SOPTIX::SGLFW_SOPTIX( SGLFW& _gl )
0019     :
0020     gl(_gl),
0021     gm(gl.gm),
0022     ox(gm),
0023     interop(gm)
0024 {
0025 }
0026 
0027 
0028 /**
0029 SGLFW_SOPTIX::render
0030 -----------------------
0031 
0032 1. mapping the interop buffer gives CUDA access into the OpenGL buffer via d_pixels
0033 2. SOPTIX::render into d_pixels
0034 3. unmap the interop buffer returning baton back to OpenGL
0035 4. OpenGL display into the window
0036 
0037 **/
0038 
0039 inline void SGLFW_SOPTIX::render()
0040 {
0041     uchar4* d_pixels = interop.output_buffer->map() ;
0042     ox.render(d_pixels);
0043     interop.output_buffer->unmap() ;
0044     interop.displayOutputBuffer(gl.window);
0045 }
0046 
0047 
0048 
0049 
0050