Why an exe ?
Sure:
#include "engine.h"
int main(int argc, char** argv)
{
Initialize();
RegisterAbstractPath("PATH TO YOUR SDK FOLDER");
Graphics(800,600);
AFilter() ;
TFilter() ;
TWorld world = CreateWorld() ;
if (!world) {
MessageBoxA(0,"Error","Failed to create world.",0);
return Terminate();
}
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::LE_BMAX_Emitter_Test.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,350,0));
PositionEntity(spectator, Vec3(11.9758406,0.934108377,-24.0441971));
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);
//UpdateAppTime();
//UpdateWorld(AppSpeed()) ;
PositionEntity(cam,EntityPosition(spectator));
// Update timing and world
UpdateFramework();
// Render
RenderFramework();
// Send to screen
Flip(0) ;
}
return Terminate();
}