Update SGP and samples to use new SGL views API #55
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.
Following #52 and #50, this PR updates sokol_gp to the latest sokol headers and migrates image usage to the new views API with minimal changes.
What's changed:
master(floooh/sokol@8c06b5e) .sgp_make_texture_view_from_image()to create a simple 2D texture view from an image._sg_lookup_imagepath is left in comments for reference.Breaking changes:
sg_imagenow expectsg_view.sg_view v = sgp_make_texture_view_from_image(img, label);andvcan be passed to the new API.Rationale:
Aligns sokol_gp with the new views API, without taking on managing the views internally.
Testing:
Documentation:
Not updated in this PR. Migration is straightforward (replace images with views), and the new helper can be recommend for most existing workflows
Migration example:
Before:
sg_image img = ...;sgp_set_image(ch, image);After:
sg_image img = ...;sg_view view = sgp_make_texture_view_from_image(img, "label");sgp_set_view(ch, view);