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

Feature pixbuf #46

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

Feature pixbuf #46

wants to merge 2 commits into from

Conversation

Aloz1
Copy link
Contributor

@Aloz1 Aloz1 commented Aug 4, 2016

This pull request is in reference to issue #36

Aloz1 added 2 commits August 4, 2016 12:42
Pixbuf has been added as a new data type. This massively increases the
speed of drawing individual pixels.
This commit fixes some logic and code errors caused by the rebase from
v4_backend to devel
@Aloz1
Copy link
Contributor Author

Aloz1 commented Aug 4, 2016

Just a note, the pascal interface for this hasn't been written yet. For some strange reason, I keep getting fatal internal errors when trying to build swingame.

@macite
Copy link
Owner

macite commented Aug 7, 2016

We are in the process of re-writing this as SplashKit at the moment -- did you want to try incorporating your code into that repo? https://github.com/splashkit/splashkit

@Aloz1
Copy link
Contributor Author

Aloz1 commented Aug 7, 2016

Ok, thanks. I'll have a go at it. In the mean time, have you had a look at the other pull request? Because it's all low level modifications to an already existing data type, there is no need to modify the Pascal side of things.

@macite
Copy link
Owner

macite commented Aug 8, 2016

I had a quick look, but hadn't realised the key difference :)

Which approach would you recommend? At the moment the front end in SplashKit could go either way. I'm happy to take suggestions and move forward with just one of these.

@Aloz1
Copy link
Contributor Author

Aloz1 commented Aug 9, 2016

I personally believe that modified bitmaps would be better moving forward.

TL;DR They'd result in much less code duplication in the long term and simplify the decision of what type to use for students...because there's only one choice. And are also slightly faster than pixbufs at present.

The biggest difference between the two methods is that bitmaps are able to cache any changes in gpu using textures. That could be added to the pixbuf method as well, but it would end up being almost identical to a bitmap, just with more restrictive purposes (can't draw shapes to it) and lots of duplicate code.

The bitmap method already has texture caching, so when the contents of a bitmap is rarely changed due to pixel drawing. It will be much faster drawing bitmaps to screens or other bitmaps than with pixbufs.

This could be done for pixbufs as well, but it is not a trivial addition, and there will be lots of duplicated code between bitmaps and pixbufs.

On top of that, one less data type is much more convenient to students, who won't have to decide when to use a regular bitmap vs a pixbuf.

@macite
Copy link
Owner

macite commented Aug 9, 2016

Ok, lets go with that version then. Conversion to SplashKit should be ok, as it is mostly the same in the backend -- but it will need a little bit of work.

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.

2 participants