Help Center
Help CenterFreeBASICTutorials

DevIL

Documentation

A full featured cross-platform image library.

Website: http://openil.sourceforge.net/
Platforms supported: Win32, Linux
Headers to include: IL/il.bi, IL/ilu.bi, IL/ilut.bi
Header version: 1.7.8
Examples: in examples/files/DevIL/

Example

'' DevIL example



#include Once "IL/il.bi"



'' Version check

If (ilGetInteger(IL_VERSION_NUM) < IL_VERSION) Then

    Print "DevIL version is different"

    End 1

End If



'' Good practice to explicitely initialize it

ilInit()



'' Load a bitmap

Dim As ILuint fblogo

ilGenImages(1, @fblogo)

ilBindImage(fblogo)



Print "Loading fblogo.bmp..."

ilLoadImage("fblogo.bmp")



'' Save a copy

Print "Saving a copy, fblogo-copy.bmp..."

ilEnable(IL_FILE_OVERWRITE)

ilSaveImage("fblogo-copy.bmp")



'' Clean up

ilDeleteImages(1, @fblogo)