MCPcopy Create free account
hub / github.com/NVIDIA/cuda-samples / initGLBuffers

Function initGLBuffers

cpp/0_Introduction/simpleTexture3D/simpleTexture3D.cpp:249–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

247}
248
249void initGLBuffers()
250{
251 // create pixel buffer object
252 glGenBuffers(1, &pbo);
253 glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, pbo);
254 glBufferData(GL_PIXEL_UNPACK_BUFFER_ARB, width * height * sizeof(GLubyte) * 4, 0, GL_STREAM_DRAW_ARB);
255 glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, 0);
256
257 // register this buffer object with CUDA
258 checkCudaErrors(cudaGraphicsGLRegisterBuffer(&cuda_pbo_resource, pbo, cudaGraphicsMapFlagsWriteDiscard));
259}
260
261// Load raw data from disk
262uchar *loadRawFile(const char *filename, size_t size)

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected