Cromon

HlslCompiler.cpp

Aug 12th, 2013
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1.         ID3DBlob* outBlob = nullptr, *errorBlob = nullptr;
  2.  
  3.         std::ifstream infile(fileName.c_str(), std::ios::binary);
  4.         std::vector<char> content;
  5.  
  6.         infile.seekg(0, std::ios::end);
  7.         content.resize(infile.tellg());
  8.         infile.seekg(0, std::ios::beg);
  9.  
  10.         infile.read(content.data(), content.size());
  11.         infile.close();
  12.  
  13.         hr = D3DCompile(content.data(), content.size(), "Shader", nullptr, nullptr, entryPoint.c_str(), shaderModel.c_str(), dwShaderFlags, 0, &outBlob, &errorBlob);
Advertisement
Add Comment
Please, Sign In to add comment