I am trying to get a WndProc Mapping solution to work so that I can avoid just making my WndProc static. In addition, a mapping solution is supposed to be great because I don't need to declare variables in my .cpp file, I can do it in my .h file like it should be.
However, this is exactly my problem: if you uncomment lines 3 and 4 of GameManager.cpp and you comment lines 24 and 25 of GameManager.h, the program runs just fine. But, I need it to be the other way around! Instead what happens is the window opens and closes abruptly. Any insight would be greatly appreciated:
*Edit: sorry if the post is too long, I'm new to these forums. If it's too long just let me know and I'll cut out things I *think* are not causing this issue. However, a big reason I left it is so someone can compile it (it should compile and run straight out of the box!).
main.cpp:
#include "GameManager.h" // Include our GameManager and let it handle everything.
#include <windows.h>
int WINAPI WinMain( HINSTANCE hInstance, // Instance
HINSTANCE hPrevInstance, // Previous Instance
LPSTR lpCmdLine, // Command Line Parameters
int nCmdShow) // Window Show State
{
GameManager gameManager;
GameManager *gm = &gameManager;
return gm->run();
}
GameManager.h:
#ifndef GAMEMANAGER_H
#define GAMEMANAGER_H
#pragma comment(lib, "opengl32.lib")
#pragma comment(lib, "glu32.lib")
#include <windows.h> // Header File For Windows
#include <gl\gl.h> // Header File For The OpenGL32 Library
#include <gl\glu.h> // Header File …