0

I'm trying to make this an array but where I've put the brackets it just gives an error out.

Texture2D* sun = new Texture2D();

2 Answers2

1

You need to do something like this:

Texture2D* sun = new Texture2D[size];

See operator new[].

Sadique
  • 22,572
  • 7
  • 65
  • 91
0

Maybe you need to do something like this:

Texture2D** sun = new Texture2D*[size];
Emadpres
  • 3,466
  • 2
  • 29
  • 44
  • I've done this. Texture2D* sun = new Texture2D()[10]; but now I get the error of no suitable conversion function from "Texture2D" to "Texture2D*" exists – RussNicholls Jan 02 '15 at 12:32
  • @RussNicholls You must use my answer or al-Acme answer. not `Texture2D()[10];` – Emadpres Jan 02 '15 at 12:40