🎉 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!

PWindow and IVideoDriver

Published December 27, 2005
Advertisement
Hi, how are you??

well, proceeding, let me explain the IVideoDriver class...

Check out the code:

IVideoDriver

public:  virtual void RestoreDefaultSettings(void) = 0;  virtual void PrepareScene(void) = 0;  virtual void DrawScene(HDC AHDC) = 0;  virtual void ResizeDriver(SRect* ADimension) = 0;  virtual void SetClearColor(SColor* AColor)= 0;


The IVideoDriver is just an interface that contains all the drawing functions (until now just the "prepare" functions, none of REAL drawing is done) of the engine... the POpenGLDriver only implement this interface with OpenGL methods.

All the graphicobjects have a pointer to IVideoDriver to perform its drawing.

Now..the PWindow class..one of most important classes:

PWindow: PInputEventReceiver

private:  bool FFullScreen;  bool FNeedResize;		  std::string FName;  std::string FCaption;  SColor* FBackgroundColor;  HWND FHandle;  HDC FHDC;  HGLRC FHRC;  HCURSOR FCursor;public:  PWindow(std::string AWindowName, SRect* ABounds, IVideoDriver* AVideoDriver);  ~PWindow();		  bool GetFullScreen(void);  void SetFullScree(bool AValue);		  bool GetNeedResize(void);  void SetNeedResize(bool AValue);  void Show();  void Hide();		  std::string GetName(void);		  std::string GetCaption(void);  void SetCaption(std::string AValue);  SColor* GetBackgroundColor(void);  void SetBackgroundColor(SColor* AValue);		  HWND GetHandle(void);  void SetHandle(HWND AValue);		  HDC GetHDC(void);  void SetHDC(HDC AValue);		  HGLRC GetHGLRC(void);  void SetHGLRC(HGLRC AValue);		  void Draw();


This class control the windows of the application. Until now there are no complex methods that need explanation..maybe in the future =P

Okay, tomorrow I'll show the example of a simple Main.cpp that create and show a window with a background color.

Any suggestion or question...comment please =D

Thanx
See you tomorrow..
0 likes 2 comments

Comments

HopeDagger
Everything is looking to be shaping up rather elegantly thus far. It's pretty obvious that you're no novice programmer, and you have plenty of design moves and techniques that are proving to provide sound structure to the engine.

I'll keep on reading as long as you keep on writing. :) Who knows, maybe I'll learn something myself!
December 27, 2005 07:28 PM
Kerkhoff
I appreciate your interest =D

Certainly I'll keep writing and hoping that more people like you, read, learn and teach me about game programming, this is just my first "project"...

again...thanx for your courtesy...
December 27, 2005 08:09 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....

1177 views

Update....

1149 views

Let's play... = )

1103 views

A little doubt

955 views

PLayer

991 views
Advertisement