-
Notifications
You must be signed in to change notification settings - Fork 1
Images and Textures
Fjodor Schelichow edited this page Nov 17, 2017
·
2 revisions
sgltk supports loading images from following file formats: BMP, GIF, JPEG, LBM, PCX, PNG, PNM, TGA, TIFF, WEBP, XCF, XPM, XV.
To load an image from a file you can either use the appropriate constructor or the load function.
sgltk::Image image;
image.load("path/to/image");sgltk::Image::add_path("../Pictures");
image.load("my_picture.png"); //will try to open "./my_picture.png" and if that fails "../Pictures/my_picture.png"To save an image you can simply use the save function.
image.save("path/to/image"); //relative to the current working directory#
sgltk provides different texture subclasses that are all derived from the Texture class.