[go: nahoru, domu]

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

new function in API #64

Open
ledinscak opened this issue Mar 23, 2024 · 2 comments
Open

new function in API #64

ledinscak opened this issue Mar 23, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@ledinscak
Copy link

It would be nice to have function
tb_get_cell(x, y)
of some kind that returns content on specific cell. It is complement to function tb_set_cell(...)

For example I want to render something over background that is dynamic, so I need to get first backround of a cell and then overite ch, but bg should remain same.
I can do it with

  struct tb_cell *cell;
  cellbuf_get(&global.back, x, y, &cell);

but it would be better to hide implementation in my opinion and as I said to have complete API.

@ghost
Copy link
ghost commented Mar 30, 2024

https://github.com/termbox/termbox2/blob/master/termbox2.h#L3334
This looks interesting
we could just do the same but with

int tb_get_cell(int x, int y, uint32_t *ch, uintattr_t *fg, uintattr_t *bg);

where the pointers are the data return values and the function's return value is used for error detection.

Currently too lazy to open a PR for this, maybe later :)

@adsr
Copy link
Contributor
adsr commented Mar 31, 2024

PR at #65

There is some overlap with the existing tb_cell_buffer function.

@ledinscak in your case you may want to fetch from the front buffer instead as it will contain the latest rendered cells.

@jumps-are-op To avoid more TB_OPT_EGC ifdefs, my PR uses one tb_cell out param instead of separate out params for ch, fg, bg.

@adsr adsr added the enhancement New feature or request label Mar 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants