You should probably write a simple, one function extension for horde that will return the code from your resource.
Something like:
CodeResGetterExtension.h
Code:
#ifndef _CodeResGetterExtension_H_
#define _CodeResGetterExtension_H_
#include "egPrerequisites.h"
#include "egExtensions.h"
namespace Horde3DCodeResGetter
{
using namespace Horde3D;
class ExtGetter: public IExtension
{
public:
virtual const char *getName();
virtual bool init();
virtual void release();
};
}
#endif // _CodeResGetterExtension_H_
CodeResGetterExtension.cpp
Code:
#include "utPlatform.h"
#include "egModules.h"
#include "egCom.h"
#include "egResource.h"
#include "egShader.h"
#include "CodeResGetterExtension.h"
#include "utDebug.h"
// Internal extension interface
namespace Horde3DCodeResGetter
{
using namespace Horde3D;
const char *ExtGetter::getName()
{
return "CodeResGetter";
}
bool ExtGetter::init()
{
return true;
}
void ExtGetter::release()
{
}
}
// Public C API
namespace Horde3DCodeResGetter
{
DLLEXP const char *h3dextGetCodeResContent( int codeResId )
{
Resource *codeRes = Modules::resMan().resolveResHandle( codeResId );
APIFUNC_VALIDATE_RES_TYPE( codeRes , ResourceTypes::Code, "h3dextGetCodeResContent", 0 );
return ( CodeResource * )codeRes->getCode().c_str();
}
}
It is just a quick draft and may contain errors, but that's the idea. Just make it a separate project and link into the engine.