Is this:
a correct way to manage memory?
EDIT: a .pk3 file is a renamed zip, just in case anyone was wondering
Framework BRL.D3D7Max2D Import BRL.BMPLoader Import pub.zipengine 'SetGraphicsDriver D3D7Max2DDriver() Local zrObject:ZipReader = New ZipReader Local ramstream:TRamStream = Null Global myram:Byte Ptr Global myImage:TImage If ( zrObject.OpenZip("data.pk3") ) Then ramstream = zrObject.ExtractFile("gfx/hail.bmp") myram = MemAlloc(ramstream._size) myImage = LoadImage(ramstream) zrObject.CloseZip() CloseStream(ramstream) ramstream = Null MemFree myram End If Graphics 800,600,0 While Not KeyDown(KEY_ESCAPE) DrawImage myImage, MouseX(), MouseY() Flip Cls Wend End
a correct way to manage memory?
EDIT: a .pk3 file is a renamed zip, just in case anyone was wondering