Open bengland2 opened 6 years ago
Hi Ben,
Many of the examples do "timeout" in the Example::Continue
member function which by default (see: https://github.com/matus-chochlik/oglplus/blob/develop/example/oglplus/example.hpp#L277) indicates that the example should quit after 3 seconds.
Yeah that was lazy of me . Still, it would be nice to have a log message in there saying why it is exiting, more like:
diff --git a/example/oglplus/example.hpp b/example/oglplus/example.hpp
index 53ba72cd..198ebfe4 100644
--- a/example/oglplus/example.hpp
+++ b/example/oglplus/example.hpp
@@ -243,6 +243,8 @@ std::unique_ptr<ExampleThread> makeExampleThread(
const ExampleParams& params
);
+#define DEFAULT_EXIT_TIMEOUT 300.0
+
/// Base class for OGLplus examples
class Example
{
@@ -266,7 +268,12 @@ public:
*/
virtual bool Continue(double duration)
{
- return duration < 3.0; // [seconds]
+ if (duration < DEFAULT_EXIT_TIMEOUT) { // [seconds]
+ return true;
+ } else {
+ std::cout << "default timeout is " << DEFAULT_EXIT_TIMEOUT << std::endl;
+ return false;
+ }
}
/// Hint for the main function whether to continue rendering
I couldn't figure out how to do it with a static const member var because there is no example.cpp.
Hi,
I'll have a look at this, but I'll probably integrate it with the GL debug logging framework if possible. Also the default timeout is intentionally so short. In the rewrite of OGLplus the timeout can be postponed by the user moving the mouse, I'll have a look at that and maybe do the same here.
I got many of oglplus example programs to build on my Fedora 27 system, but when I run them, they seem to spontaneously exit without my pressing any keys or mouse button. There is nothing in the code that suggests they should do this because of a timer, etc. Has anyone seen them? I do see some messages like:
but nothing that looks like an error. Nothing is logged to dmesg or journalctl -fa. No core dump. For example, _build/example/oglplus/001_triangle exits within 4 seconds. What's going on?
Here was how I built:
and here is the log. these RPMs are installed (whatever version is current in F27 now, versions available upon request).
When it does work, the graphics are really neat and put very low load on my CPU showing that shaders are doing their job.