"||" mean Bitwise OR
Say you have 2 Variables, like 128 (0x80) and 10 (0x0A)
What Bitwise would do is change them at the binary level.
Bitwise OR works to these rules:
0 + 1 = 1
1 + 0 = 1
0 + 0 = 0
1 + 1 = 1
So if we change these values to binary
128 = %1000 0000
10 = %0000 1010
the result would be
%1000 1010 = 138
Basically we've just added the values together, but doing it at the binary level means that we can use this for more than just getting a final number.
If we used each of the binary values individually for an 8 bit value like we use above, you get 8 Yes / No (On / Off) flags.
So say you were creating a level format, and it was made entirely of cubes. You could have a flag for each face, to know if it was Active (if so then can render it) or in active.
The way we would find out if a flag is active is just as simple as adding them.
For example:
#Constant WavesInTheBreeze = 0x80
#Constant AttachedToPole = 0x0A
` it's easier to use Hex for dealing with binary flags as F = 16
` so every FF = a 32bit value easier to understand and handle
` than large numbers
Flag = WavesInTheBreeze `|| AttachedToPole
` we now have our flag but how do we check if it is attachedtopole?
` easy
If (Flag && AttachedToPole) <> 0
Attach$ = "is"
Else
Attach$ = "is not"
EndIf
Text 10, 10, "This Flag " + Attach$ + " Attached to a Pole"
Just to proove it works, uncomment the AttachedToPole in Flag.
This is because Bitwise AND (&&) works identically to OR, only using 0 instead.
Bitwise or works to these rules:
0 + 1 = 0
1 + 0 = 0
0 + 0 = 0
1 + 1 = 1
Quote: "- VertexSize = 12 + 4 + 0 do this means that the object will be a triangle??"
No, this is simply the size of the Vertex Data.
FVF_XYZ_SIZE = 12
` Type Vector3 X,Y,Z As Float EndType / 3x 4Byte Float .. so 12 Bytes
FVF_DIFFUSE_SIZE = 4
` Dword 32-bit Colour is 4Byte
FVF_TEX0_SIZE = 0
` As this means No Texture Coordinate this has no size. Tex1 is the normal one which is Type Vector2 U,V As Float EndType / 2x 4Byte Float... so 8 Bytes
VertexSize = FVF_XYZ_SIZE + FVF_DIFFUSE_SIZE + FVF_TEX0_SIZE
As for the data sizes, yes all data is 4 Byte as it is all either a 32-bit Dword or 32-bit Float.
You use each in relation to what your copying at the time.
XYZ = Vertex Position, 3x Float, Order = X, Y, Z
NORMAL = Normal Position, 3x Float, Order = X, Y, Z
DIFFUSE = Colour, 4x Byte, Order = Red, Green, Blue, Alpha (Generally you use the RGB( ) command and you'll be alright)
SPECULAR = Same as above, only DIFFUSE Colours, this one highlights. I used to affectionately called it "Spectacular Colour" heh
TEX1 - 8 = Texture Coordinates, the number relates to the number of Coordinate Stages/Sets. Each Stage/Set uses this setup:
2x Float, Order = U, V
So for 8 Stages, you would have 8 individual Coordinate Sets as above.
There are a few more aspects to the format but honestly you won't needs them; given they're not really supported yet.
Hopefully that clears some things up.