Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

The PDevice Class

Sign in to follow this  


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:


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);

PDevice(ENVideoDriver AVideoDriver);

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.


See ya...
Sign in to follow this  


Recommended Comments

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!