Author Topic: Simple example of types for graphics buffers.  (Read 1829 times)

0 Members and 1 Guest are viewing this topic.

Offline Stonemonkey

  • Pentium
  • *****
  • Posts: 1315
  • Karma: 96
    • View Profile
Simple example of types for graphics buffers.
« on: February 04, 2012 »
For anyone who might find this useful. This is just one use for types and they can be useful in so many other ways so here's what I think is a fairly simple example.

I find working like this is far easier and more flexible than using many global arrays for graphics buffers/textures/mipmaps/fonts/temporary buffers. Being able to have as many buffers of varying sizes for whatever of those uses is required and they can all be read and written to with the same get/set pixel function, write a sub to draw one image into another and it will work for drawing any image into any other image, it makes things that are virtually impossible with global arrays suddenly very easy.

In this example all that's happening is that the type is being used to access the fbgfx screen buffer, it's not much but if you can follow it you're well on your way.
« Last Edit: February 04, 2012 by Stonemonkey »