Navigation Menu

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

setDoubleBuffering(false) causes no output (black screen) #6612

Closed
liasomething opened this issue Sep 1, 2020 · 4 comments
Closed

setDoubleBuffering(false) causes no output (black screen) #6612

liasomething opened this issue Sep 1, 2020 · 4 comments
Assignees

Comments

@liasomething
Copy link
Contributor

to reproduce:

  1. open ofBoxExample
  2. in main.cpp replace
    ofSetupOpenGL(1024,768, OF_WINDOW);
    with
ofAppGLFWWindow window;
window.setDoubleBuffering(false);
ofSetupOpenGL(&window, 1024,768, OF_WINDOW);
  1. compile and run

expected result: boxes on screen
actual result: black screen

of0.11, osX catalina 10.15.6

I downloaded master, but could not figure out how to make a project, as the project generator is missing.

@ofTheo
Copy link
Member

ofTheo commented Sep 2, 2020

Hi @liasomething !

From what I remember single buffering doesn't work on all platforms or graphics cards.
Are you trying to accumulate the screen buffer or is there a reason you want to disable double buffering?

If you want to accumulate the screen buffer you can do this in ofApp::setup()

    ofBackground(0, 0, 0);
    ofSetBackgroundAuto(false);

If that solves your issue feel free to close it.
If not it would be helpful to know more about what you are trying to achieve.

Cheers!
Theo

@ofTheo ofTheo self-assigned this Sep 2, 2020
@liasomething
Copy link
Contributor Author

Hi Theo,

I need to turn off double buffering, because at some point in my app I stop rendering (to deliberately pause the app) and with double buffering turned on and ofSetBackgroundAuto(false) the screen flickers between the last two frames rendered. Rendering into an fbo would solve my problem, but I assumed that if OF had a function called setDoubleBuffering() and I called it with false and did not get any error message, it would disable double buffering, silly me ! ;)

all the best
Lia.-

@ofZach
Copy link
Contributor

ofZach commented Sep 14, 2020

it sounds like it should :). just a quick note that I see this line ifdef'd out for OS X

https://github.com/openframeworks/openFrameworks/blob/master/libs/openFrameworks/app/ofAppGLFWWindow.cpp#L178-L180

I'm not 100% why but maybe worth investigating if that's why it doesn't work properly on osx.

@liasomething
Copy link
Contributor Author

Hi Zack,
thanks !
so, commenting out the ifndef did not help, but adding a hint for GLFW_DOUBLEBUFFER did:

// #ifndef TARGET_OSX
    //glfwWindowHint(GLFW_AUX_BUFFERS, settings.doubleBuffering ? 1 : 0 );
    glfwWindowHint(GLFW_DOUBLEBUFFER, settings.doubleBuffering ? GL_TRUE : GL_FALSE );
// #endif

i haven't tested this anywhere else, but it works for me.

all the best
Lia.-

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

3 participants