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

Palette management #5

Open
mdales opened this issue Mar 4, 2025 · 1 comment
Open

Palette management #5

mdales opened this issue Mar 4, 2025 · 1 comment
Labels
🏗️ enhancement New feature or request 🥇 good first issue Good for newcomers

Comments

@mdales
Copy link
Collaborator

mdales commented Mar 4, 2025

Currently Claudius has a palette that is of a fixed sized and fixed content when the library is initialised. This is problematic for many old demo effects that rely on cycling palette colours rather than redrawing the screen contents.

In funocaml24 I worked around this by generating many palettes, one per slide in my slide deck, and concatenating them before starting Claudius, and then having a per slide "shader" in the tick function that applied a suitable offset once the slide had been drawn to the framebuffer object. It works, but it's clearly wasteful.

The challenge here is trying to do this is a "functional"ish way. Perhaps the palette has to be part of the framebuffer object rather than a global? But then also the majority of time you don't want to change the palette, so then the API is cumbersome for the common case.

@mdales mdales added 🏗️ enhancement New feature or request 🥇 good first issue Good for newcomers labels Mar 4, 2025
@mdales
Copy link
Collaborator Author

mdales commented Mar 4, 2025

An alternative way would be to allow for a "mode change" ala the BBC micro, where you could change the screen size also - the palette is currently tied to the screen object, so it's not a huge leap.

The thing I disliked about all this is its stateful rather than functional, and I think one of the interesting differences about Claudius to TIC-80 or Love2D is making it deliberately functional, but then the OCaml way is to be more pragmatic, so are there good models for this already we can use?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏗️ enhancement New feature or request 🥇 good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant