TasksInProgress
TasksInProgress
Graphics Window API
IGraphicsWindow interface
GraphicsWindowWin32 implementation
GraphicsWindowX11 implementation
GraphicsWindowCarbon implementation (OSX)
GraphicsWindowCocoa implementation (OSX, preferred)
1class IGraphicsWindow {
2public: 3// X11 only? 4 chooseVisual();
5 6 createContext();
7 setContext();
8 getContext();
910 createWindow();
11 getWindow();
12 setWindow();
1314// convience methods15 std::string getWindowTitle();
16void setWindowTitle(std::string);
1718// determine how we'll handle "icons." 19 Icon getWindowIcon();
20void 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 :
CWindowsDisplay
CCocoaDisplay
CCarbonDisplay
CXDisplay
CWaylandDisplay (the library which will replace X for future versions of Ubuntu)
CDirectFBDisplay (for DirectFB)
And even perhaps :
CQtDisplay
CGtkDisplay
etc...
All of them should be shared libs to be able to switch.