🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

The PDevice Class

Published December 25, 2005
Advertisement
Well, yesterday, because my xmas party, I didn't post here =D

But, like I said, here is my first engine description:

The code:

S[name_of_class] = Classes that describe structs;
P[name_of_class] = Standard classes;
I[name_of_class] = Interfaces;

EN[name] = Enumerators;

F[name] = Attributes;
A[Name] = Parameters;

From the beginning:
I have made some classes (I have not used any structs until now and I don't pretend), to describe the structs that I'll need to use.
SRect, SCoord, SColor. This classes are being used in all the standard classes until now.

My main class, is the PDevice:

PDevice:

private:  PList<PWindow>* FWindows;  PStack<PWindow>* FOpenWindows;    MSG FMessage;  int FActiveWindow;  PWindow* FCurrentWindow;		  IVideoDriver* FVideoDriver;  PMouseDriver* FMouseDriver;  PKeyboardDriver* FKeyboardDriver;		  void RegisterInstance(LPCSTR AWindowName);  void BuildWindow(const LPCTSTR AWindowName, SRect* ADimension, PWindow* ANewWindow);  void PrepareWindowToDraw(PWindow* ANewWindow);      static private LRESULT CALLBACK PDevice::WindowProcedure(HWND AHandle, UINT AMessage, WPARAM AWParam, LPARAM ALParam);public:  PDevice(ENVideoDriver AVideoDriver);  ~PDevice(void);		  PWindow* CreateNewWindow(std::string AWindowName, SRect* ABounds);  PWindow* GetCurrentWindow(void);  IVideoDriver* GetVideoDriver(void);  bool Running(void);  int ActiveWindows(void);		  void Show(std::string AWindowName);  void Hide(std::string AWindowName);  void Refresh(void);  void InitializeMouse(void);  void InitializeKeyboard(void);


This class, have a list of PWindows, that are the windows of application =P. The stack with OpenWindows serve to set the DeviceContext to the previous window when another window is about to be closed.

The video driver, contains the drawing functions (that aren't implemented yet, except the "prepare" and "refresh" routines).

Mouse and keyboard drivers will handle the respective messages.

Another methods are explained by itselves.

Tomorrow I will talk about the PWindow and PVideoDriver class.

Remember, I'm building this framework yet, neither the windows system are ready. I will appreciate any suggestions in how can I approach my system.

Tell me what you think.

Thanx!!!

See ya...
0 likes 4 comments

Comments

johnhattan
How is a PList and a PStack different from the standard stuff?
December 25, 2005 04:39 PM
Kerkhoff
Nothing =D

but I prefer do it to keep a pattern.

have I commited a big error?

Thanx
December 25, 2005 07:20 PM
johnhattan
Not especially. Just go with Pint for your ints too :)
December 26, 2005 01:05 PM
Kerkhoff
heheh this would be the cumulus heuahu
December 26, 2005 07:23 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement

Latest Entries

Another Demo

1125 views

Link resolved....

1176 views

Update....

1149 views

Let's play... = )

1103 views

A little doubt

954 views

PLayer

991 views
Advertisement