Will C++ Ever Be Built Into Godot?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By gamecreator
:warning: Old Version Published before Godot 3 was released.

Hello. I saw the news the 3.0 was well on its way. I scanned older news but I wasn’t clear on whether C++ will ever be built into Godot, without the need for modules, so that you can just open up a project template (SLN file), code a few lines and see a sprite on the screen. This looks like such an awesome engine but I’m really used to C/C++ and the current directions to use it are both complex and also missing things (like setting up Visual Studio under Configuring an IDE).

As an example, this code loads and displays a model in another engine I currently use. I’m wondering if Godot will ever be able to do similar in a few lines of code.

#include "Leadwerks.h"

using namespace Leadwerks;

Light* light = NULL;

int main(int argc, const char *argv[])
{
    Leadwerks::Window* window = Leadwerks::Window::Create();
    Context* context = Context::Create(window);
    World* world = World::Create();

```
Camera* camera = Camera::Create();
camera->SetRotation(0, 180, 0);
camera->Move(0, 1, -2);

Light* light = DirectionalLight::Create();
light->SetRotation(35, 35, 0);

Model* model = Model::Load("Models/Goblin/goblin.mdl");

while (true)
{
    if (window->Closed() || window->KeyDown(Key::Escape)) return false;

    Leadwerks::Time::Update();
    world->Update();
    world->Render();
    context->Sync();
}
return 0;
```
}

Aha Leadwerks, that brings back some memories. I think it was the first 3D engine I learned and gave up on. I tried LWs, Unity, C4, back to Unity, then Unreal and now Godot. I think I even messed around with Garage Games at some point. Its hard to find an engine you can click with.

whooshfrosted | 2017-07-27 23:23

Yeah, Leadwerks is still the most ideal for me because I love the direct simplicity of it. No runaround. Just open your project file and start coding and go into the editor if you need to. I would love that from Godot.

gamecreator | 2017-07-28 00:44

:bust_in_silhouette: Reply From: whooshfrosted

Search on something called GDNative that’s coming for version 3.0.

Thank you. I found an article from April that seems promising though it’s a different approach than I’m used to (the simplicity mentioned above). No mention of setting up Visual Studio but I assume that’s in the works.

I’m hoping at some point C++ will just be directly integrated without the extra steps of modules and scripts and whatever else.

gamecreator | 2017-07-28 00:42

Well I don’t think there are any plans to integrate C++ that tightly, so GDNative is the best you can hope for.

I had to break out of the old mindset to learn the Godot way, which is very different to other engines and you will have to as well. This guy warlaan’s comments helped me to do that. He posts at reddit and I just noticed he posts here as well, so there is more for me to read. :slight_smile:

"Another thing to keep in mind is that like most engines Godot offers more than one language and the decision which language to use for which part of the code plays an important role in creating readable code. In Godot’s case there are three main languages to choose from: 1. C++ for backend code 2. GDscript for imperative game code 3. The editor interface for declarative game code.

Your priority should always be: use 3 whenever possible, use 1 when 3 isn’t enough and your code can be written in a non-game-specific way and use 2 only as a last resort."

Reddit - Dive into anything

Speaking for myself I just use 2 and 3. When GDNative comes out and they’ve ironed out all the wrinkles I might try using 1.

whooshfrosted | 2017-07-28 03:54

Old habits are hard to break but there’s wisdom in expanding your horizons, especially for a powerful engine like this one. Leadwerks fits me well for now but I’ll check back with Godot every few months. Thank you for the help.

gamecreator | 2017-07-28 06:32

I share your vision exactly, word for word. What solution have you found? I want to get inspired from people that think alike me.

snwflk | 2017-12-17 10:13

It seems like with the release of Godot 3 this may be more possible than ever. Now the only thing that’s really missing is a 10-minute video that goes through everything step by step (preferably for Windows) and gets a simple bitmap moving left and right with the help of C++ code.

gamecreator | 2018-02-12 03:50