Commit Graph

11 Commits

Author SHA1 Message Date
Cameron Cawley 60c52adfaf
Enable and fix most GCC warnings (#377)
Co-authored-by: Rob Loach <robloach@gmail.com>
2021-12-16 20:44:00 +01:00
Cameron Cawley 9af0103cac Build all demos as C89 2021-12-14 20:14:34 +00:00
Wladislav Artsimovich 1e4eacca2e change NK_MEMSET to memset(), because NK_MEMSET is NK internal 2021-06-18 16:19:49 +02:00
Jimmi Holst Christensen 7fafcb3ac7 add ctrl support for x11 demos 2019-09-18 18:27:25 +02:00
Jmmi f176f3d7e6 use memset macros instead of fn in x11 demos 2019-08-16 22:20:22 +02:00
0x0203 e8d1c38546 Fix nits (see PR #851) to clean up x11_rawfb 2019-06-10 18:03:22 -04:00
0x0203 4de6d284a3 - Determine pixel layout at runtime instead of relying on compile-time flags
- Fix some potential null dereference bugs
2019-06-06 14:54:30 -04:00
vurtun 2891c6afbc Update demos to new color picker API 2018-01-05 13:09:27 +01:00
Patrick Rudolph 3705464605 demo/x11_rawfb: Change license to MIT
Relicense all x11_rawfb demo files under MIT license.

Signed-off-by: Patrick Rudolph <siro@das-labor.org>
2017-10-09 17:41:06 +02:00
vurtun e5850a01b9 Fixed style issues in software renderer 2017-10-07 14:30:22 +02:00
Patrick Rudolph 2eb72b26e4 Add software rasterizer library and demo.
The software rasterizer is to be used with raw framebuffer
devices, where no GPU or X11 is available.
The demo emulates a raw framebuffer on X11 using XShmImage / XImage.

Features implemented:
* Drawing primitives
* Drawing polygons (using Darel Rex Finley algorithm)
* Drawing arcs and circles (using Bresenham's elipses algorithm)
* Drawing images using nearest filtering
* Bounds check on every operation
* Fastpath for lines
* Font rendering using nearest filtering
* Window resize
* Thread safe implementation by using a context
* Fixed lower and upper scissors on fast-path
* Adapted coding style to nuklear's style
* Implemented text scissors

Color formats:
Define one of them at compile time.
* RAWFB_RGBX_8888 (32bpp)
* RAWFB_XRGB_8888 (32bpp)

Tested:
The library has been tested on Lenovo Thinkpad T500 and is able to render
more than 30fps on a single core with no further optimizations and VSNYC enabled.

TODO:
* Improve font rendering by using filters.
* Account font foreground color.

Usage:
The raw framebuffer library needs a "texture" that holds the prerendered
font data. The texture is used at runtime to blit the letters onto screen.
You have to provide the framebuffer address, dimension and pitch.

Signed-off-by: Patrick Rudolph <siro@das-labor.org>
2017-10-07 12:08:24 +02:00