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

Method loadEnvMapTextureData

src/Shaders/CarShader.cpp:17–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15}
16
17void CarShader::loadEnvMapTextureData() {
18 std::stringstream filename;
19 filename << "../resources/misc/sky_textures/CHRD.BMP";
20
21 int width, height;
22 GLubyte *data;
23
24 ASSERT(Utils::LoadBmpCustomAlpha(filename.str().c_str(), &data, &width, &height, 0), "Environment map texture loading failed!");
25
26 glGenTextures(1, &envMapTextureID);
27 glBindTexture(GL_TEXTURE_2D, envMapTextureID);
28 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
29 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
30 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
31 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
32 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, (const GLvoid *) data);
33}
34
35void CarShader::bindAttributes() {
36 bindAttribute(0 ,"vertexPosition_modelspace");

Callers

nothing calls this directly

Calls 1

LoadBmpCustomAlphaFunction · 0.85

Tested by

no test coverage detected