This is a c++ snip that inits lua and loads a scene containg road/river/lights etc.. correctly, but not sure if it's that you need (or I didn't understand the question)
#include "engine.h"
int main(int argc, char** argv)
{
Initialize();
RegisterAbstractPath("C:Leadwerks Engine SDK");
Graphics(1280,960);
AFilter() ;
TFilter() ;
TFramework framework=CreateFramework();
TLayer layer = GetFrameworkLayer(0);
TCamera cam=GetLayerCamera(layer);
PositionEntity(cam,Vec3(0,0,0));
//Set Lua variable
BP L=GetLuaState();
lua_pushobject(L,framework);
lua_setglobal(L,"fw");
lua_pop(L,1);
// Setup Initial Post Processing FX
//SetGodRays(1);
SetHDR(1);
SetSSAO(1);
SetBloom(1);
SetAntialias(1);
SetStats(2);
LoadScene("abstract::riverscene.sbx");
// Setup spectator
TBody spectator=CreateBodySphere();
SetBodyMass(spectator,1);
SetBodyGravityMode(spectator,0);
SetBodyDamping(spectator,1.0);
EntityType(spectator,3);
SetBodyBuoyancyMode(spectator,0);
PositionEntity(spectator,Vec3(0,5,-10));
TVec3 camrotation=Vec3(0);
float mx=0;
float my=0;
float move=0;
float strafe=0;
HideMouse();
MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2);
// MAIN LOOP
while (!KeyHit(KEY_ESCAPE))
{
mx=Curve(MouseX()-GraphicsWidth()/2,mx,6);
my=Curve(MouseY()-GraphicsHeight()/2,my,6);
MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2);
camrotation.X=camrotation.X+my/10.0;
camrotation.Y=camrotation.Y-mx/10.0;
RotateEntity(cam,camrotation);
move=KeyDown(KEY_W)-KeyDown(KEY_S);
strafe=KeyDown(KEY_D)-KeyDown(KEY_A);
TVec3 force = Vec3(strafe*10.0,0,move*10.0);
force=TFormVector(force,cam,0);
AddBodyForce(spectator,force);
PositionEntity(cam,EntityPosition(spectator));
// Update timing and world
UpdateFramework();
// Render
RenderFramework();
// Send to screen
Flip(0) ;
}
return Terminate();
}