Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

1 Screenshot

Description

I have not much time to make this more accessible as it is.
Here is a screenshot of my App.cpp as use example.
 


bool App::Start()
{
    window = Window::Create("Game Test",0,0,1800,950);
    context = Context::Create(window);
    world = World::Create();
    //context:DrawText("FPS: "..Math:Round(Time:UPS()),2,2)
    worldGenerator = new WorldGenerator();
    worldGenerator->setMaxChunksLoaded(9);

    //player = Prefab::Load("Prefabs/freelook.pfb");
    //player->SetPosition(0, 0, 0, true);
    player = new Player(window, world);
    worldGenerator->setPlayerPos(player->GetPosition(true));
    worldGenerator->terrainChunk = Model::Load("Models/t_plane_v2.mdl");
    worldGenerator->_world_DEBUG = world;
    worldGenerator->terrainChunk->SetPosition(0, -1000, 0);
    worldGenerator->materials.push_back(Material::Load("Materials/Nature/forest01 diffuse 2k.mat"));
    worldGenerator->materials.push_back(Material::Load("Materials/Nature/stone_01.mat"));
    ///worldGenerator->terrainChunk = Model::Load("Models/Grass/grass01.mdl");
    //worldGen=std::thread(&App::updateTerrain, this);
    worldGenerator->makeTerrain();
    return Map::Load("Maps/worldGenerator.map");
}

bool App::Loop()
{
    Leadwerks::Time::Update();
    player->UpdatePlayerMovement();
    worldGenerator->setPlayerPos(player->GetPosition(true));
    worldGenerator->makeTerrain();
    //if(worldGen.joinable()){
        //worldGenerator->setPlayerPos(player->GetPosition(true));
        //worldGen.join();
        //worldGenerator->makeTerrain();
        //worldGen = std::thread(&WorldGenerator::makeTerrain, worldGenerator);
    //}
    //worldGenerator->updateTerrain(player->GetPosition(true));
    world->Update();
    world->Render();
    //worldGenerator->drawStuff(context);
    context->Sync();

    return true;
}

I may furbish and make tutorials for a paid version later. This is for intermediate c++ users.



User Feedback

Recommended Comments

There are no comments to display.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...