MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / UpdateRGBA

Method UpdateRGBA

engine/PoseidonGL33/TextureGL33_Init.cpp:585–597  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

583}
584
585void TextureGL33::UpdateRGBA(const void* rgba, uint32_t size)
586{
587 if (!_surface.GetTexture() || !rgba)
588 return;
589
590 GL33Bind::Tex2D(EngineGL33::kUploadUnit - GL_TEXTURE0, _surface.GetTexture());
591 glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
592 glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
593 glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, _surface._w, _surface._h, GL_RGBA, GL_UNSIGNED_BYTE, rgba);
594 if (_dynamicMipmapped)
595 glGenerateMipmap(GL_TEXTURE_2D);
596 GL33Bind::ActiveUnit(0);
597}

Callers 1

UpdateDynamicMethod · 0.80

Calls 3

Tex2DFunction · 0.85
ActiveUnitFunction · 0.85
GetTextureMethod · 0.45

Tested by

no test coverage detected