|
|
|
|
@ -338,7 +338,8 @@ struct Sdl2ApplicationTest: Platform::Application {
|
|
|
|
|
void drawEvent() override { |
|
|
|
|
Debug{} << "draw event"; |
|
|
|
|
#ifdef MAGNUM_TARGET_GL |
|
|
|
|
GL::defaultFramebuffer.clear(GL::FramebufferClear::Color); |
|
|
|
|
if(!_contextless) |
|
|
|
|
GL::defaultFramebuffer.clear(GL::FramebufferClear::Color); |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
#ifndef CORRADE_TARGET_EMSCRIPTEN |
|
|
|
|
@ -347,7 +348,8 @@ struct Sdl2ApplicationTest: Platform::Application {
|
|
|
|
|
Debug{} << Key::M << "is pressed"; |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
swapBuffers(); |
|
|
|
|
if(!_contextless) |
|
|
|
|
swapBuffers(); |
|
|
|
|
|
|
|
|
|
if(_redraw) |
|
|
|
|
redraw(); |
|
|
|
|
@ -516,6 +518,7 @@ struct Sdl2ApplicationTest: Platform::Application {
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
private: |
|
|
|
|
bool _contextless = true; |
|
|
|
|
#ifdef CORRADE_TARGET_EMSCRIPTEN |
|
|
|
|
bool _fullscreen = false; |
|
|
|
|
#endif |
|
|
|
|
@ -539,6 +542,7 @@ Sdl2ApplicationTest::Sdl2ApplicationTest(const Arguments& arguments): Platform::
|
|
|
|
|
#ifdef MAGNUM_TARGET_GL |
|
|
|
|
.addBooleanOption("quiet").setHelp("quiet", "like --magnum-log quiet, but specified via a Context::Configuration instead") |
|
|
|
|
.addBooleanOption("gpu-validation").setHelp("gpu-validation", "like --magnum-gpu-validation, but specified via a Context::Configuration instead") |
|
|
|
|
.addBooleanOption("contextless").setHelp("contextless", "initialize without an OpenGL context") |
|
|
|
|
#endif |
|
|
|
|
.parse(arguments.argc, arguments.argv); |
|
|
|
|
|
|
|
|
|
@ -561,20 +565,30 @@ Sdl2ApplicationTest::Sdl2ApplicationTest(const Arguments& arguments): Platform::
|
|
|
|
|
#endif |
|
|
|
|
#endif |
|
|
|
|
#ifdef MAGNUM_TARGET_GL |
|
|
|
|
GLConfiguration glConf; |
|
|
|
|
if(args.isSet("quiet")) |
|
|
|
|
glConf.addFlags(GLConfiguration::Flag::QuietLog); |
|
|
|
|
/* No GL-specific verbose log in Sdl2Application that we'd need to handle
|
|
|
|
|
explicitly */ |
|
|
|
|
if(args.isSet("gpu-validation")) |
|
|
|
|
glConf.addFlags(GLConfiguration::Flag::GpuValidation); |
|
|
|
|
create(conf, glConf); |
|
|
|
|
#else |
|
|
|
|
create(conf); |
|
|
|
|
if((_contextless = args.isSet("contextless"))) |
|
|
|
|
#endif |
|
|
|
|
{ |
|
|
|
|
#ifdef MAGNUM_TARGET_GL |
|
|
|
|
conf.addWindowFlags(Configuration::WindowFlag::Contextless); |
|
|
|
|
#endif |
|
|
|
|
create(conf); |
|
|
|
|
} |
|
|
|
|
#ifdef MAGNUM_TARGET_GL |
|
|
|
|
else { |
|
|
|
|
GLConfiguration glConf; |
|
|
|
|
if(args.isSet("quiet")) |
|
|
|
|
glConf.addFlags(GLConfiguration::Flag::QuietLog); |
|
|
|
|
/* No GL-specific verbose log in Sdl2Application that we'd need to handle
|
|
|
|
|
explicitly */ |
|
|
|
|
if(args.isSet("gpu-validation")) |
|
|
|
|
glConf.addFlags(GLConfiguration::Flag::GpuValidation); |
|
|
|
|
create(conf, glConf); |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
#if defined(MAGNUM_TARGET_GL) && !defined(MAGNUM_TARGET_WEBGL) |
|
|
|
|
Debug{} << "GL context flags:" << GL::Context::current().flags(); |
|
|
|
|
if(!_contextless) |
|
|
|
|
Debug{} << "GL context flags:" << GL::Context::current().flags(); |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
/* For testing resize events */ |
|
|
|
|
|