create an OpenGL texture
| 452 | |
| 453 | // create an OpenGL texture |
| 454 | GLuint 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 |
| 470 | void SmokeRenderer::createBuffers(int w, int h) |
nothing calls this directly
no outgoing calls
no test coverage detected