Commit graph

76 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
4ac2b44ea7 Fixes how glext header is included.
This commit fixes the issue caused by #357 that nanovg failed to compile on iOS due to the wrong way of including glext header.
2017-03-06 22:08:08 +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
b83cf92652 Fixed use of nvglImageHandlexx in GL utils from earlier PR
- nvglImageHandle was changes to contain GL postfix, changed GL utils
to use that too
- fixed silly failure check bug in FBO demo
2016-02-01 21:41:24 +02:00
Olli Wang
32db574853 Improve the use of NVGLUframebuffer.
The `NVGLUframebuffer` structure contains a `ctx` member but was actually never used. This commit takes advantage of the `ctx` property so there is no need to keep the reference of the context elsewhere after calling `nvgluCreateFramebuffer()`, or it would add difficulty for maintenance. As a result, the `nvgluDeleteFramebuffer()` function only needs to take one `NVGLUframebuffer` instance as the parameter.
2015-06-11 20:28:38 +08:00
Bruce Mitchener
98b116165d Fix typos. 2015-01-09 18:55:47 +07: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
96f08f4ca4 Fix for issue #155
- added NVG_DEBUG which can be used to omit calls to glGetError()
- removed return value for glnvg__checkError
- create flag defines to enum
2014-09-02 20:58:17 +03:00
Moritz Kassner
b112ce00b7 added new graph style 2014-08-26 09:00:25 +02: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
Mikko Mononen
a52c9a1241 Merged font texture creationg conflict. 2014-07-11 18:39:10 +03:00
StarWing
4712e5b615 Auto detect and resize text atlas texture. 2014-06-22 16:41:19 +08: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
709475c513 API changed! Fixed slowdown, Shader uses premultiplied colors
- all colors in the shader is handled as premultiplied
- removed alphaBlend param from nvgBeginFrame(), it became obsolete
- added NVGL_TEXTURE_PREMULTIPLIED flag
- separated FBO example
- FBOs are treated as premultipied for correct alpha
- changed FBO storage from depth/stencil 24/8 to stencil 8
- moved discard to end of shader which restores the render speed again
2014-06-15 11:08:12 +03:00
Mikko Mononen
0dbf53ebad Updated screenshot 2014-06-09 20:10:37 +03:00
Mikko Mononen
003561e721 Fix for issue #92
- added (optional) 3-pass stencil trick to stroke rendering, reduces
overdraw artifacts, a little slower
- fixed some text bounds issues
2014-06-09 15:53:26 +03:00
Mikko Mononen
83c876b9a8 Made FBO helper to work on OSX when using GL2 2014-06-08 20:27:14 +03: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
7a06c56edb Fixes and tweaks for frame buffer handling
- fixed flags setup in nvglCreateImageFromHandle
- changed frame buffer to only compile on GL3
- changed nvgluCreateFramebuffer() to return FBO struct instead of
filling existing one (for consistency)
2014-06-08 13:56:58 +03:00
StarWing
bea097165b add external APIs to GL backend to get native Texture Id. 2014-06-08 01:48:01 +08: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
Camilla Berglund
57308993cb Removed GLFW 2 option macro.
GLFW_NO_GLU is a GLFW 2 feature.  GLFW 3 does not include the GLU header
by default.
2014-04-25 12:01:48 +02:00
Mikko Mononen
df537491f2 Include GLFW_INCLUDE_GLCOREARB only on Macs 2014-04-24 21:31:40 +03:00
StarWing
a07cb82780 add support for MinGW. 2014-04-22 14:58:44 +08:00
Mikko Mononen
7fc116418c Fix for issue #14 2014-04-21 11:16:51 +03:00
Mikko Mononen
be16b4dff3 Made old GL backends obsolete, added docs
- added documentation about changed GL state
- made old GL2 and GL3 backends obsolete
2014-04-20 12:26:05 +03: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
407cd75a98 Fixed rendering artefacts when not using uniform buffers
- made uniform buffer support behind separate define for easier toggling
- calculate scissor and stroke alpha outside type selection to simplify
the shader (or else it produces rendering artefacts)
- restore default pixel store settings instead of restoring old state
- set active texture to 0 when starting to render a frame
2014-04-17 19:09:26 +03:00
Mikko Mononen
9d367dcb81 GL3buf backend supports GL2 too (not yet enabled)
- added support for GL(ES)2 for nanovg_gl3buf (something is still not
quite there)
- nanovg now sets all required GL state
- removed compiler warnings about unused vars
2014-04-15 21:10:55 +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
aaafbd32c6 Renamed FPScounter to PerfGraph
- Renamed FPScounter to PerfGraph
- dump avg times at exit
2014-02-18 21:51:28 +02: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
fe22b8c07d Support for cases where the gl header does not include GL_ARB_TIMER_QUERY 2014-02-18 18:17:09 +01: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
a1e99ea940 Bug fix for index into queries. 2014-02-18 13:32:55 +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