#include "engine.h"
int main(int argc, char** argv)
{
Initialize();
Graphics(640,480);
RegisterAbstractPath("YOUR PATH TO Leadwerks SDK 2.3");
TWorld world = CreateWorld() ;
TBuffer gbuffer;
gbuffer=CreateBuffer(GraphicsWidth(),GraphicsHeight(),BUFFER_COLOR|BUFFER_DEPTH|BUFFER_NORMAL);
TCamera camera = CreateCamera();
MoveEntity(camera,Vec3(0,0,-1));
TMesh ground;
TMaterial material;
material=LoadMaterial("abstract::cobblestones.mat");
TModel model = LoadModel("abstract::fixture_cagelight.gmf");
RotateEntity(model,Vec3(0.0,90,0.0));
ground=CreateCube();
ScaleEntity(ground,Vec3(10,1,10));
PositionEntity(ground,Vec3(0,-1,0));
PaintEntity(ground,material);
DebugLights(true);
while(!KeyHit(KEY_ESCAPE))
{
// Update timing and world
UpdateAppTime();
UpdateWorld(AppSpeed()) ;
// Render
SetBuffer(gbuffer);
RenderWorld();
SetBuffer(BackBuffer());
RenderLights(gbuffer);
DrawText(0,0,"%s",GetEntityKey(model,"alignoncreate"));
Flip(0);
}
Terminate();
return 1;
}
Make sure you have the scripts folder in your app directory's root.