bbSetBlitz3DDebugCallback

Blitz3D SDK Forums/Blitz3D SDK Programming/bbSetBlitz3DDebugCallback

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Solved! Thanks Simon

Need to terminate the application at the debug callback, not continue it with a return.

Ok, go to following post!




[Working EBasic code below]
$include "blitz3dsdk.inc"
DECLARE CDECL mydebugfunction(string errormessage)

bbSetBlitz3DDebugCallback(&mydebugfunction)
bbBeginBlitz3D()

	bbGraphics( 640,480,16,2)
	bbSetBuffer( bbBackBuffer())

	' trying to load a non-existing image to kickoff bbSetBlitz3DDebugCallback 
	image=bbLoadImage( "b3dlogo3.jpg" )
	If image=0 then image=bbLoadImage( "../b3dlogo3.jpg" )

	bbMidHandle( image)

	def run:int
	run=1
	do
		bbCls()		
		bbDrawBlock(image,320,144,0)

		bbText( 320,280,"[Escape] to exit",True,0)

		If bbKeyHit( 1 ) then run=0

		bbFlip(1)

	until run=0

bbEndBlitz3D()
end

sub mydebugfunction(string errormessage)
	MESSAGEBOX(NULL,errormessage,"Blitz3D SDK Error",@MB_ICONEXCLAMATION | @MB_OK)
	end
endsub