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

Accept fill texture embed (ByteString) #8

Merged
merged 2 commits into from
Feb 26, 2016

Conversation

cies
Copy link

@cies cies commented Feb 26, 2016

Okay, this one is more tricky. I made a FillTextureFile which does what FillTexture used to do. Now FillTexture is taking a ByteString.

I can not judge well if the ByteString apporach is a good one. I can also imagine its great to have FillTexture take a DynamicImage or even a GLuint (pointing to the texture in GL'istan).

Currently it compiles the example, for what that's worth. :)

This changes the API, so a version bump of -gl and -core is probably/officially needed.

@schell
Copy link
Owner

schell commented Feb 26, 2016

Thanks for the additions. I like the extra options. One question though - doesn't embedding fonts and images in the binary increase the size of the memory footprint? Like - won't it eat up more RAM? It's good as an option one way or another I just want to make sure I understand the consequences.

Now that I'm working on my demo game I'm thinking of making UV mapping more explicit. It means diverging from the original paper I set out to implement but I think it will be more useful.

gelatin isn't on hackage yet so I'm okay breaking the API. It's only you and me using it.

schell added a commit that referenced this pull request Feb 26, 2016
Accept fill texture embed (ByteString)
@schell schell merged commit 9084a4b into schell:master Feb 26, 2016
@schell
Copy link
Owner

schell commented Feb 26, 2016

I take that back - I guess I have pushed a very old version of gelatin to hackage, before I separated the repos.

@cies
Copy link
Author

cies commented Feb 26, 2016

It's through Hackage that I found gelatin. As a rev dep of the gl package.

Btw why did you pick gl over OpenGL?
On Feb 26, 2016 02:47, "Schell Carl Scivally" notifications@github.com
wrote:

I take that back - I guess I have pushed a very old version of gelatin to
hackage, before I separated the repos.


Reply to this email directly or view it on GitHub
#8 (comment).

@cies
Copy link
Author

cies commented Feb 26, 2016

I tried to test if the embeds are loaded into memory, but I did not find meaningful results (Linux memory measuring is not as straightfwd as it might seem). I tried testing it with a big jpg so see if a memory size increase as obvious: well it wasn't.

I opened an issue over at the file-embed repo asking for a bit of help on this one.

@cies cies deleted the fill-text-from-embed branch February 26, 2016 09:29
@schell
Copy link
Owner

schell commented Feb 26, 2016

The OpenGL package has a very light layer over the raw bindings that provide a "Haskell way of doing things" including StateVar and some other features. That made it harder to follow any OpenGL tutorials (like the NeHe articles) because you constantly have to map idiomatic OpenGL to Haskell OpenGL - and then debug, which was difficult. This was the sentiment behind gl in general. The #haskell-game group needed a 1 to 1 mapping of OpenGL so we could follow along with existing OpenGL resources. So I switched as soon as it came out. It made writing the gelatin renderer much, much easier.

Thanks for digging into the file-embed situation!

@cies
Copy link
Author

cies commented Feb 28, 2016

To my best understanding file-embeds are in mem. So better not embed them in real life apps.

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.

None yet

2 participants