Showing posts with label Loading Texture. Show all posts
Showing posts with label Loading Texture. Show all posts

Saturday, April 2, 2011

Texturing

This tutorial will demonstrate how to load texture in Direct3D 11

Interfaces used:
ID3D11ShaderResourceView

std::wstring oTexturePathString = L"c:\\textures\\hello.dds"; // Replace this file path with the texture that you want to load


ID3D11ShaderResourceView *pD3DShaderResourceView;

CHECK_COM(::D3DX11CreateShaderResourceViewFromFile(g_pD3DDevice, oTexturePathString.data(), nullptr, nullptr, &pD3DShaderResourceView, nullptr));

Now bind the created SRV to the shader to see the bound texture