GDExtension (#56)

Merge GDExtension
This commit is contained in:
Patrick Dawson
2024-04-30 03:40:26 +02:00
committed by GitHub
parent 2e77a48203
commit c17e72a546
120 changed files with 6511 additions and 601 deletions

View File

@@ -0,0 +1,44 @@
#include "mynode.h"
#include "core/config/engine.h"
#include "core/io/resource_loader.h"
#include <imgui-godot.h>
MyNode::MyNode()
{
#ifdef DEBUG_ENABLED
if (Engine::get_singleton()->is_editor_hint())
return;
#endif
set_process(true);
}
MyNode::~MyNode()
{
}
void MyNode::_bind_methods()
{
}
void MyNode::_notification(int what)
{
#ifdef DEBUG_ENABLED
if (Engine::get_singleton()->is_editor_hint())
return;
#endif
switch (what)
{
case NOTIFICATION_PROCESS:
ImGui::Begin("C++ module", nullptr, ImGuiWindowFlags_AlwaysAutoResize);
ImGui::Text("hello");
ImGui::Image(_img, {_iconSize, _iconSize});
ImGui::DragFloat("size", &_iconSize, 1.f, 32.f, 512.f);
ImGui::End();
break;
case NOTIFICATION_READY:
_img = ResourceLoader::load("res://icon.svg");
break;
}
}