MCPcopy Create free account
hub / github.com/OpenNI/OpenNI / initTexture

Function initTexture

Samples/NiUserTracker/SceneDrawer.cpp:67–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65 return m;
66}
67GLuint initTexture(void** buf, int& width, int& height)
68{
69 GLuint texID = 0;
70 glGenTextures(1,&texID);
71
72 width = getClosestPowerOfTwo(width);
73 height = getClosestPowerOfTwo(height);
74 *buf = new unsigned char[width*height*4];
75 glBindTexture(GL_TEXTURE_2D,texID);
76
77 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
78 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
79
80 return texID;
81}
82
83GLfloat texcoords[8];
84void DrawRectangle(float topLeftX, float topLeftY, float bottomRightX, float bottomRightY)

Callers 1

DrawDepthMapFunction · 0.85

Calls 1

getClosestPowerOfTwoFunction · 0.85

Tested by

no test coverage detected