Commit Graph
63 Commits
Author SHA1 Message Date
Kovid Goyal 66803e6873 Workaround to get graphics working on Apple's buggy products
Apparently some macOS OpenGL drivers cannot handle using a VAO with
attributes that have different divisors/apply to different shaders. So
use a separate VAO for graphics rendering. This is a small performance hit,
but is the price of supporting substandard computers.
2017-10-17 12:15:52 +05:30
Kovid Goyal 02dc637ed0 Use the correct blend function for text 2017-10-17 09:51:21 +05:30
Kovid Goyal 090ee5b846 Disable graphics on older macOS machines
I give up, trying to work around Apple's buggy drivers without even
having a machine to test my workarounds on is too hard. Simply disable
graphics on macOS < 10.13

Fixes #141
2017-10-16 21:23:29 +05:30
Kovid Goyal e679fa9a1c Possible fix for #141
Presumably on older macOS versions the Apple OpenGL drivers cannot handle both
non-sequential and non-zero based binding locations. Sigh.
2017-10-16 18:39:49 +05:30
Kovid Goyal 3f8b2184a6 Add a sanity check to ensure the attribute location binding worked 2017-10-13 10:06:12 +05:30
Kovid Goyal d5088a3e5b Do image clipping using OpenGL rather than on the CPU 2017-10-07 10:08:26 +05:30
Kovid Goyal a4e7985fb0 Condition on negative refs as well as in the future we will use interleaved drawing for background opacity as well 2017-10-05 18:21:29 +05:30
Kovid Goyal 75244b1416 ... 2017-10-04 23:07:59 +05:30
Kovid Goyal 952f0ad98c Accommodate the underpowered Apple lineup
macOS is missing glDrawArraysInstancedBaseInstance
2017-10-04 22:44:03 +05:30
Kovid Goyal e9bc64205e Code (not working) to draw graphics 2017-10-04 18:29:48 +05:30
Kovid Goyal 8f05f752af Code to update graphics buffer 2017-10-04 17:41:11 +05:30
Kovid Goyal 138a37ccac Start work on the graphics program 2017-10-04 17:22:00 +05:30
Kovid Goyal e1650d5df7 Implement interleaved drawing of cells 2017-10-04 16:11:20 +05:30
Kovid Goyal 3f615666df Call grman_update_layers 2017-10-04 15:39:31 +05:30
Kovid Goyal 96a9d64bcb A spot of refactoring 2017-10-04 15:34:54 +05:30
Kovid Goyal bd09e2ebf1 Allow re-using VAO objects between different types of cell program 2017-10-04 15:33:15 +05:30
Kovid Goyal ad040271b9 Initialize uniforms for all cell program variants 2017-10-04 14:46:36 +05:30
Kovid Goyal ead73c8209 Prepare for two stage rendering of cells 2017-10-04 14:15:51 +05:30
Kovid Goyal b032130a20 A spot of refactoring 2017-10-04 10:56:44 +05:30
Kovid Goyal 3cbc20005b Implement sending of image data to GPU 2017-10-01 09:04:46 +05:30
Kovid Goyal 710d00674a Export the free texture function 2017-09-30 13:51:52 +05:30
Kovid Goyal b5b9a7ba6d Fix compilation with clang 2017-09-30 11:56:30 +05:30
Kovid Goyal 2909fddaa2 Split out GL API wrapping code into its own header 2017-09-30 11:48:52 +05:30
Kovid Goyal 7863857b2c Use a UBO for all cell program uniforms 2017-09-30 11:44:44 +05:30
Kovid Goyal 55498b5a44 Avoid unnecessary calls to glBindTexture 2017-09-30 07:00:46 +05:30
Kovid Goyal cda385b37c Fix #132 2017-09-28 10:01:08 +05:30
Kovid Goyal 28146a4e9c Proper fix for sending constant uniform to cell program 2017-09-28 09:55:17 +05:30
Kovid Goyal 0ad9149ca8 Avoid one more call to set uniforms 2017-09-26 11:27:04 +05:30
Kovid Goyal 3471887817 ... 2017-09-25 18:05:25 +05:30
Kovid Goyal 826a64c8dc Fix wide cursor not being rendered 2017-09-17 19:23:01 +05:30
Kovid Goyal 14103db2ee Coalesce another couple of uniforms 2017-09-17 18:10:32 +05:30
Kovid Goyal 51d037fb70 Coalesce a couple of set uniform calls into a single one 2017-09-17 17:48:42 +05:30
Kovid Goyal df4df76d24 Switch to using an opaque block cursor
The text is rendered in the background color on top of the opaque
block cursor. We use the background color since applications can change
both cursor and background colors, so it is up to the application to
ensure the colors have good contrast. Fix #126
2017-09-17 13:03:02 +05:30
Kovid Goyal a92b3c605f Move the text attributes out of the char type
This means that more text attributes can be added in the future (there
are 8 bits available) and there is no need to keep bit twiddling when
accessing the chars themselves. Also means less data needs to be sent to
the GPU. Cell size does not change since there were currently 2 unused
bytes because of alignment.
2017-09-16 11:02:42 +05:30
Kovid Goyal 9989363ecd Make the URL highlight color configurable 2017-09-15 10:45:27 +05:30
Kovid Goyal 53ea5c678d Highlight links with a underline on mouseover 2017-09-15 10:45:27 +05:30
Kovid Goyal 745b6222c2 Start work on migrating the mouse handlers to C 2017-09-15 10:45:25 +05:30
Kovid Goyal 13ac050bf8 Move cursor render call to C 2017-09-15 10:45:24 +05:30
Kovid Goyal e6df82b255 Move the char grid render call into C 2017-09-15 10:45:24 +05:30
Kovid Goyal 943a1575ad Move render call for tab bar to C code 2017-09-15 10:45:24 +05:30
Kovid Goyal 2e0cbb88bb Call draw_borders() directly from C 2017-09-15 10:45:23 +05:30
Kovid Goyal ccf5391b45 Move visual bell tracking into the Screen object 2017-09-15 10:45:23 +05:30
Kovid Goyal 367ffb602c Color table buffer has to be bound before each render
Other wise the last created child's buffer is always used
2017-09-15 10:45:23 +05:30
Kovid Goyal 4e8ade53d8 Fix compilation on apple 2017-09-15 10:45:23 +05:30
Kovid Goyal 7f6befe4f9 Remove the python OpenGL wrapper as it is no longer needed 2017-09-15 10:45:23 +05:30
Kovid Goyal 86893db46b Fix re-alloc of sprite texture 2017-09-15 10:45:22 +05:30
Kovid Goyal 3a883ad436 Move the sprites GPU code to shaders.c 2017-09-15 10:45:22 +05:30
Kovid Goyal cc8271b766 Fix compilation on macOS 2017-09-15 10:45:22 +05:30
Kovid Goyal 1246032b67 Remove unused code 2017-09-15 10:45:22 +05:30
Kovid Goyal 9eea178890 Make --debug-gl have zero runtime cost when absent 2017-09-15 10:45:22 +05:30