Commit graph

33 commits

Author SHA1 Message Date
Mikko Mononen
e281ffcabd Fixed nvgTextBreakLines returning bad minx
- nvgTextBreakLines: wordMinX was relative to rowStartX, which caused
problems when rowStartX change on line break, but wordMinX was still
relative to the previous rowStartX
- fixed font size on perf graphs
- made demo to use row minx/maxx instead of row->width
- fixed demo hover distance
2020-03-07 23:01:56 +02:00
Olli Wang
79561dc47f Fixes demo’s font sizes.
This commit fixes the demo’s font sizes for the changes in #558, which makes the rendered font size matches what you saw on other native apps. The demo used bigger font sizes than they actually were. This commit deduces the font sizes to match the original demo’s look.
2020-02-28 18:27:48 +08:00
Olli Wang
c97444c96f Code refactoring for #299.
This commit fixes the formats as suggested in #299 and fixes stack overflow when using `freetype` backend.
2016-08-21 21:40:40 +08:00
satoren
40e999af3c Support fallback fonts 2016-08-17 00:33:48 +09:00
Mikko Mononen
994b60b83f Moved image repeat (tiling) from pattern to image creation
- API changed!
- moved image repeat from nvgImagePattern() into image creation
nvgCreateImage*()
- made flip-y and premultiplied common image flags (not just GL)
- removed nvglImageFlags(), flags passed in via
nvglCreateImageFromHandle() flags
- nvgluCreateFramebuffer takes image flags as param
2014-09-02 21:57:59 +03:00
Mikko Mononen
14df146ea1 Added nvgIntersectScissor()
- added function to allow to combine scissor rects using intersection
2014-07-13 13:30:54 +03:00
Mikko Mononen
8519f09569 Changed demos to use types not structs 2014-07-11 19:21:19 +03:00
Mikko Mononen
19f19847fe Typedef'd structs.
- added typedefs for all structs
- fixed some compiler warnings
2014-07-11 19:16:03 +03:00
Christopher Maughan
b79ab71a71 Added mipmap generation option - useful for clients that need images with mipmaps for better quality scaling.
Tweaked premake to remove some windows warnings.
2014-06-21 10:38:25 +01:00
Mikko Mononen
84bec2962e Fix for issue #95
- Added alpha for images
- Added global alpha
2014-06-08 15:10:40 +03:00
Mikko Mononen
44c168b84e Fix for issue #75
- fixed copy/paste bug in bevel calculations
2014-05-23 09:42:42 +03:00
Mikko Mononen
611b043fff Fix for issue #77
- line caps did not consider AA width
2014-05-23 09:37:36 +03:00
StarWing
a07cb82780 add support for MinGW. 2014-04-22 14:58:44 +08:00
Mikko Mononen
6edc46e5b0 Allow small strokes, fixed textBoxBounds()
- added test for multiple stroke widths
- allow stroke width down to 1px size, then scale with alpha
- fixed textBoxBounds() in hi-dpi
2014-04-19 20:03:46 +03:00
Mikko Mononen
b416f76b1c Added nvgTextBoxBounds, fixed nvgTextBounds
- nvgTextBounds() API changed, assumes x,y as input too
- fixed nvgTextBounds() return values
- added nvgTextBoxBounds()
- text line width is handle more consistently
- added note about return values of text measure funds
- changed demo to show text(box)bounds usage
2014-04-19 19:31:28 +03:00
Mikko Mononen
fdb96903c8 Fixed text related calculations for hi-dpi rendering
- calculate all text related stuff using scaling
- removed a couple of compiler warnings
- tweaked caret picking
2014-04-14 17:49:21 +03:00
Mikko Mononen
635f4a4afb Added multi-line text drawing
- fixed some warnings
- changed nvgLetterSpacing() to nvgTextLetterSpacing()
- added nvgTextBox()
- added nvgTextLineHeight()
- added some documentation
2014-04-13 21:55:43 +03:00
Mikko Mononen
ff8b521506 Added text break line and glyph position functions
- added debug configs for the lib
- added more data for font stash text iterator (ptr to current and next
position in string, code point)
- renamed nvgVertMetrics() to nvgTextMetrics()
- added nvgTextGlyphPositions() which returns glyph x position for the
text
- added nvgTextBreakLines breaks a text into multiple rows based on
newlines and max row width
- tweaked tessellation tolerance
2014-04-13 19:01:25 +03:00
Doug Binks
c3f50b9c01 Removed nvgIsBlack, and added isBlack to demo.c 2014-04-10 12:19:03 +02:00
Doug Binks
3d3582cd9a Moved to floating point color via NVGcolor structure.
Currently working with gl3buf backend.
2014-04-06 18:15:40 +02:00
Mikko Mononen
ba3c0cbce1 Fix for issue #40: Added support to render using premultiplied alpha
- added support to take screen shots
- added support to render to frame buffer using premultiplied alpha
- fixed spelling NVGaling -> NVGalign
2014-02-25 22:53:46 +02:00
Caleb Gingles
fbdc947802 Improve VC support 2014-02-18 16:53:48 -05:00
Mikko Mononen
1517841023 Performance timer tweaks
- moved performance counter and drawing to separate file
- tweaks to performance drawing
2014-02-18 21:40:52 +02:00
Doug Binks
7d6058c572 Changed name of new functionality to keep other examples compiling. 2014-02-18 15:45:41 +01:00
Doug Binks
e21683f14e Added name to timer render. 2014-02-18 15:32:04 +01:00
Doug Binks
bb6b19c410 Added GPU timer and fixed up formatting. 2014-02-18 12:26:41 +01:00
Doug Binks
a63854859e Added an inner frame CPU timer.
Needs names for the UI components to distinguish them, and probably stacking vertically for easier comparison.
2014-02-18 11:38:55 +01:00
Mikko Mononen
0ec2be7a6c Added support for line caps and joins 2014-02-17 00:25:26 +02:00
Mikko Mononen
6840bf8478 Simplified back-end API a little
- removed assize from the back-end api
- moved image to paint in renderTriangles call
2014-02-16 13:05:24 +02:00
Mikko Mononen
d41083886a Added retina/hi-dpi support
- fixed off-by-one pixels from demo
- added device-pixel-ratio support (retina support)
- added nvgEndFrame()
2014-02-14 19:13:12 +02:00
Mikko Mononen
3d3c302e6c GL3 uber shader
- added milliseconds to fps counter
- smooth fps reading a bit more
- changed GL3 to uber shader
2014-02-13 22:12:18 +02:00
Mikko Mononen
336de19a16 Better rounding for quantization to remove text rendering jitter 2014-02-10 19:11:10 +02:00
Mikko Mononen
9b00b7aaf5 Implemented OGL 3.2 core profile back-end
- moved demo stuff to separate file
- created two separate examples for gl2 and gl3
- initial stab at OGL 3.2 core profile back-end (currently twice as
slows as 2.0)
- API change: glBeginFrame() takes view witdth and height as input
- added FPS counter to demo
2014-02-09 17:33:37 +02:00
Renamed from example/example.c (Browse further)