MCPcopy Create free account
hub / github.com/OpenNFS/OpenNFS / load_bmp_texture

Method load_bmp_texture

src/Shaders/BillboardShader.cpp:54–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54void BillboardShader::load_bmp_texture() {
55 GLubyte *data;
56 GLsizei width;
57 GLsizei height;
58
59 Utils::LoadBmpWithAlpha("../resources/sfx/0004.BMP", "../resources/sfx/0004-a.BMP", &data, &width, &height);
60 glGenTextures(1, &textureID);
61 glBindTexture(GL_TEXTURE_2D, textureID);
62
63 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
64 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
65 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
66 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
67 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, (const GLvoid *) data);
68}

Callers

nothing calls this directly

Calls 1

LoadBmpWithAlphaFunction · 0.85

Tested by

no test coverage detected