I have this code in a DLL:
Game::Game(int width, int height)
: world(width, height),
renderer("Game", 800, 600),
font(),
text(),
keyboard()
{
// Code
}
keyboard
is a pointer to a Keyboard object. The code inside the constructor is called, but the keyboard object remains null. Why is the object not being created?
The keyboard constructor:
Keyboard() {
A = new Key('a');
B = new Key('b');
C = new Key('c');
D = new Key('d');
E = new Key('e');
F = new Key('f');
G = new Key('g');
H = new Key('h');
I = new Key('i');
J = new Key('j');
K = new Key('k');
L = new Key('l');
M = new Key('m');
N = new Key('n');
O = new Key('o');
P = new Key('p');
Q = new Key('q');
R = new Key('r');
S = new Key('s');
T = new Key('t');
U = new Key('u');
V = new Key('v');
W = new Key('w');
X = new Key('x');
Y = new Key('y');
Z = new Key('z');
ZERO = new Key('0');
ONE = new Key('1');
TWO = new Key('2');
THREE = new Key('3');
FOUR = new Key('4');
FIVE = new Key('5');
SIX = new Key('6');
SEVEN = new Key('7');
EIGHT = new Key('8');
NINE = new Key('9');
ARROW_UP = new Key(' ');
ARROW_DOWN = new Key(' ');
ARROW_LEFT = new Key(' ');
ARROW_RIGHT = new Key(' ');
SHIFT = new Key(' ');
}
How do I cause the keyboard constructor to be called?