Skip to content

Textures

Vlod edited this page Nov 23, 2023 · 16 revisions

The Texture class

  • id: the OpenglId.
  • GetSize: returns the size (note, it asks OpenGL for the size so it is not extremely fast. Don't avoid it but certainly don't call it 10000 times if possible.
  • createFromBuffer: creates the texture from a buffer of pixels.
  • createFromFileData: creates the texture from a file data (you can load a .jpg file for example and pass the data to this method)
  • loadFromFile: loads a texture from a file from you.
  • create1PxSquare: creates a 1by1 white texture. You can specify the color if you want.

Note that the pixelated parameter basically means Nearest Neighbour filtering or Linear filtering.

Note that you have to call cleanup to clear the gpu data!

Clone this wiki locally