bbInput bug (purebasic)

Blitz3D SDK Forums/Blitz3D SDK Bug Reports/bbInput bug (purebasic)

The first one I call is written to screen, but it just continues without output.

I have to do this:

If bbGfxDriverCaps3D()>=110
Global out$ = PeekS(bbInput("")); First call fails? Is this a bug?
bbLocate(0,0) ; Oh well, place it on top of failed one :)
	If Left(LCase(PeekS(bbInput("Select (c)ubic or (s)pherical mapping :"))),1)="c" 
	  cube_ref=#True
	EndIf
EndIf


And yes. I'm porting the examples to purebasic for my own entertainment :)

Heres the entire code for the Teapot example:


Global info1$="Teapot demo"
Global info2$="Features Cubic/spheriocal reflection mapping"
Global info3$="Arrows keys to pan camera"

IncludeFile "../start.pb"

cube_ref=#False

If bbGfxDriverCaps3D()>=110
Global out$ = PeekS(bbInput("")); First call fails? Is this a bug?
bbLocate(0,0) ; Oh well, place it on top of failed one :)
	If Left(LCase(PeekS(bbInput("Select (c)ubic or (s)pherical mapping :"))),1)="c" 
	  cube_ref=#True
	EndIf
EndIf

teapot=bbLoadMesh( "teapot.x" )
If cube_ref
	tex=bbLoadTexture( "castle_env.bmp",128+8 )
Else
	tex=bbLoadTexture( "spheremap.bmp",64+1 )
EndIf
bbEntityTexture(teapot,tex,0,0)
bbEntityFX(teapot,1)

cam_pivot=bbCreatePivot(); teapot )
camera=bbCreateCamera( cam_pivot )
bbPositionEntity(camera,0,0,-3)

While Not bbKeyHit(1)

	If bbKeyDown(200) 
	  bbTurnEntity(cam_pivot,3,0,0)
	EndIf
	If bbKeyDown(208) 
	  bbTurnEntity(cam_pivot,-3,0,0)
	EndIf
	If bbKeyDown(203)
	  bbTurnEntity(cam_pivot,0,3,0)
	EndIf
	If bbKeyDown(205) 
	  bbTurnEntity(cam_pivot,0,-3,0)
	EndIf
	
	bbTurnEntity(teapot,0.1,0.3,0)
	
	bbUpdateWorld()
	bbRenderWorld()
	bbFlip()
Wend
End
; IDE Options = PureBasic 4.10 Beta 3 (Windows - x86)
; CursorPosition = 11
; Folding = -


And the ported start file for testing (Needs to be one directory below as the original)

IncludeFile "../blitz3dsdk.pbi"

Declare SetGfx()

SetGfx()

Procedure SetGfx()

  ; Initialise Blitz3D engine...
  bbBeginBlitz3D ()
  
  ; Set debug mode (it's on by default -- just added this so you can turn it off)...
  bbSetBlitz3DDebugMode(0) ; 1 = DEBUG ON, 0 = DEBUG OFF



	If info1$<>""
		bbSetBlitz3DTitle( info1$, "Exit "+info1$+"?")
	EndIf
	
	bbFlushKeys()
	
	mode_cnt=bbCountGfxModes3D()
	If Not mode_cnt 
	  bbRuntimeError("Can't find any 3D graphics modes")
	EndIf
	
	mode=0	
	If Not bbWindowed3D()
	 mode=1	
	EndIf
	
	bbGraphics(640,480,16,2)
	bbSetBuffer(bbBackBuffer())
	
	image=bbLoadImage( "b3dlogo.jpg" )
	If Not image 
	  image=bbLoadImage( "../b3dlogo.jpg" )
	EndIf
	bbMidHandle(image)
	
	font=bbLoadFont( "verdana",16,0,0,0 )
	bbSetFont(font)
	
	tx=640+160
	nx=-160
	ty=280
	
	url$="www.blitzbasic.com"
	url_x=640-bbStringWidth( url$ )
	url_y=480-bbFontHeight()

	Repeat
		bbCls()
		
		bbDrawBlock(image,320,144,0)
					
		bbColor(0,255,0)
		bbText(tx,ty+bbFontHeight()*0,info1$,#True)
		bbText(nx,ty+bbFontHeight()*1,info2$,#True)
		bbText(tx,ty+bbFontHeight()*2,info3$,#True)
		;bbText(nx,ty+bbFontHeight()*3,info4$,#True)
	
		bbColor(255,255,255)
		If mode=0
			bbText(tx,ty+bbFontHeight()*5,"Windowed",#True)
		Else
			bbText(tx,ty+bbFontHeight()*5,Str(bbGfxModeWidth( mode ))+","+Str(bbGfxModeHeight( mode ))+","+Str(bbGfxModeDepth( mode )),#True)
		EndIf
		
		bbColor(255,0,0)
		bbText(nx,ty+bbFontHeight()*7,"[Return] to begin",#True)
		bbText(tx,ty+bbFontHeight()*8,"[Arrows] change mode",#True)
		bbText(nx,ty+bbFontHeight()*9,"[Escape] to exit",#True)
		
		bbColor(0,0,255)
		bbText(url_x,url_y,url$)
		
		If bbKeyHit( 1 ) 
		End
		EndIf
		If bbKeyHit( 28 )
			bbCls():bbFlip()
			bbCls():bbFlip()
			bbFreeFont(font)
			bbFreeImage(image)
			bbEndGraphics()
			If mode
				bbGraphics3D(bbGfxModeWidth(mode),bbGfxModeHeight(mode),bbGfxModeDepth(mode),1)
			Else
				bbGraphics3D(640,480,0,2)
			EndIf
			bbSetBuffer(bbBackBuffer())
			ProcedureReturn
		EndIf
		If bbKeyHit( 203 )
			mode=mode-1
			If mode<0 Or (mode=0 And (Not bbWindowed3D()))
				mode=mode_cnt
			EndIf
		ElseIf bbKeyHit( 205 )
			mode=mode+1
			If mode>mode_cnt
				mode=0
				If Not bbWindowed3D() 
				mode=1
				EndIf
			EndIf
		EndIf
		
		If tx>320 
		tx=tx-8
		EndIf
		If nx<320 
		nx=nx+8
		EndIf
		
		bbFlip()
		
	ForEver
	
EndProcedure
; IDE Options = PureBasic 4.10 Beta 3 (Windows - x86)
; CursorPosition = 93
; FirstLine = 62
; Folding = -