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

Method createTexture

cpp/5_Domain_Specific/smokeParticles/SmokeRenderer.cpp:454–467  ·  view source on GitHub ↗

create an OpenGL texture

Source from the content-addressed store, hash-verified

452
453// create an OpenGL texture
454GLuint SmokeRenderer::createTexture(GLenum target, int w, int h, GLint internalformat, GLenum format)
455{
456 GLuint texid;
457 glGenTextures(1, &texid);
458 glBindTexture(target, texid);
459
460 glTexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
461 glTexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
462 glTexParameteri(target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
463 glTexParameteri(target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
464
465 glTexImage2D(target, 0, internalformat, w, h, 0, format, GL_FLOAT, 0);
466 return texid;
467}
468
469// create buffers for off-screen rendering
470void SmokeRenderer::createBuffers(int w, int h)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected