Search found 32 matches

by AleksiyCODE
September 27th, 2019, 3:30 pm
Forum: Everything
Topic: A quick question on reference initialisation
Replies: 5
Views: 2401

Re: A quick question on reference initialisation

Man, you got me there :( . Here's a copypasted version of initializing Graphics& that works: class ActionBox { public: ActionBox(const std::wstring & boxSpriteFileName,Surface* iconSprites, Vec2 in_pos,std::vector<Vec2> in_skillPos, std::vector<char> keyToSkill, int nBoxSkills,Graphics& in_gfx) : bo...
by AleksiyCODE
September 26th, 2019, 6:04 pm
Forum: Everything
Topic: A quick question on reference initialisation
Replies: 5
Views: 2401

A quick question on reference initialisation

Hey! So I'm trying to write a game ( https://gitlab.com/AleksiyCODE/riftedtimes (not much to look at yet)), but here is a quick question: when i do in a constructor class A { public: A(Graphics& in_gfx) : gfx(in_gfx) {}; //this line! privare: Graphics& gfx; } it works, but if i do class A { public: ...