"Fossies" - the Fresh Open Source Software Archive

Member "FreeBASIC-1.05.0-linux-x86_64/examples/files/DevIL/copy.bas" (31 Jan 2016, 589 Bytes) of package /linux/privat/FreeBASIC-1.05.0-linux-x86_64.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Visual Basic source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 '' DevIL example
    2 
    3 #include once "IL/il.bi"
    4 
    5 '' Version check
    6 If (ilGetInteger(IL_VERSION_NUM) < IL_VERSION) Then
    7     Print "DevIL version is different" : Sleep : End 1
    8 End If
    9 
   10 '' Good practice to explicitely initialize it
   11 ilInit()
   12 
   13 dim as string filename = exepath() & "/../../fblogo.bmp"
   14 
   15 '' Load a bitmap
   16 Print "Loading '" & filename & "'..."
   17 Dim As ILuint fblogo
   18 ilGenImages(1, @fblogo)
   19 ilBindImage(fblogo)
   20 ilLoadImage(filename)
   21 
   22 '' Save a copy
   23 Print "Saving a copy, fblogo-copy.bmp..."
   24 ilEnable(IL_FILE_OVERWRITE)
   25 ilSaveImage("fblogo-copy.bmp")
   26 
   27 '' Clean up
   28 ilDeleteImages(1, @fblogo)