Why this code crash? (startdrawing())

Just starting out? Need help? Post your questions and find answers here.
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Why this code crash? (startdrawing())

Post 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
Pupil
Enthusiast
Enthusiast
Posts: 715
Joined: Fri Apr 25, 2003 3:56 pm

Post by Pupil »

There's an error in your code... Change the line 'DrawImage(0,0,0)' to 'DrawImage(UseImage(0),0,0)' instead.
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Post 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.
User avatar
Danilo
Addict
Addict
Posts: 3037
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Post by Danilo »

No problems on Windows 2000.
cya,
...Danilo
...:-=< http://codedan.net/work >=-:...
-= FaceBook.com/DaniloKrahn =-
Post Reply