So, I worked on my code, which was developed in a modular way. Now one of my classes; called Splash should create an object of another class called Emitter . Usually you just create an object and execute it, but that does not work here, since the Emitter class has its own constructor. But when I try to create an object, it does not work.
As an example:
Emitter has the following constructor: Emitter::Emitter(int x, int y, int amount); and it needs to be created so that it can be obtained in the Splash class.
I tried to do this, but this did not work:
class Splash{ private: Emitter ps(100, 200, 400, "firstimage.png", "secondimage.png");
I also tried this, which didn't work either:
class Splash{ private: Emitter ps;
Edit: I know that the second way should work, but it is not. If I delete the Emitter section, the code will work. but when I do it in the second way, no window opens, the application is not running.
So how can I create an Emitter object for use in Splash ?
Edit:
Here is my code for the class and emitter header: Header
// Particle engine for the project
and here are the emitter functions:
#include "particle.h"
Also here are Splash Class and Splash Header .