Skip to content

Commit

Permalink
Rename base extension class
Browse files Browse the repository at this point in the history
  • Loading branch information
Warreign committed Aug 23, 2024
1 parent c8baa92 commit 66835be
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
2 changes: 2 additions & 0 deletions demo/Example.gd
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ extends Example

func _ready():
test_cesium()
print(GDCesium.godot_cpp_version())
print(GDCesium.version());
14 changes: 7 additions & 7 deletions src/GDCesium.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ If there are no commits since the last tag, only the tag is shown.
@return The version string (e.g. "Foo v1.2.3-gdedbd01").
*/
godot::String GDExtensionTemplate::version()
godot::String GDCesium::version()
{
return VersionInfo::VERSION_STR.data();
}
Expand All @@ -33,19 +33,19 @@ The version string is generated using godot-cpp's core/version.hpp.
@return The version string (e.g. "godot-cpp v4.2.0-stable").
*/
godot::String GDExtensionTemplate::godotCPPVersion()
godot::String GDCesium::godotCPPVersion()
{
return "godot-cpp v" + godot::uitos( GODOT_VERSION_MAJOR ) + "." +
godot::uitos( GODOT_VERSION_MINOR ) + "." + godot::uitos( GODOT_VERSION_PATCH ) + "-" +
GODOT_VERSION_STATUS;
}

/// Bind our methods so GDScript can access them.
void GDExtensionTemplate::_bind_methods()
void GDCesium::_bind_methods()
{
godot::ClassDB::bind_static_method( "GDExtensionTemplate", godot::D_METHOD( "version" ),
&GDExtensionTemplate::version );
godot::ClassDB::bind_static_method( "GDExtensionTemplate",
godot::ClassDB::bind_static_method( "GDCesium", godot::D_METHOD( "version" ),
&GDCesium::version );
godot::ClassDB::bind_static_method( "GDCesium",
godot::D_METHOD( "godot_cpp_version" ),
&GDExtensionTemplate::godotCPPVersion );
&GDCesium::godotCPPVersion );
}
4 changes: 2 additions & 2 deletions src/GDCesium.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ namespace godot
class ClassDB;
};

class GDExtensionTemplate : public godot::Object
class GDCesium : public godot::Object
{
GDCLASS( GDExtensionTemplate, godot::Object )
GDCLASS( GDCesium, godot::Object )

public:
static godot::String version();
Expand Down
2 changes: 1 addition & 1 deletion src/RegisterExtension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace
godot::ClassDB::register_class<ExampleVirtual>( true );
godot::ClassDB::register_abstract_class<ExampleAbstract>();

godot::ClassDB::register_class<GDExtensionTemplate>();
godot::ClassDB::register_class<GDCesium>();
}

/// @brief Called by Godot to let us do any cleanup.
Expand Down

0 comments on commit 66835be

Please sign in to comment.