Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actual~Helgon

Posted 08 December 2012 - 01:03 PM

Hi, im doing it this way:

filename is for example: L"Shadows.cso" (or what ever format you have, maybe .fxo)
mFX is : ID3DX11Effect* mFX;

std::ifstream fin(filename, std::ios::binary);
fin.seekg(0, std::ios_base::end);
int size = (int)fin.tellg();
fin.seekg(0, std::ios_base::beg);
std::vector<char> compiledShader(size);
fin.read(&amp;amp;amp;compiledShader[0], size);
fin.close();

D3DX11CreateEffectFromMemory(&compiledShader[0], size, 0, device, &mFX);

Regards

#3~Helgon

Posted 08 December 2012 - 01:02 PM

Hi, im doing it this way:

filename is for example: L"Shadows.cso" (or what ever format you have, maybe .fxo)
mFX is : ID3DX11Effect* mFX;

std::ifstream fin(filename, std::ios::binary);
fin.seekg(0, std::ios_base::end);
int size = (int)fin.tellg();
fin.seekg(0, std::ios_base::beg);
std::vector<char> compiledShader(size);
fin.read(&amp;amp;compiledShader[0], size);
fin.close();

D3DX11CreateEffectFromMemory(&amp;amp;compiledShader[0], size, 0, device, &amp;amp;mFX);

Regards

#2~Helgon

Posted 08 December 2012 - 01:02 PM

Hi, im doing it this way:

filename is for example: L"Shadows.cso" (or what ever format you have, maybe .fxo)

std::ifstream fin(filename, std::ios::binary);
fin.seekg(0, std::ios_base::end);
int size = (int)fin.tellg();
fin.seekg(0, std::ios_base::beg);
std::vector<char> compiledShader(size);
fin.read(&amp;compiledShader[0], size);
fin.close();

D3DX11CreateEffectFromMemory(&amp;compiledShader[0], size, 0, device, &amp;mFX);

Regards

#1~Helgon

Posted 08 December 2012 - 01:01 PM

Hi, im doing it this way:

filename is for example: L"Shadows.cso" (or what ever format you have, maybe .fxo)

std::ifstream fin(filename, std::ios::binary);
fin.seekg(0, std::ios_base::end);
int size = (int)fin.tellg();
fin.seekg(0, std::ios_base::beg);
std::vector<char> compiledShader(size);
fin.read(&compiledShader[0], size);
fin.close();

HR(D3DX11CreateEffectFromMemory(&compiledShader[0], size, 0, device, &mFX));

Regards

PARTNERS