Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17560

Direct3D 11 Textures not working

$
0
0

Hello! I'm currently working on a project and I'm having a bit of an issue with Direct3D 11 and textures. They're not showing up.

Now I don't know if my texture creation code is incorrect since I'm currently learning Direct3D 11.

Here's the texture creation code:

int width, height;
int channels;
stbi_uc* data = stbi_load(m_Filepath.c_str(), &width, &height, &channels, 4);
COFFEE_ASSERT(data, "Failed to load texture!");

m_Width = width;
m_Height = height;

D3D11_TEXTURE2D_DESC textureDesc;
ZeroMemory(&textureDesc, sizeof(textureDesc));
textureDesc.Width = m_Width;
textureDesc.Height = m_Height;
textureDesc.MipLevels = 1;
textureDesc.ArraySize = 1;
textureDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
textureDesc.SampleDesc.Count …

Viewing all articles
Browse latest Browse all 17560

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>