openframeworks / openframeworks/openFrameworks

ofAppGLFWWindow issues & improvements

Open
#6,953 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
10.4k
Forks
2.6k
Avg merge
1d 21h
Merged PRs (30d)
9

Description

  • ofSetFullscreen queries all the monitor list more than once (two or three times) for different reasons, we can do a monitor callback and store the data there. I already have the code working for using glfwSetMonitorCallback
  • There is an erroneous assumption that in macOS you have to set position after setting dimensions in a window, but the issue is that one function calls the other, so I'm proposing setting the window position and dimensions from a rectangle (and getting window rectangle too) https://github.com/openframeworks/openFrameworks/issues/6950
  • https://github.com/openframeworks/openFrameworks/issues/6952 - updating GLFW to 3.4.0 fixes some stuff
  • when choosing which monitor the fullscreen will appear I think it makes more sense to get the window rectangle center to check, in the case the window is positioned between two displays
  • when resizing window to fullscreen the framebuffer appears distorted for one frame. it is easier to see with low framerates like 6 fps. I think this is related as how the viewport is updated only in new frames.
  • it seems there is no need to call clear on currentRenderer when getBackgroundAuto() == false now. even if it was needed it could be called on resize_cb and not in the third frame after window resized, as it is now.
  • framebuffer_size_cb calls resize_cb but it is redundant from what I've seen.
  • If you start a software in fullscreen and toggle fullscreen it never recover dimensions
    More about this: in setup if your window is set to fullscreen the window settings are set to the fullscreen size like this:
		auto size = getScreenSize();
		settings.setSize(size.x, size.y);

and windowmode is forcefully set to OF_WINDOW in order to trigger the setFullscreen function, if target and settings are the same, the function returns

		settings.windowMode = OF_WINDOW;

and this act overwrites the settings.setSize original values.
this can be easily solved by different ways, my suggestion is a second optional parameter in setFullScreen

	void		setFullscreen(bool fullscreen, bool force = false);

which allows OF_FULLSCREEN to be set, even when settings already have the same value

Question: is there a situation where the framebuffer dimensions are different than the window dimensions? I thought it was for different retina resolutions but they are always the same here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at ofAppGLFWWindow and trace the fullscreen, window rectangle, monitor callback, resize_cb, framebuffer_size_cb, and renderer-clear paths described in the checklist. Reproduce the fullscreen toggle, monitor selection, resize, and low-framerate cases, then use the linked issues 6950 and 6952 for related context. Done means the agreed windowing and framebuffer issues are resolved and the listed cases behave correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics, desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.