-
Notifications
You must be signed in to change notification settings - Fork 56
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
Flickering #240
Comments
@iganinja Hello, thanks for your nice words. Some changes has been done related to resizing and maybe this create new issues. Would you mind give some codes to test ? What do you call Does this happen when you change the size of your terminal? have you tried to use the new way provided by #234 (in https://github.com/jupyter-xeus/cpp-terminal/blob/master/examples/menu.cpp). The API has changed quite a lot and it is still not fixed; pulling gives you the new features but would need to change your code too, that's why there is not official new version. I'm just proposing some change and @MCWertGaming is the maintainer of the package |
Hi @flagarde, thanks for your answer. I have this currently: (Yeah, colors are horrible, but they will be configurable 😂 ) I'm waiting to input with With flickering I mean that whole screen was blinking, some frames were drawn black, or the screen filling was noticeable. That was happening until I pulled When I change the size of the terminal strange artifacts occur and also some blinking, but this doesn't bother me, it's normal even in graphical applications. After I stop resizing everything works perfectly. I didn't try the new way provided in the link you mention, I use the |
@iganinja I know they were some bug before the last merge in windows. Please note that key can be NO_KEY so you should add a test case for this. The reason is that read_raw return Event that can be other things than Key. But it is allowed to cast Event to Key and in the case the event is not a key, the key is then NO_KEY. I recommend you to use the same trick than in menu.cpp in the example. Maybe you don't have to do the wait by yourself. You could use |
@iganinja This is fixed ? |
Hi! |
@iganinja thx for the feedback. We can let this open then.. Not sure if it's a problem from the library of from Window$. Maybe there is some hack we could use I remember some discussion about this. Are you using cout or Term::terminal<< ? |
|
@iganinja nice Turbo Pascal style menus. :) It would be nice to have them as widgets in cpp-terminal eventually. |
I noticed flickering too in my application as you described on Windows but not on Linux. I figured it was probably an issue with the frame rate of the console or when the console triggers a new redraw of the screen. I guessed that the Windows console maybe has a higher frame rate so it is more likely to trigger a redraw just after the Maybe that helps |
I wonder if it's not the contrary the console in windows is poorly optimized. Are you using Term::terminal or cout. I heard somewhere cout is not buffered or things like this in windows or a very small buffer |
I notized it with both. but part of my change from not using |
@TobiasWallner Your solution is general or a bit hacky? If it's a general one I think this could be incorporated into this library as it would be a very nice addition 😀 |
it is general to my application but probably specific in terms of your library. It is only applies to the design elemts of my projet like grids, labels, editable text fields, comman lines and the like. The idea is that each element has functions that change something, like inserting a character or moveing the cursor. They will do that + give you a render of the changes which is just a move to the one character and the new value. |
I see, so it seems the problem is the clearscreen ? |
yes I think so |
@TobiasWallner I'm trying to implement a more system base API to wrtite to console. I have been told the C C++ Windows is quite buggy and not so efficient sometimes. I already did a first step with file.hpp but need to improve it. Maybe this will improve performance. I have seen an other way to improve performance I will do a PR for this I didn't benchmark as i'm doind on virtualbox so the results it's maybe not what one should expect but I can see it by eyes so lets implement and check on other system |
I could run a benchmark natively if you want me too. |
@TobiasWallner Would be great or to have a program with benching on this repo :) |
I was wondering, you do have a class that stores one frame, the window class, right? could look like this:
|
We already do the diff, although the diff is quite "primitive": cpp-terminal/cpp-terminal/window.cpp Line 199 in a40326c
However, the demos that we have don't seem to flicker for me. |
Hi
I'm using cpp-terminal to program a small text editor where I want to perform some programming experiments, and also to contribute to the library as a user. I'm glad the cpp-terminal exists, it's easy to "paint" things in a multiplatform way, and I have some stuff already running in Windows, Linux and RPI3. So thanks to all contributors!
My question is, and sorry if this is not the correct place to ask it, what's the supposed behavior of the library related to flickering? I'm using the
Window
class in order to render the final string, which I print withstd::cout
andstd::flush
. I draw the whole terminal, by the way. That is, I get terminal size at the beginning and use it to configure theWindow
instance.I'm updating the library frequently (I mean, pulling it from its repository), and yesterday it was flickering like crazy, specially in Windows. Some minutes ago I updated the library again and now it seems it has no flickering at all.
So, I understand that it should not flicker if I use the
Window
class as I mentioned. Is this correct?Thanks in advance.
The text was updated successfully, but these errors were encountered: