LoadImage and problem with video memory

Blitz3D Forums/Blitz3D Beginners Area/LoadImage and problem with video memory

here a code of the diplay initialization

; Get a HND
options\blitz_hnd = api_FindWindow("Blitz Runtime Class", "The Game v" + version)
; Get a HDC
hdc% = api_GetDC(options\blitz_hnd)
; GET a Desktop BPP
options\desk_bpp = api_GetDeviceCaps(hdc, 12)

If Windowed3D()
 options\Gfx_Mode3D = "GfxMode3DExists( 800, 600, "+options\desk_bpp+") is 3D-capable"
 Graphics3D 800, 600,0, 3
Else
 options\Gfx_Mode3D =  "GfxMode3DExists( 800, 600, "+options\desk_bpp+") is NOT 3D-capable"
 ; If this 16 bit then Show Error Message
 If options\desk_bpp = 16
  RuntimeError(options\Gfx_Mode3D)
  End
 EndIf
 ; 24 or 32 bit, Change Screen BPP to 16 bit
 If options\desk_bpp <> 16
  api_SetDisplay(api_GetSystemMetrics(SM_CXSCREEN), api_GetSystemMetrics(SM_CYSCREEN), 16)
 EndIf
 ; 16 bit
 If Windowed3D()
  options\Gfx_Mode3D = "GfxMode3DExists( 800, 600,16) is  3D-capable"
  Graphics3D 800, 600,0, 3
 Else
  options\Gfx_Mode3D = "GfxMode3DExists( 800, 600,16) is NOT 3D-capable"
  RuntimeError(options\Gfx_Mode3D)
  End
 EndIf
EndIf