just a quick question.
I want to make a 3d game in OpenGL on a Mac but I’m not sure how to make a Vec3f class in objective c.
I would really like to be able to set the class like,
Vec3f *point = {1,2,3};
but still be able to treat it like a class.
The only I things can think of is use a typedef struct or use regular objc setters like
-(void)setX:(int)X{ x = X; }
I don’t know. Any Suggestions.
EDIT: Just to be clear I want to be able to set the class as if it was an array. I don’t need to know how to make the class, I just want to be able to know how to set the class with curly braces. Thank you.
You can’t do this in Obj-C. It doesn’t provide any mechanism to do alternant initialization like that. Your best bet is to do something like this…