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..
I'll keep on reading as long as you keep on writing. :) Who knows, maybe I'll learn something myself!