To use C++ you should open Projects\Windows\<your projectname>.sln in Visual Studio and compile.
If you don't want Main.Lua to be executed you can go for a more clean approach and replace main.cpp
with something like this
#include "Leadwerks.h"
#include <sstream>
using namespace Leadwerks;
int main(int argc, const char *argv[])
{
// Initialize Steamworks (optional)
// Steamworks::Initialize();
// Create the app window
Window* window = Window::Create("My Game", 0, 0, 1024, 768, Window::Titlebar);
// and some context to draw on
Context* context = Context::Create(window, 0);
if (context == nullptr)
{
return 1;
}
// The world containg all objects
World* world = World::Create();
// Load a map into the world
if (!Map::Load( "Maps/start.map" )
{
return 2;
}
// Loop until window is closed or user presses ESCAPE
bool showstats = false;
while (!window->KeyDown(Key::Escape) && !window->Closed())
{
Time::Update();
world->Update();
world->Render();
context->SetBlendMode(Blend::Alpha);
showstats = window->KeyHit(Key::F11) ? !showstats : showstats;
if (showstats)
{
ostringstream fps;
fps << "FPS: " << Math::Round(Time::UPS());
context->SetColor(1, 0, 0, 1);
context->DrawText("Debug Mode", 2, 2);
context->SetColor(1, 1, 1, 1);
context->DrawText(fps.str(), 2, 2);
context->DrawStats(2, 22);
context->SetBlendMode(Blend::Solid);
}
context->Sync(true);
}
return 0;
}