Repository navigation
Conversation
- Fill polygons with indexed triangle meshes via glVertexPointer and glDrawElements - Draw outlines from the original rings instead of triangle edges - Accept concave, holed and multipart scenes; drop the convexity checks - Reject scenes whose polygons lack a usable fill mesh so the coordinator falls back to GDI - Extend renderer tests with concave, holed, multipart and GDI-equivalence coverage - Update the ActiveX architecture memory to the mesh-based rendering model
Julian-MW
left a comment
There was a problem hiding this comment.
Found one rendering-order regression in the OpenGL path. See the inline comment.
| for (std::size_t index = 0; index < count; ++index) | ||
| /// Draws the original ring boundaries of one layer as outlines. | ||
| /// Triangle edges are not polygon boundaries and are never drawn. | ||
| void DrawLayerOutlines( |
There was a problem hiding this comment.
[P2] Preserve polygon painter order within a layer. DrawLayerFills currently renders every polygon in the layer before DrawLayerOutlines renders any of their boundaries. The GDI backend (and the previous OpenGL implementation) processes polygons one at a time, filling and outlining each polygon before moving to the next. When two polygons in the same layer overlap, this split pass leaves the earlier polygon's outline visible on top of the later polygon's fill, whereas GDI correctly covers it. Please keep fill/outline ordering per polygon (while still using that polygon's mesh for the fill), and add an overlapping-polygons-in-one-layer parity test.
There was a problem hiding this comment.
🟡 Changes recommended
Drawing all fills before outlines exposes earlier polygon boundaries over later overlapping fills, regressing the previous OpenGL and GDI rendering order.
1 open issue
What changed in this PR
This PR connects the OpenGL backend to the Core triangulation introduced in #66, enabling GPU rendering of concave polygons, holes, and multipart geometry without COM interface changes.
Changes:
- Replaces
GL_POLYGONfills with indexed triangles and draws outlines from original rings. - Validates meshes and falls back to GDI when any polygon lacks a usable mesh.
- Adds geometry-support and rendering tests, including sampled GDI/OpenGL comparisons.
Builds and tests were not run during this review.
| File | Description |
|---|---|
tests/MapWinGIS.ActiveX.Tests/VectorLayerRendererTests.cpp |
Adds mesh preparation, rendering checks, and fallback coverage. |
tests/MapWinGIS.ActiveX.Tests/OpenGlVectorLayerRendererTestAccess.h |
Exposes scene-support checks without an OpenGL context. |
src/MapWinGIS.ActiveX/OpenGlVectorLayerRenderer.h |
Documents mesh-based rendering and declares the support hook. |
src/MapWinGIS.ActiveX/OpenGlVectorLayerRenderer.cpp |
Validates meshes, renders indexed fills, and outlines original rings. |
.ai/memory/architecture/activex.md |
Updates the documented OpenGL support contract. |
Review effort: Balanced
| _lastFailureReason = L"OpenGL could not allocate its vertex buffers."; | ||
| return fillsResult; | ||
| } | ||
| DrawLayerOutlines(layer.scene, *transform); |

Phase 2 of the polygon triangulation plan: the OpenGL backend now consumes the Core-prepared triangle meshes instead of
GL_POLYGON, so concave polygons, interior rings and multipart geometries render on the GPU.Depends on #66 (stacked; base branch is
polygon-triangulation-core).What changed
glVertexPointer,glDrawElements,glEnableClientState); noGL_POLYGONremains.VectorRenderScene, so exterior, hole and multipart boundaries are preserved and internal triangle edges are never outlined.GL_POLYGONapproximation.Tests
Debug | x64builds with no new Level 4 warnings;MapWinGIS.Core.Tests: 311 passed (1 pre-existing network skip);MapWinGIS.ActiveX.Tests: 65 passed (2 pre-existing skips).Memory
.ai/memory/architecture/activex.md: replaced the "convex single-ring only" limit with the mesh-based backend contract. No new memory files.