Graphics: Add 2D & cubemap white textures

This commit is contained in:
Lynix
2018-04-13 00:00:36 +02:00
parent 2da086b7df
commit 19f17fa059
8 changed files with 32 additions and 23 deletions

View File

@@ -48,9 +48,7 @@ namespace Nz
{
ErrorFlags flags(ErrorFlag_ThrowException, true);
std::array<UInt8, 4> whitePixel = { { 255, 255, 255, 255 } };
m_whiteTexture.Create(ImageType_2D, PixelFormatType_RGBA8, 1, 1);
m_whiteTexture.Update(whitePixel.data());
m_whiteTexture = Nz::TextureLibrary::Get("White2D");
m_vertexBuffer.Create(s_vertexBufferSize, DataStorage_Hardware, BufferUsage_Dynamic);
@@ -576,7 +574,7 @@ namespace Nz
lastMaterial = basicSprites.material;
}
const Nz::Texture* overlayTexture = (basicSprites.overlay) ? basicSprites.overlay.Get() : &m_whiteTexture;
const Nz::Texture* overlayTexture = (basicSprites.overlay) ? basicSprites.overlay.Get() : m_whiteTexture.Get();
if (overlayTexture != lastOverlay)
{
Renderer::SetTexture(overlayTextureUnit, overlayTexture);