| 583 | } |
| 584 | |
| 585 | void 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 | } |
no test coverage detected