Re: memstruct ?[UNSOLVED]
- Posted by mattlewis (admin) Apr 20, 2014
- 1338 views
Lone_EverGreen_Ranger said...
Hello,
I am trying the 4.1.0 beta. I thought there was going to be a memstruct function in it, so that C structs would be easier to wrap. Was this feature not implemented? Here is the piece of code I'm trying to wrap using the memstruct function.
memstruct struct_sfVideoMode atom width atom height atom bitsPerPixel end memstruct atom sfv = allocate(sizeof(struct_sfVideoMode)) sfv.struct_sfVideoMode = 0 sfv = sfVideoMode(w,h,bits) ? sfv.struct_sfVideoMode.width free(sfv)
Was the way you use it changed? Or do you have to do something else entirely?
It's in its own branch ("struct") currently. There are some things that need to be finished, I think, and certainly some bugs. If you have a 4.1 binary, you should be able to build it from there. The syntax is more geared towards making it easy to model actual C structs. It allows stuff like "int" and "long" and should work correctly as far as C is concerned.
Matt