c++ - Hardcoding HLSL Shader -


i have shader written in hlsl not want user able access. there way can go compiling section of memory. problem following function accepts lpcstr in order use .fx file input:

    hresult d3dxcreateeffectfromfile(   _in_   lpdirect3ddevice9 pdevice,   _in_   lpctstr psrcfile,   _in_   const d3dxmacro *pdefines,   _in_   lpd3dxinclude pinclude,   _in_   dword flags,   _in_   lpd3dxeffectpool ppool,   _out_  lpd3dxeffect *ppeffect,   _out_  lpd3dxbuffer *ppcompilationerrors ); 

i need more along lines of void* or @ least way compile block of memory. other saving data file, compiling, , deleting file, there way this?

wchar_t* shadercode = l"//poorly formatted shader code goes here"; 

i want able literally compile above section of memory. how can done?

yes. d3dxcreateeffect function. creates effect ascii or binary effect description.

http://msdn.microsoft.com/en-us/library/windows/desktop/bb172763(v=vs.85).aspx

might check out d3dx10compilefrommemory..

http://msdn.microsoft.com/en-us/library/windows/desktop/bb310587(v=vs.85).aspx


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -