Somebody would just want to defer context creation after parsing
arguments or doing some validations without any particular setup, thus
having to write even the {} is annoying.
Added missing tryCreateContext() implementations. Error messages are
printed only by tryCreateContext(), createContext() is only a thin
wrapper which exits the application if tryCreateContext() fails and
doesn't print any additional information on the output.
Hopefully I didn't break anything :-)
They are now not exposed to the user at all, as their API will be
probably changed and reworked in the future to allow GLX/EGL-specific
extension to be used. Also this looks scary in the documentation.
In addition to 37e4f9d6f7 which did the
change for Sdl2Application (because Emscripten required it), making sure
that everything (except GLUT, which does it by default) behaves the
same.
Moreover, some applications don't expect viewport size changes at all
(e.g. the app can't change size of immutable texture used for rendering)
and thus the original way to defer the initialization until
viewportEvent() is called would be overly complicated.
Also, since framebuffer classes store viewport size in them, there is no
need to call viewportEvent() on initialization. The current ways to do
the initial call in Sdl2Application, *XApplication and NaClApplication
were nothing more than ugly workarounds for mimicking GLUT behavior,
which is bad.
Lastly, to be sure that nothing breaks in user apps, I did this change
in magnum-bootstrap long ago and all bootstrap application behave the
right way.
Resolves some linker errors in Windows, removes code bloat from Platform
namespace (previously it was copied in _every_ *Application).
Originally this was in Platform namespace because I thought that it
would be possible to have one version of Magnum library for both desktop
and ES and the actual Application would determine which GL edition will
be used. Fun idea, but it would remove the static checks (e.g.
accidentaly using geometry shaders on ES), which isn't worth it.
Removed all known GLEW workarounds, added one small workaround for
missing ARB_texture_compression_bptc. I didn't want to patch glLoadGen
for just four enum values, this way it's possible to use stock one
without any patching (except for missing OpenGL 2.1 support, as stated
in external/OpenGL/GL/README.md).
As one file now replaces both `glew.h` and `glcorearb.h` and it has the
same size as `glcorearb.h` alone , it saves approximately 18k LOC,
resulting in 15 second shorter compilation time (5:03 before, 4:48 now).
Not bad.
Each implementation of *Application::Configuration will have different
methods tailored to feature set of the underlying toolkit. Currently
each windowed application's Configuration has only window title (except
NaClApplication) and window size. WindowlessGlxApplication has empty
class. More features will come later. Also created introductionary
documentation for Platform namespace.
Because with NaCl WindowContext doesn't make sense anymore, the classes
are now renamed:
* Contexts namespace -> Platform
* *WindowContext -> Application
Hopefully this is (one of) last crazy renaming runs.