1
Graphics / Arrays of vertex arrays?
« on: August 17, 2018, 07:17:22 pm »
I am currently working on a 2.5D engine in C++ using the SFML library. I quickly learnt how to use SFML, but I found no mentions of this anywhere, not in the documentation nor on this forum, so I'm asking here: is it possible to have arrays of vertex arrays (more specifically: quads)? I need this in order to place lots of walls in a map and process them in a loop.
I've already tried this:
VertexArray wall_draw[4](Quads,4);
which when compiled returned this:
main.cpp: In function ‘int main()’:
main.cpp:159:37: warning: expression list treated as compound expression in initializer [-fpermissive]
VertexArray wall_draw[4](Quads,4);
^
main.cpp:159:37: warning: array must be initialized with a brace-enclosed initializer [-fpermissive]
main.cpp:159:37: error: conversion from ‘int’ to non-scalar type ‘sf::VertexArray’ requested
How do I create an array like this? If it's impossible to do it this way, what else can I try?
I've already tried this:
VertexArray wall_draw[4](Quads,4);
which when compiled returned this:
main.cpp: In function ‘int main()’:
main.cpp:159:37: warning: expression list treated as compound expression in initializer [-fpermissive]
VertexArray wall_draw[4](Quads,4);
^
main.cpp:159:37: warning: array must be initialized with a brace-enclosed initializer [-fpermissive]
main.cpp:159:37: error: conversion from ‘int’ to non-scalar type ‘sf::VertexArray’ requested
How do I create an array like this? If it's impossible to do it this way, what else can I try?