Commit Graph

506 Commits (0330919564547b76163c4bfcc55eb329197162f2)

Author SHA1 Message Date
nick black 8d26803ed8
fix linear interpolation on large geometries #216 5 years ago
nick black 7424b3b78c
grid: fix boundary conditions on large displays 5 years ago
nick black 4ba9845143 grid: better background on last scene 5 years ago
nick black 1554685165
boxdemo: default background cell explicitly #211 5 years ago
nick black 4b953e33f2
render: carry state across renders #203 5 years ago
nick black e8064f717b
xray: kill subplane when done 5 years ago
nick black 43e0cb3d30
xray: prep for CELL_ALPHA_BLEND #191 5 years ago
nick black ca5e14cdad
xraydemo: isolate avi/text 5 years ago
nick black 53efe2bd1f
demo-view: don't exit on spurious wakeup 5 years ago
nick black 2601fe9191
demo-input: pass 'q' through in addition to interrupt 5 years ago
nick black a14ec34d78
intro: blink warning if screen is small 5 years ago
nick black 4e0ebde876
intro: advertise 'q' demo: print full matrix 5 years ago
nick black 9e9e5ef648
demoinput: process 'q' at all times 5 years ago
nick black 1017bf42e0
panelreeldemo: stop advertising 'q' 5 years ago
nick black 17a55261dc
witherworms: allow them more space 5 years ago
nick black 86efad6f67
griddemo: clip rgb values, kill white line on side 5 years ago
nick black efcfa372ae
ULTRAMEGAOK: toplevel event handler #207
enable mouse events in the demo. spawn a thread from main() which
brokers all input events. it will consume mouse events, and
publish keyboard events to a queue. rewrite all demo notcurses_getc()
calls to demo_getc() equivalents.
5 years ago
nick black 452e1d302e
output API enhancements #210 #209
Allow -1 in move specification to remain where we are on that
axis (#210), necessary for context-sensitive aligned output.
Add _aligned forms to printf and vprintf. Invert various output
functions so that simpler form is static inline wrapper around
more complicated form, rather than complicated form being a
static inline composition, facilitating atomic move+output. All
output forms now have a simple form (no alignment, placement at
cursor), an _aligned() form, and a _yx() form.
5 years ago
nick black f742676aee Mouse support using button event tracking #165
Request and parse up mouse messages. We handle up to 11 mouse
buttons, 3 modifiers (currently thrown away), motion while
holding down a button, and loss/gain of focus. I've added twelve
new NCKEYs: one for each button, and one for release. In addition,
I've introduced the 'ncinput' struct, which encodes the nckey plus
extra data. The only extra data thus far is coordinates for mouse
events. It is not necessary to provide a ncinput to all input
functions; NULL can be provided if the caller doesn't care about
details. All demos are updated. notcurses-input has been updated
to decode full information of returned ncinputs.

The primary resource for this work was Dickey at al's "XTerm Control
Sequences", https://invisible-island.net/xterm/ctlseqs/ctlseqs.html.
5 years ago
nick black aceda89261 input: add NCKEY_MOUSEEVENT, match against CSI prefix #165 5 years ago
nick black b4b4b3684a yaml 5 years ago
nick black 1555edfa6c
notcurses: disable mouse events on startup/shutdown 5 years ago
nick black 78633de427
mouse: use SGR extended coordinates 5 years ago
nick black ae52d04435
notcurses-input: dim previous lines 5 years ago
nick black ab47ab8976
notcurses_mouse_on()/_off() #165 5 years ago
nick black 046d0314b9
add links to useful man pages 5 years ago
nick black fe7b6bbf89
Samoa, tula'i ma sisi ia lau fu'a, lou pale lea! 5 years ago
nick black f9e18fa1ee
witherworms breed, paint xray banner 5 years ago
nick black 2a256192ad
input: allow duplications of escapes #199 5 years ago
nick black 6b6a00c013
luigi: jump off the right side of the screen 5 years ago
nick black 605293c103
deretardize the witherworms 5 years ago
nick black 708159c686
x-ray demo 5 years ago
Nick Black 4278a53523
Dankamongmen/no prisoners damage (#198)
* notcurses: set up lastframe #189
* render: o(1) take no prisoners damage detection
* EAAAAAAAAAAGLES
* slight background on intro
* 0.9.2
5 years ago
Nick Black 9b81de3789
O(1) passive damage detection #189 (#197)
* notcurses: set up lastframe #189
* render: o(1) take no prisoners damage detection #189
5 years ago
nick black 8b1b2ebdf0
term_esc_rgb: add note about ITU T.416 syntax 5 years ago
nick black d50ee9ec50
ncplane_erase() at the beginning of viewdemo #194 5 years ago
nick black c3fa7ea664
bleachworm replaces widechomper #177 5 years ago
nick black a710222df1
enmetric(): support localized decimal separator #192 5 years ago
Nick Black 3ad2124246
Partial visual renders #170 (#193)
* ncvisual_render() accept four bounding dims #175
* ncvisual_render(): partial renders #175
5 years ago
nick black 7f01dfc241
planereel-tester: delete support 5 years ago
nick black eaf510676d
planereel-tester: randomly-sized tablets #180 5 years ago
Nick Black 0e0925a84e
Planereel exploration app, panelreel logic fixes (#188)
* planereels tester #180
* suppress_banner in all tests
* tabletcb: start passing back tablet
* properly initialize fbbytes stat
* panelreel: logic fixes #178
* install all testing data
5 years ago
nick black b0b1679de6
ncvisual_render(): use true transparency #186 5 years ago
nick black 5403642764
notcurses-input: throw up a banner 5 years ago
nick black 1ebe02cf93
libav: disable stderr logging #174 5 years ago
nick black 0e6c921b28
we break 1k fps in kitty :) 5 years ago
nick black 898806fec1
demo: minimum field width on FPS 5 years ago
nick black 3f326ee0a8 fix up ncplane_set_{bf}g 5 years ago
nick black 21a8e661be
convert all demos to find_data() 5 years ago
nick black 660949a461
griddemo: fix wonky right line 5 years ago
nick black 4950a5ac1a
print enmetricized byte totals 5 years ago
nick black 792b1f2cfb
notcurses-demo: accept -p to find data files #160 5 years ago
nick black db89e71595
track each part of demo #164 5 years ago
nick black 5bec85746d
allow banners to be suppressed 5 years ago
nick black 32e9fd0a1d
notcurses_reset_stats() added + test #164 5 years ago
nick black 15ac1d0411
outro: balance up messages for centering 5 years ago
nick black 11d6f60ed4
clean up eagle poop 5 years ago
nick black 6be6ae2393 eagles: zoom to lower left 5 years ago
nick black 1dde53d0e2 holy fucking shit it works 5 years ago
nick black d6bcb3211f eagles level starts at lower-right 5 years ago
nick black 712c7a16eb fuck yeah 5 years ago
nick black 7ab6febbf9 viewdemo: add a legend. baller as fuck 5 years ago
nick black b257f40a35 sync input documentation for char32_t #172 5 years ago
nick black 0861b96bde wchar_t -> char32_t in input stack #171 5 years ago
nick black 6532ea858b start eagle demo #167 5 years ago
nick black f3f43528f7 implement superplane (NCSCALE_NONE) #168 5 years ago
nick black 3cfe88ee0c ncscale_e enumeration for ncvisuals #168 5 years ago
nick black e2c58534ca work around -Wclobbered-noted problem 5 years ago
nick black e871660eff dig_visible_cell: rewrite recursion as iteration #170 5 years ago
nick black 1a949a5a81
account for tabletmasks 5 years ago
nick black a96e716663
panelreels: account for tablet masking 5 years ago
nick black 4a7409ebda
sprite-enhalfen tool 5 years ago
nick black 97ecbdb0e5
sigh, probably gotta kill DMCA lure 5 years ago
nick black 29eb696947
repair a dumbness 5 years ago
Marek Habersack ff3ed881c0 Improve chances of DirectColor terminal detection
While ncurses 6.1 adds the `RGB` capability to terminfo, the flag is not
commonly used in terminfo entries as of now. The `COLORTERM` environment
variable is, otoh, commonly present and set to either `truecolor` or
`24bit` value by terminal emulators which support direct color.

Add a check for this if `RGB` is false (or absent)

With this check in I was able to properly appreciate the awesomeness of
notcurses demos :)
5 years ago
Nick Black 957549105b
Wide character rigor (#117) (#157)
* unidamage PoC
* add cell_load_simple()
* clear CELL_WIDEASIAN_MASK in cell_load()
* split out render code
* add CELL_SIMPLE_INITIALIZER
* widecolor: fix message plane
* widecolor: simplify color increments
* document wide character handling
* unit tests for wide obliteration #117
* widechar obliteration hardening #117
* widecolor -> widechomper, update man page
5 years ago
nick black 040607c6f9
fix up linear interpolations 5 years ago
Nick Black dfc7623119
Implement notcurses_refresh() #150 (#156)
* boxdemo: clean up colors
* Fix crash on certain resizes due to corruption of damage map #152
* Rewrite ncplane_move_yx(), throwing out ~25 line of code
* implement notcurses_refresh() #150
5 years ago
nick black 0f175e58d3
unidamage PoC #117 5 years ago
nick black c30bd1b531 pass up damage when changing z-axis #146 5 years ago
nick black 91a7427689 render: use unlocked stdio in render path 5 years ago
nick black c5acdaaef0 don't allow moving a plane above/below itself #71 5 years ago
nick black dac4f78ee6 basic unit tests for z-axis #71 5 years ago
nick black 58cc6927ac 256-color cube is not ansi, don't muddy the waters 5 years ago
nick black 65858b4495 unit test 256-index quantizing #4 5 years ago
nick black a916d929db
RGBtoANSI: fixup lower grey onversions, looks reasonable now #4 5 years ago
nick black cfccd0c39c
RGBtoANSI unit test, fix up bases 5 years ago
nick black 8b664a14ef
move RGBtoANSI into internal header 5 years ago
nick black 041e6438e3
quantize to ansi256, atrociously #4 5 years ago
nick black f9ac7a7737
image in README 5 years ago
Nick Black 2de07f8a48
Per-line damage map, ~50% increase in FPS on notcurses-demo (#144)
Implement a fairly conservative, line-granularity, two-level damage map. One on the overall notcurses object is dirtied by planar moves, creations, deletions, and resizes. One on each ncplane is dirtied by glyph output, media rendering, fades, and erasure. #83 This has some definite false positives: a hidden plane which moves will damage a bunch of lines unnecessarily. For now, don't do things like that :D.

Extra byte per line per plane, shouldn't be a problem.

Two new stats for cell elisions and emissions

Allow keypress to interrupt view-demo

ncvisual_stream() now allows a callback per frame

Allow ncvisual_open() to create its own, perfectly-sized, ncplane #128

Typical performance prior to this PR:

4655 renders, 18.3s total (0.000305s min, 0.196s max, 0.0039s avg 253.9 fps)
401046.505KB total (9.688KB min, 139.697KB max, 86.15KB avg)
Emits/elides: def 1082115/116196 fg 10547624/7236460 bg 10602717/6208644
 Elide rates: 9.70% 40.69% 36.93%
4680 renders, 18.4s total (0.000285s min, 0.15s max, 0.0039s avg 255.0 fps)
403078.188KB total (9.688KB min, 139.697KB max, 86.13KB avg)
Emits/elides: def 1088994/116196 fg 10604983/7267750 bg 10655426/6237472
 Elide rates: 9.64% 40.66% 36.92%
4699 renders, 17.8s total (0.000227s min, 0.192s max, 0.0038s avg 263.8 fps)
403266.907KB total (9.688KB min, 139.697KB max, 85.82KB avg)
Emits/elides: def 1086511/116196 fg 10601709/7359116 bg 10661910/6326744
 Elide rates: 9.66% 40.97% 37.24%

After this PR:

5625 renders, 15s total (9.36e-05s min, 0.187s max, 0.0027s avg 375.2 fps)
168365.640KB total (0.930KB min, 139.600KB max, 29.93KB avg)
Emits/elides: def 310575/116196 fg 4486002/4473416 bg 4116835/4630666
 Elide rates: 27.23% 49.93% 52.94%
Cells emitted; 9928000 elided: 12572000 (55.88%)
5642 renders, 14.2s total (9.17e-05s min, 0.154s max, 0.0025s avg 397.0 fps)
168669.009KB total (0.605KB min, 139.600KB max, 29.90KB avg)
Emits/elides: def 310819/116196 fg 4499833/4482134 bg 4118562/4652470
 Elide rates: 27.21% 49.90% 53.04%
Cells emitted; 9962160 elided: 12605840 (55.86%)
5650 renders, 14.3s total (0.000118s min, 0.143s max, 0.0025s avg 395.7 fps)
169461.884KB total (0.860KB min, 139.600KB max, 29.99KB avg)
Emits/elides: def 305431/116196 fg 4515396/4456376 bg 4149967/4613668
 Elide rates: 27.56% 49.67% 52.65%
Cells emitted; 9945200 elided: 12654800 (55.99%)

on netcurses-demo, we're eliding about half of the total cells via this damage map. that's pretty fucking sweet! FPS increase of about 50% -- I'll take that any day of the fuckin' week, boyo. w00t!

https://www.youtube.com/watch?v=XbGs_qK2PQA
5 years ago
nick black ce9eeecc3b
render: eliminate grotesque stupidity
We were doing an entire copy of the framebuffer every fucking
render for no good reason whatsoever. Found this while working
on #83, but let's get it in master immediately. JFC. I suck.

Before (delay factor of 0.5):

[schwarzgerat](0) $ time ./notcurses-demo -d.5
Term: xterm with direct-color indexing
1737 renders, 24.8s total (0.00131s min, 0.362s max, 0.014s avg 70.1 fps)
230217.182KB total (12.696KB min, 223.310KB max, 132.54KB avg)
Emits/elides: def 1074878/126257 fg 6615070/3023957 bg 5519815/3130192
 Elide rates: 10.51% 31.37% 36.19%

real	0m47.653s
user	0m8.977s
sys	0m1.414s
[schwarzgerat](0) $

After (same delay factor of 0.5)

[schwarzgerat](0) $ time ./notcurses-demo -d.5
Term: xterm with direct-color indexing
1741 renders, 23.2s total (0.00125s min, 0.351s max, 0.013s avg 75.0 fps)
231551.089KB total (12.696KB min, 223.310KB max, 133.00KB avg)
Emits/elides: def 1065445/126257 fg 6655295/3006679 bg 5566155/3115184
 Elide rates: 10.59% 31.12% 35.88%

real	0m46.140s
user	0m8.932s
sys	0m1.350s
[schwarzgerat](0) $

Now *there's* the loss we saw during #139 work, thinking we'd get it
back in #143. Good. Huzzah! But also fuck!
5 years ago
nick black 8bd4607e9b
Merge branch 'master' of github.com:dankamongmen/notcurses 5 years ago
nick black f374682134
panelreel: add tablet curry accessors 5 years ago
nick black 4ea62e3c67
input: handle function keys through f30 5 years ago
nick black 364db519bb
stop shifting style bits stupidly 5 years ago
nick black 5deb896696
panelreel-demo: two tablets to start with 5 years ago
nick black 3b2f72538e
decode more special keys in notcurses-input #134 5 years ago
nick black c9b6f84dec
fix up default elision in alpha channels #143 5 years ago
Nick Black 8bd8055f72
Distinct fg/bg alpha channels #139 (#141)
* improved alpha macros
* demo: use new alpha macros
* add ncplane_set_*_alpha()
* explicitly set fg for uniblock
* outro: background is a space #139
* distinct alpha channels for fg/bg #139
* rename 'background' cell to 'default' #142
* doc palette fades
5 years ago
Nick Black ff463d464e
Channels API sanity #119 (#138)
* orthogonalize channel/channels/cells APIs #119
* sync README.md with new ncplane channels api #119
5 years ago
nick black 54eb41cf3a
panelreel-demo: done after demodelay * 5 #135 5 years ago
nick black 88163325fa
widecolor: proceed without keypress #135 5 years ago
nick black d500bf166e
block_on_input(): allow a NULL sigmask 5 years ago
nick black f407d7b114
ncplane_box: control corner drawing, stop emitting extra vlines #133 5 years ago
nick black 71a2660b57
fatal_handler: grab ABRT as well 5 years ago
nick black e6d35978d4
add notcurses_refresh() declaration 5 years ago
nick black 18a33a0328
handle still more key sequences #134 5 years ago
nick black 0e3b2d7516
print framebuffer size using metric info units 5 years ago
nick black e1fb283018
input: handle more sequences #134 5 years ago
nick black 6e49bbce45
panelreel: don't treat putc() return as bool #132 5 years ago
nick black a9c21526a7
add history 5 years ago
nick black 489ca06fe6
Merge branch 'master' of github.com:dankamongmen/notcurses 5 years ago
nick black c2c017831f
add ncplane_get_channels() 5 years ago
nick black 7c72b0ce83
emoji unit test 5 years ago
nick black e71fa57e54
add 'rgb' PoC, fix setlocale() mention 5 years ago
nick black a55d877281
add FIXME regarding sgr and ncv 5 years ago
nick black 1821867e35
move outfp out of notcurses_options #130 5 years ago
nick black 21c4a9a2eb
demos: use ncalign_center throughout 5 years ago
nick black 7d2b0938e5
uniblock-demo: vastly improved via hook->fade 5 years ago
nick black d20da07fe0
widecolor: maintain a single background in message 5 years ago
nick black 8de3696268
add ncplane_putwstr_aligned(), update docs #102 5 years ago
nick black de595380b6
ncplane_putstr_aligned(), use it in intro #102 5 years ago
nick black c0b10a8f32
enable sgr/sgr0 #73 5 years ago
nick black 1ccb747e72
sgr: support disabling ALTCHARSET 5 years ago
nick black 3a79cbf469
proof of concept support. sgr binary 5 years ago
nick black 64462a11ac
for real tho 5 years ago
nick black 208077b95c
enmetric unit tests 5 years ago
nick black c7c52f21d5
luigi: just use the three frames in a loop 5 years ago
nick black 206db6dedd
sgr unit tests 5 years ago
nick black 624ab35b8f
close bracket in output #121 5 years ago
nick black e45df10dca
input: handle unicode #121 5 years ago
nick black 6c14a47368
input: pass through decoded utf8 #121 5 years ago
nick black ad4c8ac58a
luigi: set sprite background so we can elide more 5 years ago
nick black 7eafdd6772
fix up unit testing sanity 5 years ago
Nick Black 0d2c43603b
Luigi in Mega Man world (#127)
* uniblock-demo: reset background to black
* warning about quantization
* some luigi love
* update cell documentation
* add unit test for move of stdplane
* MoveToLowerRight unit test
* ncplane_move_yx(): error to move stdscr
* better box permutations test
* luigi in megaman2 world
* stats: don't print 'em if we haven't got 'em
5 years ago
nick black fdc4325929 widecolor: make message its own plane #110 5 years ago
nick black 66fa8854f3 outro effects 5 years ago
nick black 5e5abd7cbd extract outro 5 years ago
nick black 3a6551ab4d
uniblock-demo: scroll the blocks right-to-left #104 5 years ago
nick black 93231c26eb input: use SPUA-B for special keys #118 5 years ago
nick black 949e531038
notcurses-input: colorize output 5 years ago
nick black e77c584815
fadeout: handle background #111 5 years ago
nick black 065d44001c
change demo order 5 years ago
nick black ea10d80eec
remove duplicate macro define 5 years ago
nick black 0c5c696084
boxdemo: center target grid 5 years ago
Nick Black 38a10d9065
Transparency via alpha channels (#122)
* outro: bevel message window's corners
* egcspool: use full 25 bits available for 32MB pools
* render: remove unused inheritance mask
* interfaces + unit tests for 2-bit alpha
* notcurses_*g_alpha() acccessors
* cell alpha + unit tests
* panelreel: support a background channel
* notcurses: transparency via alpha channel
* remove unused CELL_ALPHA_MASK
5 years ago
nick black 15c13898ea
don't require civis if retaining cursor 5 years ago
nick black 7566af57e3
introduce ncplane_set_[fb]g 5 years ago
nick black 79253caf31
render: reorder assignment to work around -Wclobbered 5 years ago