
* DONE rect/ellipse/roundrect: bad tesselation (t-junctions)
   ! 30Aug2025
   ! C:01Sep2025
   + rewrite mesh generation code

* DONE RoundRectFillStrokeSym shader
   ! 02Sep2025
   ! simplified and more precise when rx==ry

* DONE LineStripFlatBevelEdgeAA14_2
   ! 03Sep2025

* DONE use glVertexAttribDivisor for line strips, lines, points
   ! 07Sep2025
   + 14Sep2025
   + 11Dec2025
   + -DUSE_VERTEX_ATTRIB_DIVISOR build option
   + -DTKMINNIE_DUPLICATE_POINT_VERTICES
   ! also requires GLSL3 gl_VertexID
   ! 11Dec2025: also requires GLSL3 gl_InstanceID

* DONE framebuffer size
   ! 07Sep2025
   + sdvg_SetFramebufferSize (sUI _w, sUI _h)
      ! required for bottom/left => top/left conversions

* DONE viewport stack
   ! 06Sep2025
   ! C:09Sep2025
   + (0;0) = top/left
   + reset in sdvg_BeginFrame()

* DONE scissor functions and stack
   ! 06Sep2025
   ! C:10Sep2025
   ! C:17Sep2025
   + (0;0) = top/left
   + reset in sdvg_BeginFrame()
   + sdvg_EnableScissor(), sdvg_DisableScissor()

* DONE fbo functions
   ! 06Sep2025
   ! C:07Sep2025
   ! C:10Oct2025
   + depth
   + stencil
   + msaa
   + resolve
   + test case (tkminnie/test.tks)
   + rewrite ui::FBO

* DONE global alpha scaling (fade drawables)
   ! 07Sep2025
   + sdvg_SetGlobalAlpha(float _a)
      + set global_a
   + if shader has color uniform(s): pre-multiply fill/stroke a by global_a
   + else add u_alpha and pass global_a to Draw*() function (gouraud*)

* DONE test 44 line strip bevel AA issue
   ! 07Sep2025
   + add v_join

* DONE line strip bevel t-junction issue
   ! 07Sep2025
   - ideally need to draw 4 triangles (instead of 2) per segment (excl. joint) and connect v2
   ! ==> SHADERVG_HIRES_GEO

* DONT add ShaderVG_VBO class
   ! 08Sep2025
   - sUI gl_vbo_id
   - sUI size
   ! ==> use glGetBufferParameteriv(GL_ARRAY_BUFFER, GL_BUFFER_SIZE, GLint *ret) to query buffer size

* TEST custom shader functions + OpenGL immediate-like buffer API
   ! 08Sep2025
   ! e.g. for tkui post processing shaders
   + add MAX_CUSTOM_SHADERS
   + add shaders array
      + reset in sdvg_OnOpen()
   + add sdvg_CreateShader(String vs, String fs) utility function
      + must have a_vertex attribute and u_transform uniform
      + derived from Shape class
         ! cache commonly used attribute and uniform locations
   + add sdvg_DestroyShader() utility function
   + add sdvg_BindShader(int _shaderIdx)
   x add sdvg_BindFillShader()
      - and set fill_r/g/b/a uniforms
   + add sdvg_Uniform1f(String name, float f)
   + add sdvg_Uniform2f(String name, float f1, float f2)
   + add sdvg_Uniform3f(String name, float f1, float f2, float f3)
   + add sdvg_Uniform4f(String name, float f1, float f2, float f3, float f4)
   + add sdvg_Uniform1i(String name, int i)
   x add sdvg_UniformMat4 function
      ! probably not needed, auto-set 'u_transform' to mvp_matrix
   x add sdvg_CopyToScratch(Buffer _data)
      - copy io_offset bytes to scratch buffer and return buffer offset
   + add sdvg_BeginTriangles(int _numVertices, int _stride) : boolean
      + flush scratch if numBytes(=numVertices*stride) won't fit
      + reset internal current_scratch_attrib_offset counter
      + returns true if scratch bytes were reserved successfully
      + also: sdvg_BeginTriangleFan(), sdvg_BeginTriangleStrip()
      + when sdvg_MapVBO() was called prior to sdvg_Begin*():
         + use mapped VBO as target for sdvg_Vertex/Attrib/Color/TexCoord() calls (write to buffer)
         + ignore sdvg_*Offset()
         + do not call glDrawArrays() in sdvg_glEnd()
      + when sdvg_BindVBO() was called prior to sdvg_Begin*():
         - ignore sdvg_Vertex/Attrib/Color/TexCoord() calls (do not allow writes to buffer)
         + use sdvg_*Offset() to setup VertexAttribPointer and enable vertex arrays
         + call glDrawArrays() in sdvg_glEnd()
   + add sdvg_VertexOffset2f()
      + set 'a_vertex' and enable
      x must/should be first call after AllocScratch()
      + inc attrib_offset by 8
      + add debug-build option that boundary-checks offset (against stride)
   ? add sdvg_VertexOffset2_14_2()
      - 16bit fixed point
   ? add sdvg_VertexOffset3f()
      - inc attrib_offset by 12
   ? add sdvg_VertexOffset4f()
      - inc attrib_offset by 16
   + add sdvg_AttribOffset1f(String name)
      + set custom attribute pointer and enable
      + inc attrib_offset by 4
   + add sdvg_AttribOffset2f(String name)
      + set custom attribute pointer and enable
      + inc attrib_offset by 8
   + add sdvg_AttribOffset3f(String name)
      + set custom attribute pointer and enable
      + inc attrib_offset by 12
   + add sdvg_AttribOffset4f(String name)
      + set custom attribute pointer and enable
      + inc attrib_offset by 16
   + add sdvg_AttribOffsetARGB(String name)
      + set custom attribute pointer and enable
      + inc attrib_offset by 4  (4ub)
   x add sdvg_MapVBO(int _vboId)
      - becomes target for Attrib*/Vertex2f functions
         - default = scratch_buffer
   x add sdvg_UnmapVBO()
   + add sdvg_Attrib1f(float f)
      - copy float to scratch buffer
      - add debug-build option that boundary-checks write-offset (against numVertices*stride)
   + add sdvg_Vertex2f(float f1, float f2) alias (macro)
      - copy 2 floats to scratch buffer
      ! maps to sdvg_Attrib2f()
   + add sdvg_TexCoord2f(float f1, float f2) alias (macro)
      - copy 2 floats to scratch buffer
      ! maps to sdvg_Attrib2f()
   + add sdvg_Color3f(float r, float g, float b) alias (macro)
      - copy 3 floats to scratch buffer
      ! maps to sdvg_Attrib3f()
   + add sdvg_Color4f(float r, float g, float b, float a) alias (macro)
      - copy 4 floats to scratch buffer
      ! maps to sdvg_Attrib4f()
   + add sdvg_ColorARGB(int c32) alias (macro)
      ! maps to sdvg_AttribARGB32()
      - use sdvg_WriteC32AsRGBA8
   + add sdvg_Attrib2f(float f1, float f2)
      - copy 2 floats to scratch buffer
   + add sdvg_Attrib3f(float f1, float f2, float f3)
      - copy 3 floats to scratch buffer
   + add sdvg_Attrib4f(float f1, float f2, float f3, float f4)
      - copy 4 floats to scratch buffer
   + add sdvg_AttribARGB(int c32)
      - convert to R,G,B,A bytes and write to scratch buffer
   + add sdvg_End()
      - set u_ob_fb_w, u_ob_fb_h uniforms when defined
         ! gl_FragCoord => -1..1
      - set u_fb_w, u_fb_h uniforms when defined
         ! y-flip
      + set u_transform (mandatory)
      + set u_color_fill when defined (fill_r, fill_g, fill_b, fill_a * global_a)
      + set u_color_stroke when defined (stroke_r, stroke_g, stroke_b, stroke_a * global_a)
      + set u_texture_decal_alpha when defined
      + set u_alpha when defined (global_a)
      + set u_debug when defined
      + set u_tex_0 when defined
      + set u_tex_1 when defined
      + call glDrawArrays
      + disable vertex attributes afterwards
   x add sdvg_DrawQuadShader(float _x, float _y, float _w, float _h)
      - write to scratch buffer
   x add sdvg_DrawQuadUVShader(float _x, float _y, float _w, float _h, float ul, float vt, float ur, float vb)
   x add sdvg_DrawQuadUV2Shader(float _x, float _y, float _w, float _h, float ul, float vt, float ur, float vb, float ul2, float vt2, float ur2, float vb2)
   x add sdvg_DrawTrianglesShader(FloatArray _vertices)
      - copy to scratch_buffer
      - 2 floats per vertex
   x add sdvg_DrawTrianglesUVShader(FloatArray _vertices)
      - 4 floats per vertex
      - copy to scratch_buffer
   x add sdvg_DrawTrianglesUV2Shader(FloatArray _vertices)
      - 6 floats per vertex
      - copy to scratch_buffer
   x add sdvg_DrawQuadsShader(FloatArray _vertices)
      - convert to triangles or treat as triangle fan if #vertices=4 and copy to scratch_buffer
      - 2 floats per vertex
   x add sdvg_DrawQuadsUVShader(FloatArray _interleavedVerticesAndUV)
      - convert to triangles or treat as triangle fan if #vertices=4 and copy to scratch_buffer
      - 4 floats per vertex
   x add sdvg_DrawQuadsUV2Shader(FloatArray _interleavedVerticesAndUVs)
      - convert to triangles or treat as triangle fan if #vertices=4 and copy to scratch_buffer
      - 6 floats per vertex
   x add sdvg_DrawPolygonShader(FloatArray _vertices)
      - copy to scratch_buffer
      - 2 floats per vertex
      - draw (convex) GL_TRIANGLE_FAN (== GL_POLYGON)
   x add sdvg_DrawPolygonUVShader(FloatArray _interleavedVerticesAndUV)
      - copy to scratch_buffer
      - 4 floats per vertex
      - draw (convex) GL_TRIANGLE_FAN (== GL_POLYGON)
   x add sdvg_DrawPolygonUV2Shader(FloatArray _interleavedVerticesAndUVs)
      - copy to scratch_buffer
      - 6 floats per vertex
      - draw (convex) GL_TRIANGLE_FAN (== GL_POLYGON)

* TEST multi-texturing
   ! 08Sep2025
   ! C:17Sep2025
   x add sdvg_BindTexture2DEx(sUI _unitIdx, sUI _texId, sBool _bRepeat, sBool _bFilter)
   x add sdvg_UnbindTexture2DEx(sUI _unitIdx)
   x or: add unitIdx by default (w/o Ex suffix)
   ! or:
      + add sdvg_BindMultiTexture2D(sUI _unitIdx, sUI _texId, sBool _bRepeat, sBool _bFilter)
      + add sdvg_UnbindMultiTexture2D(sUI _unitIdx)

* DONE use Dsdvg_errorprintf macro
   ! 08Sep2025

* DONE use Dsdvg_printf, Dsdvg_printfv macros
   ! 08Sep2025

* TODO easings
   ! 08Sep2025
   ! convert from gmodtween.tks

* DONE color functions
   ! 09Sep2025
   ! C:10Sep2025
   + sU32 sdvg_ARGBx (sU8 _a, sU8 _r, sU8 _g, sU8 _b)
   + sU32 sdvg_ARGBf (sF32 _a, sF32 _r, sF32 _g, sF32 _b)
   + sU32 sdvg_MixARGBx (sU32 _x, sU32 _y, sU16 _t)
   + sU32 sdvg_MixARGBf (sU32 _x, sU32 _y, sF32 _t)
   + sU32 sdvg_TintARGB (sU32 _x, sU32 _y)
   + sU32 sdvg_TintARGBAlpha (sU32 _x, sU32 _y, sU8 _a8)
   + sU32 sdvg_HSVAToARGB (sF32 _h, sF32 _s, sF32 _v, sU8 _a8)
   + sU8 sdvg_ARGBToHSVA (sU32 _c32, sF32 *_retH, sF32 *_retS, sF32 *_retV)

* DONE add AA suffix to RectFill, Ellipse, RoundRect, .. classes and setup/draw functions
   ! 10Sep2025
   ! e.g. sdvg_DrawRoundRectFillStrokeVBO32() => sdvg_DrawRoundRectFillStrokeAAVBO32()

* DONE rename LineStrip*EdgeAA* to LineStripAA
   ! 10Sep2025

* DONE add non-AA draw functions, e.g. sdvg_DrawFilledRectangle(), sdvg_DrawRectangle()
   ! 10Sep2025
   ! C:11Sep2025

* DONE add sdvg_DrawLinesFlatAA()
   ! 10Sep2025

* DONE add sdvg_BeginLineStrip(sUI _numPoints)
   ! 10Sep2025
   + emit line vertices into scratch buffer or user vbo
   + redirect sdvg_Vertex2f() to sdvg_BufferAddLinePointFlat14_2()
   + call sdvg_DrawLineStripFlatVBO14_2() in sdvg_End()

* DONE add sdvg_BeginLineStripAA(sUI _numPoints)
   ! 10Sep2025
   + emit line vertices into scratch buffer or user vbo
   + redirect sdvg_Vertex2f() to sdvg_BufferAddLinePointFlat14_2()
   + call sdvg_DrawLineStripFlatAAVBO14_2() in sdvg_End()

* DONE add sdvg_BeginLineStripBevel(sUI _numPoints)
   ! 10Sep2025
   + emit line vertices into scratch buffer or user vbo
   + redirect sdvg_Vertex2f() to sdvg_BufferAddLinePointFlatBevel14_2()
   + call sdvg_DrawLineStripFlatBevelVBO14_2() in sdvg_End()

* DONE add sdvg_BeginLineStripBevelAA(sUI _numPoints)
   ! 10Sep2025
   + emit line vertices into scratch buffer or user vbo
   + redirect sdvg_Vertex2f() to sdvg_BufferAddLinePointFlatBevel14_2()
   + call sdvg_DrawLineStripFlatBevelAAVBO14_2() in sdvg_End()

* DONE add sdvg_BeginLines(sUI _numPoints)
   ! 10Sep2025
   + emit line vertices into scratch buffer or user vbo
   + redirect sdvg_Vertex2f() to sdvg_BufferAddLinePointFlat14_2()
   + call sdvg_DrawLinesFlatVBO14_2() in sdvg_End()

* DONE add sdvg_BeginLinesAA(sUI _numPoints)
   ! 10Sep2025
   + emit line vertices into scratch buffer or user vbo
   + redirect sdvg_Vertex2f() to sdvg_BufferAddLinePointFlat14_2()
   + call sdvg_DrawLinesFlatAAVBO14_2() in sdvg_End()

* DONE make b_vbo mandatory
   ! 10Sep2025
   ! C:17Sep2025
   ! sdvg_BeginLineStrip() etc depend on it
      ! sdvg_DrawLineStrip*() requires vboId argument

* DONE need to scale StrokeWidth() if viewport != fb && projection != fb
   ! 11Sep2025
   ! e.g. Bezier01Edit sets up Ortho(1,1) projection and viewport for widget area
   ! app must call UIRenderer.SetLineWidth() after changing viewport/projection
   + sdvg_SetPixelScaling()
   ! ==> BUT: see below, this should be avoided b/c of non-square-pixel issues

* DONE script: sdvg_SetPixelScaling(), Line*32, BufferAddLine*32
   ! 11Sep2025

* DONE add PointsRect, PointsRoundAA shaders
   ! 12Sep2025
   + center per point
   + tesselate point in vs
   + reuse BufferAddLinePointFlat32(YAC_Buffer *_b, sF32 _x1, sF32 _y1)
      ! duplicate 6 times (two triangles, 6 vertices)
      ! add another 6 'pad' vertices (similar to Lines*())
   + uniform u_points_radius (x==y) (+u_color_fill)

* DONE lineStripAA, linesAA, pointsAA: non-square-pixel projection+viewport issue
   ! 12Sep2025
   - e.g. BezierEdit ortho(1,-1))
      + transform points in app from normalized coordinate system to 2D coordinates
         + Matrix2x3f.initOrtho()

* DONE update UI shaders to ShaderVG
   ! 12Sep2025
   ! 13Sep2025
   + e.g. GraphForm gradient/pattern fill
   + PNGIcon Shader_InvertColor
   + FBO Shader_ColorGrading, Shader_SharpenFilterAndColorGrading
   + Panel: use beginFilledTriangle*Ex() when shader != null  (gradient, patternfill, ..)
      + DrawFilledRectangle
      + DrawRoundedRectangleTriEx
      + rhomb
      + diamond
      + tri

* DONE move UIRenderer shader_fill / shader_tex related functions to ShaderVG
   ! 12Sep2025
   ! duplicate shaders (see shadervg.cpp:fill_shader and TrianglesTexUVFlat32 shape)
   + UIRenderer.BeginFilledTriangles()
   + UIRenderer.BeginFilledTriangleFan()
   + UIRenderer.BeginFilledTriangleStrip()
   + UIRenderer.BeginFilledGouraudTriangles()
   + UIRenderer.BeginFilledGouraudTriangleFan()
   + UIRenderer.BeginFilledGouraudTriangleStrip()
   + UIRenderer.BeginTexturedTriangles()
   + UIRenderer.BeginTexturedTriangleFan()
   + UIRenderer.BeginTexturedTriangleStrip()

* DONE update tksampleedit
   ! 13Sep2025
   + render_sample.cpp
   + render_rms.cpp
      ! uses glPushMatrix()
         + replace by offY
   ! 'gradient' / 'gradient+lines' render modes very slow (compared to just lines or dots)
      + disable gradient when zoomed out

* NOTE mapped VBO writes rather slow (macOS)
   ! 14Sep2025
   ? use mirror buffer and call glBufferSubData() in sdvg_End()
   ? use GL_UNSYCHRONIZED (and fences? or simply wait when buffer size is exceeded ?)
   + add -DSHADERVG_USE_SCRATCHBUFFERSUBDATA
      ! ==> still slow
   ! ==> but: it's still roughly as fast as the immediate mode.
          ! the built-in GL lines are properly faster (but not as 'pretty')

* DONE add TriangleTexAlphaUV variants
   ! 16Sep2025
   ! GLcore profile requires GL_RED instead of GL_ALPHA (must use texture(..).r instead of texture(..).a)
      ! GL_ARB_texture_swizzle extension not available on macOS (4.1 core)
      + TEX_ALPHA string replace
   ! besides, need to handle rgb modulate differently, anyway (texture rgb is 0, cannot multiply this)
   + TrianglesTexUVFlat32Alpha
   + TrianglesTexUVFlatDecal32Alpha
   + TrianglesTexUVGouraudAlpha
   + TrianglesTexUVGouraudDecal32Alpha
   + YF sBool YAC_CALL sdvg_BeginTexturedTrianglesAlpha (sUI _numVertices);
   + YF sBool YAC_CALL sdvg_BeginTexturedTriangleFanAlpha (sUI _numVertices);
   + YF sBool YAC_CALL sdvg_BeginTexturedTriangleStripAlpha (sUI _numVertices);
   + YF sBool YAC_CALL sdvg_BeginTexturedGouraudTrianglesAlpha (sUI _numVertices);
   + YF sBool YAC_CALL sdvg_BeginTexturedGouraudTriangleFanAlpha (sUI _numVertices);
   + YF sBool YAC_CALL sdvg_BeginTexturedGouraudTriangleStripAlpha (sUI _numVertices);
   + remove (temporary) 32bit tex_font in NT_PatternView

* IDEA LinesColorAA
   ! 16Sep2025
   - ARGB color attribute per line
   x e.g. for modcv_scope

* DONE sdvg_EnableScissor(), sdvg_DisableScissor()
   ! 16Sep2025
   ! C:17Sep2025

* TEST texture memory allocation and uploads
   ! 17Sep2025
   ! glTexStorage, glTexImage2D, glTexImage3D, ..
   x sdvg_AllocTexture2D(w,h)
   x sdvg_AllocTexture2DAlpha(w,h)
   x sdvg_UploadTexture2D(w,h,void*data)
   x sdvg_UploadTexture2DAlpha(w,h,void*data)
   x sUI sdvg_CreateTexture2D(sUI format, sUI w, sUI h, const void *data, sUI dataSz, sUI dataStride)
   x sUI sdvg_CreateTexture2D(sUI format, sUI w, sUI h, const void *data, sUI dataSz, sBool bFlipY)
   + sUI sdvg_CreateTexture2D(sUI format, sUI w, sUI h, const void *data, sUI dataSz)
      + SDVG_TEXFMT_ALPHA8
      ? SDVG_TEXFMT_LUM8
         ! would require shader duplication and additional draw functions
         ? maybe leave this to custom shaders (rare use case?)
      o SDVG_TEXFMT_RGB565
      + SDVG_TEXFMT_RGBA8888
      + SDVG_TEXFMT_BGRA8888
      ? SDVG_TEXFMT_BC1
   x sUI sdvg_CreateTexture2DAlpha(sUI format,w,h,void *data,sUI dataSz)
   ? sUI sdvg_CreateTexture2DPhys(sUI format,sUI w, sUI h,const void *dataPhys)
   ? void sdvg_DestroyTexture(sUI _texId);

* TODO compile time switch for glGetError reporting
   ! 17Sep2025

* DONE use macros for tkopeng_shared calls
   ! 18Sep2025
   + Dsdvg_glcall

* DONE dashed lines (line stipple)
   ! 18Sep2025

* DONE (polygon) paint fill pattern
   ! 18Sep2025

* IDEA (polygon) texture matrix
   ! 18Sep2025

* TEST linear, radial, conical fill gradients (triangles)
   ! 18Sep2025
   ! C:28Sep2025
   + add paint_mode
   + sdvg_PaintSolid()
   + sdvg_PaintLinear(float _startX, float _startY, float _endX, float _endY)
      + add TrianglesFillFlat32Linear shader
   + sdvg_PaintRadial(float _centerX, float _centerY, float _radiusX, float _radiusY)
      x transform center+radius via modelview matrix
      x pass v_paint_pos to fragment shader
      + store center+radius in uniforms
      + pass untransformed v_paint_pos to fragment shader
      + add TrianglesFillFlat32Radial shader
      - add PolygonFillFlat32Radial shader
      + in UpdateShaderUniforms: update u_paint_tex, u_paint_start, u_paint_end, u_paint_radius, ?u_paint_angle?
      + focal point
         + == gradient center point == startX/Y
   + sdvg_PaintConic(sF32 _startX, sF32 _startY, sF32 _radiusX, sF32 _radiusY, sF32 _angle01)
      + add TrianglesFillFlat32Conic shader
   + in BeginFilledTriangles / BeginFilledTriangleFan / BeginFilledTriangleStrip
      - select shader according to current paint mode

* TEST linear, radial, conical fill gradients (polygons)
   ! 18Sep2025
   ! C:28Sep2025
   ! C:01Oct2025
   ! C:02Oct2025
   ! C:03Oct2025
   ! C:04Oct2025
   ! C:05Oct2025
   ! cannot use varyings when using (dnx) polygon rasterizer
   x transform gl_FragCoord to vPaintPos
      - transform gl_FragCoord to viewport NDCs
         - add vec4 u_vp_geo

* TODO sdvg_BindTexture2D: add mirrored repeat option
   ! 18Sep2025
   - SDVG_REPEAT_UV = 1
   - SDVG_MIRRORED_REPEAT_UV = 2
   - SDVG_REPEAT_U = 3
   - SDVG_MIRRORED_REPEAT_U = 4
   - SDVG_REPEAT_V = 5
   - SDVG_MIRRORED_REPEAT_V = 6

* TEST bitmap fonts
   ! 18Sep2025
   ! C:19Sep2025
   ! C:27Sep2025
   ! ../../../../tkui/utils/font_convert.tks
      ! out: ../../../../tkui/utils/default_15.cpp
      ! out: ../../../../tkui/utils/default_15.png
   + minnie/tools/font_convert/
   + sdvg_InitFont()
   + sdvg_FontOnOpen();
   + sdvg_BindFont()
   + sdvg_DrawString()
   + sdvg_UnbindFont()
   + sdvg_StringExtents();
   + sdvg_StringWidth();
   + sdvg_StringHeight();
   o sdvg_StringGlyphBBox()
   o sdvg_StringIndexAtPixelX()
   o render
      + skip accelerator key escape seq \a
   + render clipped
   + render underlines
   + render underlines clipped
   + render accelerator key underlines
      + accelerator key escape seq \a
   + render accelerator key underlines clipped

* TODO bitmap font unicode support
   ! 18Sep2025
   - codepoint to glyph index table
 
* NOTE moved from tks-projects/libs/shadervg/doc/todo.txt
   ! 19Sep2025

* DONE LineStripFlatMiterAA14_2, LineStripFlatMiterAA32
   ! 19Sep2025
   ! C:11Dec2025

* ACTV non-zero polygon fill mode (hw)
   ! 20Sep2025

* TEST signed distance field font rendering
   ! 26Sep2025
   ! C:27Sep2025
   ! C:28Sep2025
   ! C:29Sep2025
   ! C:30Sep2025
   ! https://steamcdn-a.akamaihd.net/apps/valve/2007/SIGGRAPH2007_AlphaTestedMagnification.pdf
   ! https://tkmikyon.medium.com/computing-the-signed-distance-field-a1fa9ba2fc7d
   ! "fast marching method" (FMM) [by James Sethian]
      ! "The Fast Marching Method (FMM) calculates a distance field from an image by solving a
          numerical approximation of the Eikonal equation, effectively propagating a wavefront from a 
          starting boundary to compute the minimum distance to that boundary for every pixel in the image. 
          This method uses a heap to efficiently track the expanding interface, prioritizing cells closest to the
          boundary and updating their neighbors, resulting in a distance map representing the Euclidean distance to the
          closest feature pixel."
   ! https://github.com/Chlumsky/msdfgen
      ! https://github.com/Chlumsky/msdfgen/files/3050967/thesis.pdf
      ! https://github.com/Chlumsky/msdf-atlas-gen
   + extend font_convert and add distance field calculation
      + 'sdf' cmdline arg
      + 'sdf*' Makefile targets
   + add sdf_radius field to sdvg_font_info_s
   - add "--keep-texture,-kt" arg to font_convert
   ? add font_convert cmdline args --sdf-minmax "min_min;min_max;def_min;def_max;max_min;max_max"
      - store minify,normal,magnify u_a_min/u_a_max settings to font file
      - update shader and convert aMin/aMax consts to uniforms
      - add sdvg_DrawTextScaled()
   + add sdvg_SetAlphaSDFRange()
   + add sdvg_SetAlphaSDFExp()

* DONE add sdvg_UpdateTexture2D()
   ! 28Sep2025

* DONE skip last segment bevel line joint
   ! 11Dec2025
   + u_last_instance

* DONE test 84 polygon outline antialiasing broken (pattern decal alpha)
   ! 11Dec2025

* NOTE https://www.writtenchinese.com/150-common-chinese-characters-list/
   ! 07Jan2026

* NOTE AAA shaders
   ! 07Jan2026
   ! supported AAA render paths:
     - flat shaded lines
     - lines with pattern paint
     - gouraud shaded lines (per control-point color)
     - flat shaded polylines
     - flat shaded polylines with bevel line joints
     - flat shaded polylines with miter line joints
     - polylines with conic paint
     - polylines with radial paint
     - polylines with linear paint
     - polylines with pattern paint
     - polylines with alpha pattern paint
     - polylines with decal pattern paint
     - polylines with bevel joints and pattern paint
     - polylines with bevel joints and decal pattern paint
     - dashed polylines
     - dashed polylines with bevel line joints
     - decal dashed polylines
     - decal dashed polylines with bevel line joints
     - polygons (via polyline stroke. all paint types)
     - square and round points
     - square and rounds points with per-point color
     - flat shaded, stroked rectangles
     - stroked rectangles with conic paint
     - stroked rectangles with radial paint
     - stroked rectangles with linear paint
     - stroked rectangles with pattern paint
     - stroked rectangles with alpha pattern paint
     - stroked rectangles with decal pattern paint
     - flat shaded, filled rectangles
     - filled rectangles with conic paint
     - filled rectangles with radial paint
     - filled rectangles with linear paint
     - filled rectangles with pattern paint
     - filled rectangles with alpha pattern paint
     - filled rectangles with decal pattern paint
     - flat shaded, filled + stroked rectangles
     - flat shaded, stroked rounded rectangles
     - stroked rounded rectangles with conic paint
     - stroked rounded rectangles with radial paint
     - stroked rounded rectangles with linear paint
     - stroked rounded rectangles with pattern paint
     - stroked rounded rectangles with alpha pattern paint
     - stroked rounded rectangles with decal pattern paint
     - flat shaded, filled rounded rectangles
     - filled rounded rectangles with conic paint
     - filled rounded rectangles with radial paint
     - filled rounded rectangles with linear paint
     - filled rounded rectangles with pattern paint
     - filled rounded rectangles with alpha pattern paint
     - filled rounded rectangles with decal pattern paint
     - flat shaded filled + stroked rounded rectangles
     - flat shaded, stroked ellipses
     - stroked ellipses with conic paint
     - stroked ellipses with radial paint
     - stroked ellipses with linear paint
     - stroked ellipses with pattern paint
     - stroked ellipses with alpha pattern paint
     - stroked ellipses with decal pattern paint
     - flat shaded, filled ellipses
     - filled ellipses with conic paint
     - filled ellipses with radial paint
     - filled ellipses with linear paint
     - filled ellipses with pattern paint
     - filled ellipses with alpha pattern paint
     - filled ellipses with decal pattern paint
     - flat shaded, filled + stroked ellipses
     .. in addition:  almost all of these render paths have dedicated FixPoint14:2 and FloatingPoint32 versions

* TEST add support for n-polygon sub-paths
   ! 20Jan2026
   ! C:17Mar2026
   - sdvg_BeginPolygonPath()
      - call Dsdvg_stencil_poly_pass1();  // enable stencil test, set op=INCR, colormask=off
   - sdvg_DrawPolygonSubPath()
      - just update stencil buffer using simple const color shader (color will be ignored)
      - variant 1: render prepared VBO
      - variant 2: sdvg_BeginPolygonSubPath(), sdvg_EndPolygonSubPath()  (use scratch VBO)
   - sdvg_EndPolygonPath(sdvg_bbox_t _bbox)
      - call Dsdvg_stencil_poly_pass2();  // set stencil func EQUAL
      - fill bounding box
         - use paint or custom shader
      - call Dsdvg_stencil_poly_end();    // disable stencil test
   - issue: AA outlines won't work (must use MSAA)
   + sdvg_PolygonFillFlatUniformAAVBO14_2_*() (BeginPass1, DrawPass1, BeginPass2, End)

* DONE rename TrianglesFillFlat32, TrianglesFillFlat14_2 to TrianglesFillGouraud32, TrianglesFillGouraud14_2
   ! 24Feb2026

* DONT change TrianglesFillFlat32 to use instanced rendering and flat vertex color
   ! 24Feb2026
   - one color per triangle
   - draw <num_triangles> instances
   ! ==> too slow

* DONE add bSkipLastLineJoint to sdvg_DrawLineStripFlatMiterVBO14_2()
   ! 27Feb2026
   + sdvg_DrawLineStripFlatMiterAAVBO14_2
   + sdvg_DrawLineStripFlatMiterVBO32
   + sdvg_DrawLineStripFlatMiterAAVBO32

* DONE support SHADERVG_HIRES_GEO in LineStripFlatMiter* shaders
   ! 27Feb2026

* DONE SHADERVG_USE_DEFAULT_POINT_14_2
   ! 01Mar2026

* DONE LineStripFlatBevelAA32Pattern, LineStripFlatBevelAA14_2Pattern
   ! 11Mar2026
   + support in loc_DrawLineStripFlatAAVBOPaint  (previously named Gradient)
   + sdvg_BeginLineStripBevelPaint()
   + sdvg_BeginLineStripBevelPaintClosed()
   + sdvg_BeginLineStripBevelAAPaint()
   + sdvg_BeginLineStripBevelAAPaintClosed()

* TEST add SHADERVG_DEBUG_FRAG build option
   ! 13Mar2026
   ! C:21Mar2026
   ! C:22Mar2026

* DONE optimize line shaders
   ! 14Mar2026
   + flat

* TODO analyze bevel vs miter fragment shader disassembly discrepancies
   ! 14Mar2026

* DONE add remaining LineStripFlatBevel* paint shaders
   ! 14Mar2026

* DONE non-zero fill rule
   ! 14Mar2026
   ! C:21Mar2026
   ! based on stencil_polygon.tks
   + sdvg_SetFillRuleNonZero()
   + sdvg_SetFillRuleEvenOdd()

* TODO add build option for using LineStripFlatBevel instead of LineStripFlat shaders for polygon outlines
   ! 14Mar2026
   + needs two additional (repeated) vertices (add in Minnie)
   - add build option (bevel is now the new default)

* TEST add SHADERVG_USE_DEFAULT_TRIANGLE_14_2
   ! 14Mar2026
   - Begin*Triangles* stride
   - sdvg_VertexAttrib2f, ..
   - update loc_bind_default_triangles_fill_flat_uniform_shape()

* TEST add SHADERVG_AA_EXP build option
   ! 14Mar2026
   ! C:21Mar2026
   ! C:22Mar2026
   + update fragment shaders (e.g. RectStrokeAA.h)

* DONT add RectFillAAVBO32Paint(), RoundRectFillAA32VBO32Paint(), ..
   ! 15Mar2026
   + but add Shape *Paint() shaders

* DONE add PointsRoundAA*Conic/Linear/Radial/Pattern* shaders
   ! 15Mar2026
   ! for use as line joins and caps

* TODO add PointsSquareAA*Conic/Linear/Radial/Pattern* shaders
   ! 15Mar2026
   x for use as line joins and caps (==> nope, these need to be rotated)

* DONE remove sdvg_BeginLineStripBevelAAPaint / rename to sdvg_BeginLineStripBevelAA()
   ! 15Mar2026

* DONE don't apply stroke_scale to anti-aliased polygon outlines
   ! 17Mar2026

* DONE change SHADERVG_NO_ZS to SHADERVG_DEPTH + SHADERVG_STENCIL
   ! 18Mar2026

* DONE add sdvg_SetFillRuleNonZero(); sdvg_SetFillRuleEvenOdd()
   ! 21Mar2026

* DONE LineStripPatternMiterAA14_2/32
   ! 24Mar2026
   ! C:27Mar2026

* DONE use uniform array to replace Points +- point_radius calculation switch
   ! 25Mar2026
   ! C:26Mar2026
   + SHADERVG_UNIFORM_ARRAY build option
   + PointsSquareAA14_2
   + PointsSquareAA32
   + PointsSquareGouraudAA14_2
   + PointsSquareGouraudAA32
   + PointsRoundAA14_2
   + PointsRoundAA14_2Conic
   + PointsRoundAA14_2Linear
   + PointsRoundAA14_2Pattern
   + PointsRoundAA14_2PatternAlpha
   + PointsRoundAA14_2PatternDecal
   + PointsRoundAA14_2PatternDecalAlpha
   + PointsRoundAA14_2Radial
   + PointsRoundGouraudAA14_2
   + PointsRoundAA32
   + PointsRoundAA32Conic
   + PointsRoundAA32Linear
   + PointsRoundAA32Pattern
   + PointsRoundAA32PatternAlpha
   + PointsRoundAA32PatternDecal
   + PointsRoundAA32PatternDecalAlpha
   + PointsRoundAA32Radial
   + PointsRoundGouraudAA32

* DONE add sdvg_DrawPointsRoundPatternDecalAA32/14_2()
   ! 27Mar2026

* DONE LineStripPatternDecalMiterAA14_2/32
   ! 27Mar2026

* DONE add tests 211..218 (line strip pattern miter)
   ! 27Mar2026

* DONE add LineStripFlatMiterAA*Conic/Linear/Radial/Pattern* shaders
   ! 27Mar2026

* DONE add tests 219..236 (line strip miter paint)
   ! 27Mar2026
