Ryan Alexander
fa12dd899b
Use highp precision when available for GLES
11 years ago
StarWing
bea097165b
add external APIs to GL backend to get native Texture Id.
11 years ago
Mikko Mononen
effe1a5fce
Fix for issue #81
- use regular uniforms for once-per-frame values
- set tex sampler when using NANOVG_GL_USE_UNIFORMBUFFER
11 years ago
Douglas Cox
eff24cc040
Removed GL_BLEND disable and enable inside glnvg__fill() to prevent performance warning:
"Fragment Shader is going to be recompiled because the shader key based on GL state mismatches."
11 years ago
Mikko Mononen
02ca24ad75
Fix to update alloc count after successful alloc
11 years ago
Mikko Mononen
7f55decf8f
More error checking on allocations
- changed remainder of allocations to follow same 1.5x patters
- do not leak memory when realloc() fails
- added error handling in case allocations fail
11 years ago
Mikko Mononen
b2d93429e5
Fixed issue #80
- increased initial buffer sizes
- change all allocator patterns to over allocate by 1.5x
- fixes bug where nvgl back-end was not allocating +n as requested
11 years ago
Christian Forfang
d7344e0699
Added glFrontFace(GL_CCW) to glnvg__renderFlush
11 years ago
Mikko Mononen
9d62d28bdf
Fix for issue #69
- make default uniform struct align 4
11 years ago
Andrew Corrigan
ee1e66e721
fixes texture formats for GLES2/GLES3
11 years ago
Mikko Mononen
5a4e5a3d7c
Added nvgCurrentTransform() and exposed matrix functions
- added nvgCurrentTransform() which allows to get the current
transformation matrix
- added skew x/y transforms
- exposed functions 2x3 matrix functions
- exposed point transform
- added deg/rad conversion functions
11 years ago
Mikko Mononen
be16b4dff3
Made old GL backends obsolete, added docs
- added documentation about changed GL state
- made old GL2 and GL3 backends obsolete
11 years ago
Mikko Mononen
b54faeff30
Added TODO about GLES2 pixel shader precision
11 years ago
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
11 years ago
Mikko Mononen
8f16ad0e07
Clear frag uniforms before filling
11 years ago
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
11 years ago
Mikko Mononen
2d5c1845ac
Removed unused function
11 years ago
Doug Binks
3d3582cd9a
Moved to floating point color via NVGcolor structure.
Currently working with gl3buf backend.
11 years ago
Mikko Mononen
0262883c55
Fixes for AA on retina, a bit finer tessellation
- changed tessellation threshold from 0.3 to 0.25
- fixed scissor AA on retina
- fixed stroke AA on retina
11 years ago
Mikko Mononen
8b55ae414e
Improved miter and bevel line joins
11 years ago
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
11 years ago
Doug Binks
5d8e63c81c
Another reset pixel storage settings after load texture.
11 years ago
Doug Binks
a5965635a6
Reset pixel storage settings after load texture.
11 years ago
Mikko Mononen
99bd7b358e
Moving variables at top of blocks for better VC support
11 years ago
Mikko Mononen
b043187a51
gl3buf refactoring
- implemented missing scissor from draw triangles
- buffer a whole frame of uniforms
- moved paint to uniform conversion earlier
- simplified render loops and data structures
- renamed bunch of things
- combined shaders, use define to disable AA
11 years ago
Mikko Mononen
85fb384a3d
UBO fixes
- correct fix for ubo memroy allocation (use returned alignment instead
of struct size)
- separated convex fill to own command type
- moved uboPos to call struct
11 years ago
Mikko Mononen
3b8c63b6d5
Fixed bug on ubo allocation, formatting fixes
11 years ago
Kyle Gretchev
fa8d2a9d03
Added glMapBuffer cast
Cast void* to char* to remove compiler warning in C++ project in VS2013
11 years ago
Doug Binks
16ff847c0f
Move to using uniform buffer objects for fragment shader, which is set once per frame.
11 years ago
Doug Binks
ddf95cef5f
Corrected some spaces to tabs.
11 years ago
Doug Binks
c86e247433
Moved per call view uniform update to once per frame UBO update.
11 years ago
Mikko Mononen
9576341b7e
Reversed path winding to make it actually ccw
11 years ago
Doug Binks
e6841cb628
Simplified attrib binding and removed color vertex attribute for a reasonable perf bonus.
11 years ago
Mikko Mononen
277d5ebb3b
Added experimental GL3 back end which buffers whole frame
11 years ago
Mikko Mononen
6840bf8478
Simplified back-end API a little
- removed assize from the back-end api
- moved image to paint in renderTriangles call
11 years ago
Mikko Mononen
1378269815
Fixed unused variables and scissor under zoom
- added NVG_NOTUSED to suppress unused param warnings
- fixed scissor anti-aliased border width when zoomed
11 years ago
Kyle Gretchev
4aefd89450
Added float cast to viewport size
Added float cast to remove compiler warnings.
11 years ago
Andrew Corrigan
79e2d7cad8
stdio.h
11 years ago
Andrew Corrigan
1fe6cb36dc
NANOVG_GLES2_IMPLEMENTATION implies NANOVG_GLES2
11 years ago
Mikko Mononen
a888e741ac
Use GL_R8 instead of GL_RED on ES3
11 years ago
Mikko Mononen
d41083886a
Added retina/hi-dpi support
- fixed off-by-one pixels from demo
- added device-pixel-ratio support (retina support)
- added nvgEndFrame()
11 years ago
Mikko Mononen
8cb6eea358
Tweaks to GL ES
- use nvgCreateGLES2() instead of nvgCreateGL2() when NANOVG_GLES2 is
specified (ditto for gl3)
- use GL_RED instead of GL_LUMINANCE in ES3
11 years ago
Andrew Corrigan
c0883e3e6a
GLES3
11 years ago
Mikko Mononen
cd376082ba
Added MSAA option for backends
- added option to turn off AA fringe generation
- added examples which use no AA fringes and MSAA
11 years ago
Mikko Mononen
abbf2792c1
Merged GL2 and GLES2 backends
- merged GL ES2 and GL2 backends
- GL2 uses now same structure as GL3
11 years ago
Mikko Mononen
56574f6eb3
Apply font scaling to nvgTextBounds and nvgVertMetrics
11 years ago
Mikko Mononen
3d3c302e6c
GL3 uber shader
- added milliseconds to fps counter
- smooth fps reading a bit more
- changed GL3 to uber shader
11 years ago
Mikko Mononen
6bf81b6727
GL3: Combined vert shaders, fixed half pixel offset
11 years ago
Mikko Mononen
39602081e8
Fix for issue #11, added C++ guards
11 years ago
Mikko Mononen
8b234ca953
Improved rendering performance of convex shapes and on gl3 back-end
- set swap interval to 0 to better see performance
- draw convex shapes without stencil to speed things up
- improve vertex buffer upload for gl3
11 years ago