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

Texture resource #24

Merged
merged 2 commits into from
Aug 2, 2022
Merged

Texture resource #24

merged 2 commits into from
Aug 2, 2022

Conversation

brenocq
Copy link
Owner

@brenocq brenocq commented Aug 2, 2022

Description
Now it is easy to create textures and update texture resources while the simulation is running.

ezgif com-gif-maker (24)
Figure 1: Boids example showing world force field with a texture.

Example

atta::Texture::CreateInfo info {};
info.width = 100;
info.height = 100;
info.format = atta::Texture::Format::RGBA8; 
atta::Texture* tex = atta::ResourceManager::create<atta::Texture>("myTexture.png", info);

tex->resize(200, 200);
uint8_t* data = tex->getData();
// Change data
tex->update();

// If want to save to file
tex->saveToFile();
``

@brenocq brenocq added type:refactor resource Resource Module labels Aug 2, 2022
@brenocq brenocq added this to the 0.0.4.0 - Project milestone Aug 2, 2022
@brenocq brenocq merged commit 7b0aa7f into master Aug 2, 2022
@brenocq brenocq deleted the texture-resource branch August 2, 2022 14:26
brenocq added a commit that referenced this pull request Aug 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resource Resource Module
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant