Soundbomber's picture

Edge Flags

I am trying to utilise edge flags with my model (simple 3D I shape) in VB.NET, to eliminate some unwanted lines.
I am using "InterleavedArrayFormat.T2fC4fN3fV3f" and a boolean array containing the edge flag data. I enable the edge flag client state using :-
"oGL.EnableClientState(EnableCap.EdgeFlagArray)"
and (try) to populate it with :-
"oGL.EdgeFlagPointer(0, Me.oEdges)".
The edges only seem to change state (visible/not visible) in relation to the first boolean in the array (Me.oEdges(0)), all the other values seem to be ignored. So if for example Me.oEdges(0) is set to True and all the remaining values set to False then all edges are drawn. If however I set Me.oEdges(0) to False and all the remaining values to True, then no edges are drawn at all!
Anyone any ideas?


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

What happens if you change the edge flag array from Boolean() to Integer()?

Soundbomber's picture

Then I get a casting error when I call
oGL.EdgeFlagv(Me.oEdges)
(expectes boolean type for flag() argument)

Soundbomber's picture

Do I not need to call
oGL.EdgeFlagv(Me.oEdges)?
You will have to excuse my ignorance, I am still finding my way with OpenGL/OpenTK and there is scant info for VB programmers.
Anyway, tried without the above call and used integer values for the array but still nothing.

the Fiddler's picture

Ok, your initial code is correct (with boolean array) and the behaviour you are seeing is expected. Quoting from msdn:

msdn wrote:

Parameters
flag

Specifies a pointer to an array that contains a single Boolean element, which replaces the current edge flag value.

Only the first value is ever read from the array.

Soundbomber's picture

Surely not!
How then do we implement EdgeFlags with object arrays?
Why bother with an array if it only has one element?
Am I approaching this the wrong way?