Hi guys,
I want to visualize textures having the DXGI_FORMAT_D16_UNORM format (like depth, shadow maps, etc.) I'm copying to the clipboard but can't figure out how to get the values.
// resource is mapped to subresource
for (int i = 0; i < texture_height; i++) {
BYTE* src = (BYTE*)(subresource.pData) + (i * subresource.RowPitch); // start of row
for (int j = 0; j < texture_width; j++) {
grey = *((unsigned short*)(src)); // this isn't right
// fill in my rgb values here
src += 2; (advance 2 bytes = 16 bits)
}
}
Please help. Thanks.