Creating an animation texture
In this section, you will implement all the code needed to work with floating-point textures in a AnimTexture
class. Each AnimTexture
object will contain a 32-bit floating point RGBA texture. There will be two copies of this data: one on the CPU and one uploaded to the GPU.
The CPU buffer is kept around to easily modify the contents of the texture in bulk before saving it to disk, or uploading it to OpenGL. It keeps the API simple at the cost of some additional memory.
There is no standard 32-bit texture format, so saving and writing to disk will simply dump the binary contents of the AnimTexture
class to disk. In the next section, you will begin to implement the AnimTexture
class. This class will provide an easy-to-use interface for implementing 32-bit floating-point textures.
Declaring the AnimTexture class
Animation textures are assumed to always be square; the width and height don't need to be tracked separately. It should be enough...