-
Notifications
You must be signed in to change notification settings - Fork 65
Add an example class to the project. #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
0649bae
to
1808be8
Compare
I forget the details of the discussion, but I recall when @paddy-exe's template was moved to |
Yep I remember that discussion as you explained David. The reasoning behind this as far as I can recall was that it was easier to just set it up instead of having to rewrite/delete the old boilerplate code. Also the template is set up for people familiar with the system and specifically not for newcomers. |
Interesting! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it! Covers some common things. While I find the example scene a bit superfluous, I do like that it prints something on startup. When dsnopek was testing #78, he had to write a little script to validate that the extension was being loaded.
#ifndef EXAMPLE_CLASS_H | ||
#define EXAMPLE_CLASS_H |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we migrate to #pragma once
here too?
When you first clone
godot-cpp-template
, you may still have no idea what to do next, because the gdextension doesn't actually do anything right now. This may be additionally confusing because you may not know how to check your GDExtension is even loading.While the docs explain how to create and register classes, people may not look there when starting a project. It's may be easier to have some boilerplate for it ready and get right to programming C++.
This PR adds a minimal class for example purposes. I don't think we should try to cover a lot of functionality with it, but a single registered function and some docs is probably enough for people to kick off their project from.