Page 1 of 1

Why this code crash? (startdrawing())

Posted: Sat Apr 26, 2003 11:35 pm
by GPI
After the debug-message "START" it crash.

Code: Select all

ok=1

;erstmal den zu scrollenden Hintergrund laden
UseJPEGImageDecoder()
If LoadImage(0,"fire.jpg")
  If InitSprite()
    If InitSprite3D()
      If OpenWindow(0,0,400,320,240,0,"Hallo")
        If OpenWindowedScreen(WindowID(), 0,0, 320,240, 0, 0,0)
          ok=0
        EndIf
      EndIf
    EndIf
  EndIf
EndIf

If ok
  MessageRequester("test","Irgendwas ist schief gelaufen",0)
  End
EndIf

Debug "create"
CreateSprite(1,256,256,#PB_Sprite_Memory )
Debug "resize"
ResizeImage(0,256,256)

For i=0 To 256

  WindowEvent()
  Debug "start"
  StartDrawing(ScreenOutput())
  Debug "draw"
  DrawImage(0,0,0)
  Debug "stop"
  StopDrawing()

  Debug "flip"  
  FlipBuffers()
Next

Posted: Sun Apr 27, 2003 1:12 am
by Pupil
There's an error in your code... Change the line 'DrawImage(0,0,0)' to 'DrawImage(UseImage(0),0,0)' instead.

Posted: Sun Apr 27, 2003 10:20 am
by GPI
Pupil wrote:There's an error in your code... Change the line 'DrawImage(0,0,0)' to 'DrawImage(UseImage(0),0,0)' instead.
Yes i know, but the error happend before this line.

And you must turn the Debugger on.

Posted: Sun Apr 27, 2003 10:32 am
by Danilo
No problems on Windows 2000.