previously when i use .fx files, i could use my errorMessage:
hr = D3DX11CompileFromFile(L"Effects.fx", 0, 0, "PS", "ps_5_0", 0, 0, 0, &PS_Buffer, &errorMessage, 0);
but now, when when i use .hlsl files, this is the method i use for create shaders:
std::vector<unsigned char> VSFile = ReadFile("VertexShader.cso");
d3d11Device->CreateVertexShader(VSFile.data(), VSFile.size(), NULL, &VS);
and this is my function for ReadFile:
std::vector<unsigned char> ReadFile(std::string path)
{
std::vector<unsigned char> FileData;
// open the file
std::ifstream VertexFile(path, std::ios::in | std::ios::binary | std::ios::ate);
// if open was successful
if (VertexFile.is_open())
{
// find the length of the file
int Length = (int)VertexFile.tellg();
// collect the file data
FileData.resize(Length);
//FileData = new std::vector<unsigned char>(Length);
VertexFile.seekg(0, std::ios::beg);
VertexFile.read(reinterpret_cast<char*>(FileData.data()), Length);
VertexFile.close();
}
else
{
MessageBox(hwnd, L"New Vertex shader system error", L"Error", MB_OK);
}
return FileData;
}
do you know how can i use those error messages like before ?
because it doesn't show anything in Visual Studio error list