Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide wrapped functions with all the options exposed #61

Open
dpwiz opened this issue Jun 15, 2021 · 1 comment
Open

Provide wrapped functions with all the options exposed #61

dpwiz opened this issue Jun 15, 2021 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed internals Implementation details
Milestone

Comments

@dpwiz
Copy link
Member

dpwiz commented Jun 15, 2021

A follow-up to #52, but can be done concurrently.

The current functions can remain intact and a new set of functions can be added as a cheap wrapper for raw procedures.

-- current
withWindowOpen :: MonadUnliftIO m => String -> m () -> m ()

-- proposed
withWindowOpen' :: (MonadUnliftIO m, StateVar Bool isOpen) => ImGuiWindowFlags -> isOpen -> String -> m () -> m ()

Fancy wrappers (labels, lenses, etc.) can be provided as alternatives in their own packages.

Cons: this will double the amount of functions published. The previous implementation, however, can be rebased upon those new expanded.

Alternative 1: Add all the arguments to existing functions. A breaking change, a bit noisier to write but lighter on maintenance.

Alternative 2: Rename current shortcuts to underscored, add expanded versions like in A1. Also a breaking change and may require breakage again when "expandable defaults" are to be implemented.

@dpwiz dpwiz added enhancement New feature or request help wanted Extra attention is needed internals Implementation details labels Jun 15, 2021
@chekoopa
Copy link
Contributor

chekoopa commented Nov 7, 2021

It is possible to put expanded version in a separate module, so "sensible default" shortcuts would stay at their place, and special scenarios could incorporate something like DearImGui.LowLevel.

UPD: As DearImGui.Raw exists already, we would expand them, and then add aforementioned LowLevel module, on which sensible defaults are built.

@dpwiz dpwiz added this to the v2 milestone Mar 23, 2022
@dpwiz dpwiz modified the milestones: v2, v3 Jul 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed internals Implementation details
Projects
None yet
Development

No branches or pull requests

2 participants