MCPcopy Create free account
hub / github.com/bulletphysics/bullet3 / BindFont2

Function BindFont2

examples/OpenGLWindow/SimpleOpenGL2App.cpp:94–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92 }
93};
94static GLuint BindFont2(const CTexFont* _Font)
95{
96 GLuint TexID = 0;
97 glGenTextures(1, &TexID);
98 glBindTexture(GL_TEXTURE_2D, TexID);
99 glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE);
100 glPixelStorei(GL_UNPACK_LSB_FIRST, GL_FALSE);
101 glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
102 glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
103 glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
104 glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
105 glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, _Font->m_TexWidth, _Font->m_TexHeight, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, _Font->m_TexBytes);
106 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
107 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
108 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
109 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
110 glBindTexture(GL_TEXTURE_2D, 0);
111
112 return TexID;
113}
114
115SimpleOpenGL2App::SimpleOpenGL2App(const char* title, int width, int height)
116{

Callers 1

SimpleOpenGL2AppMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected