Direct Pointer Variables in NG
BlitzMax Forums/BlitzMax NG/Direct Pointer Variables in NG
| ||
Or whatever you call it in bmx, apparently this works in vanilla and not in NG or I don't know the new format..Float Ptr [0.0, 0.0, 0.0, 0.0] Compile Error: Syntax error - expecting ']'. finding this on GL calls with the mods I'm checking out.. or you really have to do Local myvar#[] = [0.0, 0.0, 0.0, 0.0]? |
| ||
Ya, you need to use a variable. In blitmax, literal types were stored in the .data section and you could always get a pointer to them. Not that way in C. you can probably use "MemAlloc(4*4)" or somthing |
| ||
Thanks GW, because this is also valid with vanilla without using .data sectionglLightfv( LightIndex, GL_POSITION, Float Ptr [0.0, 0.0, 0.0, 0.0,]) I guess I have to made those adjustments. |
| ||
it still uses the data section |
| ||
Thanks GW. |
| ||
I think you wrap the array in parenthesis to achieve the same result?Float Ptr ( [ 0.0, 0.0, 0.0, 0.0 ] ) |
| ||
Float Ptr [0.0, 0.0, 0.0, 0.0] This constructs a new 1 dimensional array with 4 elements, and then points to the address of the first entry. Every time you call this code, it would create a new 1 dimensional array with 4 elements... etc. which is not very efficient :-) That said, it's not parsing correctly in NG... |