Archived

This topic is now archived and is closed to further replies.

D_JildQuantum

What Else?

Recommended Posts

What Else should i add to my Flexible framework that i want to use for all future games? ill post the code i have when i can remember how to make a code box :-S Quantum

Share this post


Link to post
Share on other sites
Heres my code from CApplication.h:

#ifndef CAPPLICATION_H
#define CAPPLICATION_H

#include "CMessageHandler.h"

class CApplication: public CMessageHandler
{
private:
static CApplication* s_pTheApplication;
static HINSTANCE s_hInstance;
public:
CApplication();
virtual ~CApplication();
static HINSTANCE GetHINSTANCE();
virtual bool OnInit()=0;
virtual void OnIdle()=0;
virtual void OnTerminate()=0;
static int Execut(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd);
static CApplication* GetApplication();
}

#endif

CMessageHandler.h:

#ifndef CMESSAGEHANDLER_H
#define CMESSAGEHANDLER_H

class CMessageHandler
{
private:
CMessageHandler* m_pmhParent;
public:
CMessageHandler(CMessageHandler* pmhParent);
virtual ~CMessageHandler();
void SetMessageParent(CMessageHandler* pmhParent);
CMessageHandler* GetMessageParent();
bool HandleMessages(int MessageID, int argc, void* argv[]);
virtual bool OnMessage(int MessageID, int argc, void* argv[]=0);
};

#endif

and CEventHandler.h:

#ifndef CEVENTHANDLER_H
#define CEVENTHANDLER_H

#include "CMessageHandler.h"

class CEventHandler: public CMessageHandler
{
private:
static ATOM s_WndCls;
HWND mhWnd;
public:
CEventHandler(CMessageHandler* pmhParent);
~CEventHandler();
operator HWND();
HWND GetHWND();
void SetHWND(HWND hWnd);
virtual bool HandleEvent(UINT uMsg, WPARAM wParam, LPARAM lParam);
virtual bool OnEvent(UINT uMsg, WPARAM wParam, LPARAM lParam);
virtual bool OnMouseMove(int ix, int iy, bool bShift, bool bControl, bool bLeft, bool Right, bool bMiddle);
virtual bool OnLButtonDown(int ix, int iy, bool bShift, bool bControl, bool bLeft, bool Right, bool bMiddle);
virtual bool OnLButtonUp(int ix, int iy, bool bShift, bool bControl, bool bLeft, bool Right, bool bMiddle);
virtual bool OnRButtonDown(int ix, int iy, bool bShift, bool bControl, bool bLeft, bool Right, bool bMiddle);
virtual bool OnRButtonUp(int ix, int iy, bool bShift, bool bControl, bool bLeft, bool Right, bool bMiddle);
virtual bool OnKeyDown(int iVirtKey);
virtual bool OnKeyUp(int iVirtKey);
virtual bool OnChar(TCHAR tchCode);
virtual bool OnCreate();
virtual bool ONDestroy();
virtual bool OnPaint(HDC hdc, const PAINTSTRUCT* pPaintStruct);
static void CreateWindowClass();
static LRESULT CALLBACK WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
};

#endif


Im looking for any classes to add to it to make it a stronger, more flexible, all purpose Famework. Thank you, and i just need Ideas of what the classes should be, i want to write them myself. Thank you again!

Quantum

Share this post


Link to post
Share on other sites