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

Author Topic: N- objects VertexArray  (Read 824 times)

0 Members and 1 Guest are viewing this topic.

Wojskowiec_PL

  • Newbie
  • *
  • Posts: 2
    • View Profile
N- objects VertexArray
« on: February 09, 2014, 01:57:38 pm »
I have a simple question. In documentation there is about Primitive types and they are limited to max 4 points. I have also read about texCoords. Is it possible to texture a VertexArray which includes n points(for example 20)? Or have I to write something which will break this entity to triangles or quads? Sry for my english :)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: N- objects VertexArray
« Reply #1 on: February 09, 2014, 02:03:48 pm »
The graphics card only understands points, lines or triangles (quads are split in two triangles internally). So yes, if you work with a low-level entity such as the vertex array, you'll have to split your geometry into triangles.

Another solution is to use a higher-level class:
- sf::ConvexShape if your shape is convex
- thor::ConcaveShape otherwise
Laurent Gomila - SFML developer

Wojskowiec_PL

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: N- objects VertexArray
« Reply #2 on: February 09, 2014, 02:41:48 pm »
Thank you :)

 

anything