Skip to content

Instantly share code, notes, and snippets.

@dpogue
Created November 18, 2023 23:26
Show Gist options
  • Save dpogue/4362a762408770e0d59cafdca7c304ae to your computer and use it in GitHub Desktop.
Save dpogue/4362a762408770e0d59cafdca7c304ae to your computer and use it in GitHub Desktop.
class plClientWindow
{
protected:
pcSmallRect fWindowSize;
public:
plClientWindow() : fWindowSize(0, 0, 800, 600) { }
virtual ~plClientWindow() = default;
/**
* Does any necessary pre-initialization work to set up/configure the
* environment before trying to create a window.
*
* Returns false on failure, which will stop the client launch.
*/
virtual bool PreInit() { return true; }
/**
* Creates the client window, but does not display it on the screen.
*
* Returns false on failure, which will stop the client launch.
*/
virtual bool CreateClientWindow() = 0;
/**
* Makes the client window visible on the screen.
*/
virtual void ShowClientWindow() = 0;
/**
* Process any OS/Window events that are in the queue.
*
* This essentially runs the event loop until there are no more messages,
* then returns to allow the plClient MainLoop to continue.
*
* Returns false on an exit message, which will cause plClient to quit.
*/
virtual bool ProcessEvents(plClient* client) = 0;
/**
* Does any necessary cleanup work to deinitialize the window.
*/
virtual void DeInit() = 0;
virtual hsWindowHndl GetWindowHandle() const = 0;
virtual hsWindowHndl GetDisplayHandle() const = 0;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment