Apple also repeats this pattern in some of their sample code like this.
typedef struct {
GLdouble x,y,z;
} recVec;
I assume here that rec means a storage record or struct and vec means
vector which in mathematics is a matrix with one row or one column.
Anyway I started using this design pattern for some of my data types
and associated functions. Every thing was working well and nice and
tidy. A struct is a great way to keep the data together in one chunk
and labeled nicely. But then I ran into what appears to be a problem.
None of my structs and associated functions are loop friendly.
OpenGL does not appear to use structs at all but instead will do
something like this.
So I am thinking that the OpenGL vector data type and corresponding
function looks extremely loop friendly. Maybe I should pattern my
geometric primitives and associated functions after OpenGL not Cocoa.
I have not gotten into Core Data yet so I am not sure which data type
would be more compatible a struct or a vector (array).
Any comments or suggestions on structs versus vectors?
Best Regards,
Richard
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/mac-opengl/email@hidden