TasksInProgress

TasksInProgress

 

Graphics Window API

 1class IGraphicsWindow {
 2public:
 3    // X11 only?
 4    chooseVisual();
 5
 6    createContext();
 7    setContext();
 8    getContext();
 9
10    createWindow();
11    getWindow();
12    setWindow();
13
14    // convience methods
15    std::string getWindowTitle();
16    void setWindowTitle(std::string);
17
18    // determine how we'll handle "icons." 
19    Icon getWindowIcon();
20    void setWindowIcon(Icon ico);
21};

We could move almost all methods from driver_opengl_window.cpp in this class.

All stuff related to screens, windows, icons, cursors, etc... should be implemented there.

The problem is : where to put GL initialization functions ? such as GLX, WGL, etc... there are most depending on system but will certainly add a dependency on OpenGL.

This class could be non graphical too, ie provide a offscreen renderer and/or not providing a window.

I propose to use IDisplay as interface name, because a display could be a console (with a backbuffer), a window or a screen (if windows doesn't exist).

IDisplay :

And even perhaps :

All of them should be shared libs to be able to switch.