341 Commits

Author SHA1 Message Date
satoren
339c5e507b Improve nvgGlobalCompositeOperation with state 2016-09-15 02:29:56 +09:00
Mikko Mononen
af0c475cf9 Merge pull request #311 from dimsuz/gl2_image_handle_fix
Rename nvglImageFromHandleGL2 -> nvglImageHandleGL2
2016-09-11 18:35:12 +03:00
Dmitry Suzdalev
23128bdb58 Rename nvglImageFromHandleGL2 -> nvglImageHandleGL2
There was no nvglImageFromHandleGL2 implementation, it must have been
an error during some refactoring
2016-09-11 14:03:34 +02:00
Mikko Mononen
4f255e0daf Merge pull request #307 from olliwang/blend
Fallbacks to default composite operation when invalid one is specified.
2016-09-04 10:15:36 +03:00
Olli Wang
c03226cd2e Fallbacks to default composite operation when invalid one is specified.
This commit fixes #300 and #306 that “control may reach end of non-void function” error occurs in `glnvg_convertBlendFuncFactor()`. The function now returns `GL_INVALID_ENUM` for invalid blend factor and if that happens, `glnvg__blendCompositeOperation()` uses default source-over composite operation.
2016-09-04 11:28:01 +08:00
Mikko Mononen
189e051527 Merge pull request #303 from olliwang/freetype
Fixes the kerning value for freetype.
2016-08-23 16:39:11 +03:00
Olli Wang
39f7a369c7 Fixes the kerning value for freetype.
This commit fixes issue #302 that the kerning value returned by freetype is not converted to integer properly.
2016-08-23 10:24:32 +08:00
Mikko Mononen
c02bc9d5ed Merge pull request #301 from olliwang/font
Support fallback fonts (code refactoring for #299)
2016-08-21 20:52:23 +03: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
71774e0afe Merge pull request #298 from olliwang/blend
Implements composite operation for blending renderings.
2016-08-11 05:42:20 +03:00
Olli Wang
09dc767e3f Updates comment for composite operation. 2016-08-11 02:39:31 +08:00
Olli Wang
9490a8c188 Updates comment again. 2016-08-11 02:10:57 +08:00
Olli Wang
ba8272c5b5 Updates comments. 2016-08-11 02:06:53 +08:00
Olli Wang
1d856c1b00 Changes the order of declaration. 2016-08-11 02:00:23 +08:00
Olli Wang
1bf25e6f67 Improves the implementation of global composite operation.
This commit updates the implmentation of global composite operation to follow the advices described at c4b865796d (r74248556)
2016-08-10 23:01:25 +08:00
Olli Wang
c4b865796d Implements composite operation for blending rendering between frames.
This commit implements the `nvgGlobalCompositeOperation()` function to support blending between frames. All operations defined in HTML5 canvas API are supported. Also, it is possible to create custom composite operation by calling `nvgBlendFunc()` or `nvgBlendFuncSeparate()` functions.
2016-08-09 16:12:08 +08:00
Mikko Mononen
25f39a60a8 Merge pull request #297 from olliwang/bgfx
Add support for bgfx
2016-08-05 16:39:12 +03:00
Olli Wang
1664a524a7 Passes the device pixel ratio parameter to renderViewport function.
This commit updates the `nvgBeginFrame()` function to forward the received `devicePixelRatio` parameter to the `renderViewport()` function so it is possible to configure the environemnt correctly when using `bgfx` backend.
2016-08-05 16:56:36 +08:00
Mikko Mononen
cc3897359a Merge pull request #295 from nhojb/master
Fixing clang compiler warnings.
2016-08-02 21:24:26 +03:00
John
1efdf2a1de Fixing clang compiler warnings. 2016-08-02 15:05:58 +01:00
Mikko Mononen
c80af94c07 Merge pull request #283 from JinShil/patch-1
Fix typo in nvgCreateFontMem() description
2016-05-17 10:14:08 +03:00
Mike
df658f97a2 Fix typo in nvgCreateFontMem description 2016-05-17 11:30:50 +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
Mikko Mononen
2504509fb2 Merge pull request #261 from reFX-Mike/master
Fixed fontstash.h crashing
2016-01-29 11:38:03 +02:00
Mikko Mononen
3321379e49 Merge pull request #201 from andrewcorrigan/master
Fix for issue #172
2016-01-28 08:21:42 +02:00
Michael Hartmann
f43a7a7790 Replace malloc.h with stdlib.h 2016-01-27 11:56:38 -08:00
Michael Hartmann
6245376103 Increased SCRATCH_FONS_SCRATCH_BUF_SIZE to 64000 2016-01-27 10:52:34 -08:00
Mikko Mononen
cb6fd9100d Added glUniformBlockBinding to touched state 2015-10-25 10:10:01 +02:00
Mikko Mononen
504060e52a Merge pull request #238 from plasmacel/master
fixed type usage
2015-08-08 17:39:11 +03:00
Thom de Villa
b7a4792291 fixed type usage
in some situations int and GLsizei is not the same type which leads to conversion warnings
2015-08-07 21:24:45 +02:00
Mikko Mononen
6ae087333d Merge pull request #226 from olliwang/framebuffer
Improve the use of NVGLUframebuffer.
2015-06-13 11:10:04 +03: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
Mikko Mononen
1de6fa5cdd Merge pull request #207 from alexbrazier/patch-1
Fix spelling mistake in readme
2015-03-13 09:49:02 +02:00
Alex Brazier
01141b2e88 Fix spelling mistake in readme 2015-03-12 22:40:15 +00:00
Andrew Corrigan
3eeafc1a14 Fix for issue #172 2015-02-21 10:15:13 -05:00
Mikko Mononen
3a5e25cc67 Merge pull request #196 from waywardmonkeys/fix-typos
Fix typos.
2015-01-09 17:07:38 +02:00
Bruce Mitchener
98b116165d Fix typos. 2015-01-09 18:55:47 +07:00
Mikko Mononen
31f9feb401 Fix for #191
- fixed stroke to use lino join style to calculate required vertex
count
2014-12-31 20:02:56 +02:00
Mikko Mononen
90862ce25c Fix for issue #175
Line break would duplicate a word if the first character of a word
would cause a line break
2014-11-11 23:30:15 +02:00
Mikko Mononen
1a0550ebc7 Merge pull request #185 from SmilyOrg/patch-2
Added check in addPoint to avoid duplicated moveTos breaking
2014-11-11 21:22:49 +02:00
Mikko Mononen
8b849004d4 Merge pull request #165 from floooh/pr_redundant_state_filter
Redundant GL state filter
2014-11-11 21:15:47 +02:00
Miha Lunar
f8086a2006 Added check in addPoint to avoid duplicated moveTos breaking
It guards addPoint from "stealing" the point from the previous path if they're the same, which makes it break when you do something like this:
```
moveTo(50, 50)
moveTo(50, 50)
lineTo(100, 100)
```

Before the fix there's no line shown. With the second moveTo, there's a second path added, but without the 50,50 point, because it was already added with the first moveTo. This makes the second path only contain the point 100,100 so it doesn't draw at all.

After the fix, the point equality check is ignored for the first point in the path, so the second path gets the 50,50 point too and that makes it behave as expected.

This is only one solution to the duplicated moveTo problem and it's likely not the best one, but it's one that's easy to add and it seems to work just fine.
2014-11-11 16:45:51 +01:00
Mikko Mononen
315914acfd Merge pull request #184 from olliwang/fbo
Fixes nvgluCreateFramebuffer().
2014-11-07 09:46:24 +02:00
Olli Wang
71a2bdf8af Fixes nvgluCreateFramebuffer().
The framebuffer and renderbuffer did restore in `nvgluCreateFramebuffer()` on succeed. However, they are not restored if error occurs. This commit fixes it.
2014-11-07 15:19:43 +08:00
Mikko Mononen
f75078f594 Merge pull request #183 from csaken/master
Fixed compile error occuring if FONS_USE_FREETYPE is defined.
2014-11-01 15:06:57 +02:00
Jancsi Farkas
a473d72ecf Fixed compile occuring if FONS_USE_FREETYPE is defined. 2014-11-01 07:54:45 +02:00
Mikko Mononen
b048742da4 Updated out dated docs in read me 2014-10-31 17:09:53 +02:00
Mikko Mononen
fc3b7a013e Merge pull request #174 from SmilyOrg/patch-1
Consistent code syntax and typo fix
2014-09-25 12:21:45 +03:00
Miha Lunar
13e877ed37 Consistent code syntax and typo fix 2014-09-25 11:19:02 +02:00