


class IncludeFX :public ID3DInclude
{
irr::io::IReadFile* Include;
irr::c8* retInclude;
irr::io::IFileSystem* FileSystem;
UINT mBytes;
public:
IncludeFX(irr::io::IFileSystem* fileSystem)
{
FileSystem = fileSystem;
}
public:
virtual HRESULT __stdcall Close(THIS_ LPCVOID pData)
{
Include->drop();
delete retInclude;
return S_OK;
}
public:
virtual HRESULT __stdcall Open(THIS_ D3D_INCLUDE_TYPE IncludeType, LPCSTR pFileName, LPCVOID pParentData, LPCVOID *ppData, UINT *pBytes)
{
Include = FileSystem->createAndOpenFile(pFileName);
if (!Include)
{
irr::os::Printer::log("Could not open Include shader program file",
pFileName, irr::ELL_WARNING);
return S_FALSE;
}
mBytes = Include->getSize();
pBytes = &mBytes;
retInclude = new irr::c8[mBytes+1];
Include->read(retInclude, mBytes);
retInclude[mBytes] = 0;
ppData = (LPCVOID *)retInclude;
return S_OK;
}
};Granyte wrote:Odd limitation i just found out the use of the "#include" directive is not working because we have to write our own include handeler but mine is failing to work properly
if any one has experience with the thing and could explain me why it's failing that would be apeciated
<CODE SNIPPED>
I also Implemented backward compatibilitie with dx9 shader code so it's possible to write shader that will compile in dx9 and dx10
to use it you set the target shader model under sm 4.0 it will automaticaly compile the shader in compatibilitie mode the only notable diference is that it requite to set up the texture sampler in shader( since it's igniored in irrlicht dx9)
I might upload an new version as soon as i hunt a small bug down.
Return to Project Announcements
Users browsing this forum: No registered users and 1 guest