Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: [SFML2.4 - VB NET 4.52] Vertex Array doubts  (Read 4492 times)

0 Members and 1 Guest are viewing this topic.

hechelion

  • Newbie
  • *
  • Posts: 24
    • View Profile
[SFML2.4 - VB NET 4.52] Vertex Array doubts
« on: December 13, 2019, 04:48:24 am »
Hi.
I try to work with vertex array over VB NET 2.4, and I discovered the following:


if I Try to draw a triangle with this code:
Code: [Select]
dim pX as integer = 100
dim pY as integer = 100
dim pVertex(2) as Vertex

pVertex(0) = New Vertex(New Vector2f(pX, pY), New Color(255, 0, 0, 255))
pVertex(1) = New Vertex(New Vector2f(pX+64, pY), New Color(255, 0, 0, 255))
pVertex(2) = New Vertex(New Vector2f(pX+64, pY+64), New Color(255, 0, 0, 255))

oRtScreen.Draw(pArrayAura, PrimitiveType.Triangles)

Work perfect.

But, if I declare the vertex without any parameter, and then try to set the value, then, SFML don't draw anything, but don't report any error.

Code: [Select]
dim pX as integer = 100
dim pY as integer = 100
dim pVertex(2) as Vertex

pVertex(0) = New Vertex()
pVertex(1) = New Vertex()
pVertex(2) = New Vertex()

pVertex(0).position = New Vector2f(pX, pY)
pVertex(1).position = New Vector2f(pX+64, pY)
pVertex(2).position = New Vector2f(pX+64, pY+64)

pVertex(0).color =  New Color(255, 0, 0, 255)
pVertex(1).color =  New Color(255, 0, 0, 255)
pVertex(2).color =  New Color(255, 0, 0, 255)

oRtScreen.Draw(pArrayAura, PrimitiveType.Triangles)

Don't work, but don't show any error.

Any idea why this happens?