Ponies & Light

ofxTextureServer

ofxTextureServer

A garbage-collected container and (pre)loader of ofTextures

Download

Here’s the source code: http://github.com/tgfrerer/ofxTextureServer

This includes an example project.

Motivation

ofxTextureServer helps you to keep track of ofTextures. It will keep your footprint low if you plan to work with lots of ofTextures.

ofxTextureServer uses a map internally and keeps track of the use count of its textures.

Useful to keep track of all your ofTextures, to preload whole directories of images into ofTextures and access them instantly once your app is running, or to help you automate texture memory management.

I use ofxTextureServer in a couple of projects that require a scene graph. The Pirate Cannon and Project Runway were such projects.

For example, most pirate ships in The Pirate Cannon use the same spritesheet to animate the sails. Each pirate ship object holds a reference to the scene graph’s global ofxTextureServer. Therefore all ships can share the same texture and it is loaded only once.

Example

See included example project.

Reference Render

image

Dependencies

♥ openframeworks >= 007

License

ofxTextureServer is released under the MIT License.

Contact:

Unit 3, 410 Hackney Road,
E2 7AP London, UK