Skip to content

feat: expose WindowCfg.sample_count (MSAA) and forward to gg.new_context#61

Open
MartenH wants to merge 1 commit into
vlang:mainfrom
MartenH:feat/windowcfg-sample-count
Open

feat: expose WindowCfg.sample_count (MSAA) and forward to gg.new_context#61
MartenH wants to merge 1 commit into
vlang:mainfrom
MartenH:feat/windowcfg-sample-count

Conversation

@MartenH

@MartenH MartenH commented Jun 14, 2026

Copy link
Copy Markdown

gg already supports MSAA through Config.sample_count, and gg.new_context() forwards it to sokol — but gui hard-codes the default (1 = off) and gives apps no way to turn it on.

This adds a sample_count field to WindowCfg (default 1, so it's a no-op for every existing app) and forwards it to gg.new_context():

pub struct WindowCfg {
pub:
	...
	sample_count int = 1 // MSAA sample count (1 = off; 4 antialiases draw_canvas lines/polygons)
}

With sample_count: 4, draw_canvas lines/polygons (e.g. real-time signal plots) render antialiased instead of jagged. No behaviour change unless an app opts in.

v fmt-clean; two added lines (the field + the pass-through).

gg already supports MSAA via Config.sample_count (and new_context forwards it),
but gui hard-codes the default (1 = off) with no way to enable it. Add a
sample_count field to WindowCfg (default 1, so it's inert for existing apps) and
pass it through to gg.new_context. With sample_count: 4, draw_canvas lines and
polygons (e.g. real-time signal plots) render antialiased instead of jagged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant