-
Notifications
You must be signed in to change notification settings - Fork 30
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
Fix #83 issues #86
Merged
Merged
Fix #83 issues #86
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
714e33d
Cache Font & Texture data in renderers to reduce lookups; Fix bug in …
topblast f920ad2
Update SFML2 Renderer
topblast ee87bd1
Code formatting
topblast b833659
Xcode version specific for thread_local
topblast 6a017cd
Fixed __apple_build_version__ bug
topblast b225ed4
Revert SWTextureData::At(int, int) functions
topblast File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why store the last font here? Why not store an opaque handle in
Font
, like it was? If the font keeps changing you have to constantly look it up. The only cache you need is to look up the font by family/size, etc, i.e. style.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason for avoiding the user data in Font/Texture primarily is to remove data specific to a renderer having the potential to be shared between renderers. One of my use cases for Gwork is an environment where multiple renderers exist. Some of the Gwork objects are shared between these renderers. The user data in Font/Texture does not have a way to determine the renderer that assigned the data or store multiple without recreating every time the renderers change.
I also question the lifespan of user data in Font/Texture.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Multiple renderers?! I'm curious, how so? Multiple instances with the same backend, or multiple backends?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has always been assumed that an application would embed one renderer. I have thought about having fallback renderers if some features aren't available on other renderers, e.g. if more primitives were added to add a canvas (e.g. drawing of charts etc) it call fallback to software renderer if a particular renderer did not have that features. It's tempting to include something like NanoVG to do something like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One example of multiple renderers is in-game overlays. Without knowing which rendering API the game will you, multiple backends are used. However, some game when switching between lobby & battle(for lack of a better word), different rendering APIs are used. Usually different versions of Direct X. And in rare cases, the HUD is rendered in DX 10 and the 3D environment in DX 11.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, this has never been a requirement before. Interesting. I was wondering why the extensive changes and whether is was overkill! I can see your motivation now!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added #87 so this feature can be mentioned as it is significant. Will have to mention/update docs.