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

Graphics in Novika #17

Open
homonoidian opened this issue Aug 25, 2022 · 4 comments
Open

Graphics in Novika #17

homonoidian opened this issue Aug 25, 2022 · 4 comments
Labels
enhancement New feature or request future Not urgent

Comments

@homonoidian
Copy link
Collaborator

I guess when Novika is fast enough for the following there'd need to be a cross-platform graphics library. An API similar to that of tigr would be enough, plus proper font support instead of tigrfont or some other utility like that. In this sense, SDL+SDL TTF is an obvious choice for Crystal because no matter how much I like CrSFML, it brings too many runtime dependencies with it. And obviously porting Tigr would be too dumb 💯

Anyway, this is a TODO more than an issue, but still. Novika block viewer should be written in Novika (at least to prove its stability), so closing this will be a tiny step towards a brighter future.

@homonoidian
Copy link
Collaborator Author

homonoidian commented Aug 25, 2022

"OpenGL and glfw" sounds about 3 months of learning to me, so this is a hard no because I have a lot of other things to do.

@homonoidian homonoidian added enhancement New feature or request future Not urgent labels Aug 25, 2022
@homonoidian
Copy link
Collaborator Author

The simplest solution as of now is to drop termbox2 and use SDL with some bitmap font, all built into the binary so that there are as little files to drag around as possible. Writing a fast-ish console is possible. This will allow to slowly migrate one's project from a text-based to more complex UI (e.g. by allowing to load sprites into cells, allocating multiple cells for an image, allowing to select a font for a cell/cells, etc.), have more events, etc.

@homonoidian homonoidian added this to the 0.0.3 milestone Sep 2, 2022
@homonoidian
Copy link
Collaborator Author

Graphics/console that supports live changes (and that is certainly brewing) is too hard the way it is done now. The second I use spawn with GUI, all shit breaks loose because now we have protocols to follow and there is always the issue of events: who and how and where would get notified about them, and how would that be handled Novika-side?

If interacting with a GUI from the terminal properly, live, is near to impossible under one binary (at least for me to implement, now), then we should make a GUI with a "terminal". Meaning something like world, with some small notepad-ish activity/playground at first, later an advanced structured editor.

It seems that I should rewrite world to make it more supportable, and use it instead of (or as) bin/novika. The way you open e.g. Code code file.nk, you should be able to open world: ./bin/novika files packages directories (i.e. the same way as it is currently). I think I'd use SFML solely because it supports bitmap fonts (e.g. Cozette), and I like them so much I'd go with a different, heavier library. Plus they have easy math. SFML provides a bit more in terms of functionality, too, and we can use that later.

Idk whether I'll be able to merge something like world until 24th, but I guess I'll try. If not, this moves to 0.0.4.

@homonoidian homonoidian removed this from the 0.0.3 milestone Sep 22, 2022
@homonoidian
Copy link
Collaborator Author

Seems this thing is 0.0.10ish haha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request future Not urgent
Projects
None yet
Development

No branches or pull requests

1 participant