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

Single buffer issues #410

Closed
60-hz opened this issue Jan 18, 2024 · 7 comments
Closed

Single buffer issues #410

60-hz opened this issue Jan 18, 2024 · 7 comments

Comments

@60-hz
Copy link
Contributor

60-hz commented Jan 18, 2024

MacOS with gemglfw3window, here is a simple patch to test:

single buffer issues.pd.zip

@artiom-constantinov
Copy link

hi, just wanted to report that 'buffer 1' message for gemwin is not working as the old versions.
I'm on win 11

untitled.mp4

@60-hz
Copy link
Contributor Author

60-hz commented Feb 1, 2024

  • I think that you are not supposed to send "1" to gemwin in single buffering mode.
  • But you should manually send a "bang" to [gemhead] whenever you need to draw something...

Please test single buffer issues.pd.zip and report if it works for you. Weirdly enough I just tried with last deken version under MacOS (GEM: ver: 0.94.git v0.94-837-g56612c012) and I can draw using a bang to [gemhead] and also to [gem/gemhead] abstraction now...

@artiom-constantinov
Copy link

I downloaded again the last gem version from deken, and now it works like this, so it should be the right way, yes? but does this mean that in the past when I was switching from buffer 1 to buffer 2 and it was rendering everything like it's doing now, but with the metro triggering the gemhead, was a bug? becuase it was very usuful not to have to trigger all the gemheads in the buffer 1 mode, and to have the possibility to swtich between those modes on spot
https://github.com/umlaeute/Gem/assets/158454035/8dd322ce-82d5-4d3a-b91b-b9a3a55627a4

@60-hz
Copy link
Contributor Author

60-hz commented Feb 1, 2024

  • I think that you are not supposed to send "1" to gemwin in single buffering mode.
  • But you should manually send a "bang" to [gemhead] whenever you need to draw something...

Please test single buffer issues.pd.zip and report if it works for you. Weirdly enough I just tried with last deken version under MacOS (GEM: ver: 0.94.git v0.94-837-g56612c012) and I can draw using a bang to [gemhead] and also to [gem/gemhead] abstraction now...

I note that triggering [gemhead] under MacOS single buffering actually draws, but returns a red error at every render:

gemlist: no method for 'context_active'
It does not trigger this error with [gem/geamhead].

I downloaded again the last gem version from deken, and now it works like this, so it should be the right way, yes? but does this mean that in the past when I was switching from buffer 1 to buffer 2 and it was rendering everything like it's doing now, but with the metro triggering the gemhead, was a bug? becuase it was very usuful not to have to trigger all the gemheads in the buffer 1 mode, and to have the possibility to swtich between those modes on spot
https://github.com/umlaeute/Gem/assets/158454035/8dd322ce-82d5-4d3a-b91b-b9a3a55627a4

Changing mode on spot is only possible since [gemglfw3window] is used as default, which allows many new message to be sent after windows creation. It's an interesting new feature yes, but then this message printed to the console is wrong and need to be removed:

[gemglfw3window]: changing buffer type will only effect newly created windows

@umlaeute
Copy link
Owner

umlaeute commented Feb 5, 2024

I've fixed the gemlist: no method for 'context_active' error (let's see what i broken by that).

as for the [gemglfw3window]: changing buffer type will only effect newly created windows warning:
Gem is actually right that you cannot really switch between single and double buffered on the fly.

however, when creating a single-buffered window and then (attempt to) switch to double-buffered mode, the automatic-rendering¹ (by sending a [1( to the [gemwin]) will clear the buffer, thus giving a similar result to double-buffered mode.

for now, I've turned the warning into a one-shot warning (that is: it's only emitted the first time you try to switch the buffer mode).

¹ i think that @60-hz is right that (iiuc) that auto-rendering was not supposed to work in single-buffered mode. it does now. not sure whether this should be turned into a promise :-)

PS: please don't use [gem/gemhead]: this only works because you are on a case-insensitive filesystem (e.g. here it would be [Gem/gemhead]. i think a better way to force the abstraction is to just use [./gemhead]

@umlaeute
Copy link
Owner

umlaeute commented Feb 5, 2024

I note that triggering [gemhead] under MacOS single buffering actually draws, but returns a red error at every render:

gemlist: no method for 'context_active'
It does not trigger this error with [gem/geamhead].

also note, that this error actually only appears (well: appeared) if you are mixing [gemhead] and [./gemhead], not if you are only using (as in: having in your patch) one or the other.

anyhow, it should be fixed.

@umlaeute
Copy link
Owner

umlaeute commented Feb 5, 2024

The creation of a window in single buffer mode needs the buffer to be cleared once before use, otherwise its size is wrong. (The old behavior didn't need to manually clear buffer before using it).

and this i couldn't reproduce (but i might have misunderstood the problem).
it's true that [gemglfw3window] - unlike eg [gemglxwindow] - would not report the dimension on window creation (only the framebuffer size). i've changed this to also report the window size.

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

No branches or pull requests

3 participants