C++ support for game components/actors

Anthony WellsAnthony Wells
1 min read

You can produce a CGame .dll using provided solutions so you can now make your game using actual C++ code. No need to re-compile the engine/ide, you just provide the dll as described and you can then add your own actors and components.

The biggest benefit is that the whole engine is coded in C++, you can now access the whole engine, not just whatever the C# system provides you.

Still, it’s up to you weather you want to use C# or C++, or even the Visual Logic Graphs.

Technically, there is also Python support, but it is lagging behind the C# usage wise.

The other really cool thing is you can multiple/any number of properties per component node,

it’s just one line of code per property, and you can then edit it in the IDE, like any C# component.

class TestComp1 : public Component { public:

TestComp1() { m_Name = "Test C Component"; m_Properties.bind("Turn Speed", &m_TurnSpeed); } Component* CreateInstance() override {

auto r = new TestComp1;

return r;

}

void OnUpdate(float dt) override {

m_Owner->Turn(glm::vec3(0,m_TurnSpeed, 0), false);

}

private:

float m_TurnSpeed = 0.5;

}

and then in the ide, when selecting the component/actor, you can edit “Turn Speed” as you’d expect.

0
Subscribe to my newsletter

Read articles from Anthony Wells directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Anthony Wells
Anthony Wells

I have been developing games and 3D engines since the 90's. My current big project is "Q3D"