Hi, I'm trying to write my game engine and I'm stucked up here;
I basicly want to create a window, here is my ErEngine.h file,
class ErEngine{
Properties Er_Properties;
public:
LRESULT Er_CreateWindow(HINSTANCE hInst, int nCmdShow);
LRESULT CALLBACK Er_WindowProc(HWND hWnd,UINT message,WPARAM wParam,LPARAM lParam);
};
And here is my ErEngine.cpp file,
#include <windows.h>
#include <windowsx.h>
#include "ErEngine.h"
LRESULT CALLBACK ErEngine::Er_WindowProc(HWND hWnd,UINT message,WPARAM wParam,LPARAM lParam)
{
};
LRESULT ErEngine::Er_CreateWindow(HINSTANCE hInstance, int nCmdShow)
{
HWND hWnd;
WNDCLASSEX wc;
ZeroMemory(&wc, sizeof(WNDCLASSEX));
wc.cbSize = sizeof(WNDCLASSEX);
wc.style = CS_HREDRAW | CS_VREDRAW;
//////////////////////////////////////////////////////////////////////////////////////
wc.lpfnWndProc = ErEngine::Er_WindowProc;
//here is my problem :(
//////////////////////////////////////////////////////////////////////////////////////
wc.hInstance = hInstance;
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH)COLOR_WINDOW;
wc.lpszClassName = "WindowClass1";
RegisterClassEx(&wc);
hWnd = CreateWindowEx(NULL,
"WindowClass1",
"Our First Windowed Program",
WS_OVERLAPPEDWINDOW,
300,
300,
500,
400,
NULL,
NULL,
hInstance,
NULL);
ShowWindow(hWnd, nCmdShow);
};
It doesnt accept a Class-function as windowproc.. no matter if I write it ErEngine::Er_WindowProc or just Er_WindowProc or (WNDPROC)Er_WindowProc..
What should I do? And Thank you for your helps :)