Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

premature exit of example programs in Fedora 27? #139

Open
bengland2 opened this issue Jan 4, 2018 · 3 comments
Open

premature exit of example programs in Fedora 27? #139

bengland2 opened this issue Jan 4, 2018 · 3 comments

Comments

@bengland2
Copy link

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:

<message>  multisampled FBO 0-&gt;1
</message>

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:

./configure.sh --no-docs --build --install 2>&1 | tee cfg.log

and here is the log. these RPMs are installed (whatever version is current in F27 now, versions available upon request).

glfw-devel glew-devel glm-devel libpng12-devel libpng-devel boost-devel mesa-libGL-devel mesa-libGLU-devel mesa libGLES-devel

When it does work, the graphics are really neat and put very low load on my CPU showing that shaders are doing their job.

@matus-chochlik
Copy link
Owner

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.

@bengland2
Copy link
Author

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.

@matus-chochlik
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants