-
Notifications
You must be signed in to change notification settings - Fork 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
Can't create class from raylib-cpp #198
Comments
A few options here...
I'm not sure how I feel about constructing the object without loading the associated data. Could run into Unload errors... Worth considering though! |
|
Mind submitting a Pull Request? Others may be interested in it too. I'd love to see what you're proposing. |
Okay, just need to test more about it, for now, ive not crashed when using this method :) |
For this one, it will need some time since i need to check each class and found a way to move some default constructor to function, also testing it to see if it work :) |
Quick thought... Would an initializer list for this help here? class ObjectName
{
public:
ObjectName(const std:string& modelFile);
~ObjectName();
void Load(const char* path);
void Draw(raylib::Vector3 pos);
private:
raylib::Model model;
};
ObjectName(const std::string& modelFile) : model(modelFile) {
// Do other things.
} A child property will need to know how to construct itself if you're creating the parent. |
add a default one ObjectName() so it could be used within other class, else it would just throw a error about not being initialised properly with ObjectName(string),
or something like that. (maybe the model class already check if file path exist so it would be weird to check 2 time for it) |
Pretty all class of raylib-cpp have no constructor allowing that:
So it's impossible to create class like this because a error is thrown saying Model have no default constructor !
The text was updated successfully, but these errors were encountered: