When i draw a image on the right side of a screen and the image goint over the edge. I grab the image already on the screen and reposition in e.g. 3 pixils to the left. And then i draw the image also on the new position. What i am doing here is creating a sliding image on the screen. I repeat this. In debug mode everythhing works fine. But is full screen mode i have to shift the image 6 pixels. Otherwise the images overlapping echother in a shifted order. Is this a bug in the debugging or a fullscreen bug.
debug error
Blitz3D Forums/Blitz3D Bug Reports/debug error Can you post the code?
i hope its works to get it on the file. I see every time a beautiful BB screen but i cant create it. But here is the code.
In debug mode its run fine
in Full screen mode its going wrong.
----- program start here -------
;Run this in menu Program - Debug enabled on
; And the stip animation works
; Set Program - Debug enables off
; and the strip animation goes wrong
; Set graphics
Graphics 640,480,16
; Some image data
Global Image1
Global Image2
Global Shift1
Global Shift2
Global Count = 3
;set work screen
SetBuffer BackBuffer()
; create the figure for animation
Color 255,0,0
Rect 0,0,64,55,False
Rect 1,1,62,53,False
; call the funtion to execute the animanion
main
Function main ()
;Create the image size
Shift1 = CreateImage (640,55)
Shift2 = CreateImage (640,55)
Image1 = CreateImage (64,55)
Image2 = CreateImage (64,55)
;get the drawing for movement
GrabImage Image1,0,0
GrabImage Image2,0,0
; clear everything
Cls
; Set platime to 20 seconds
Timeteller = MilliSecs() +20000
Repeat
; Grab the long strips for animation
GrabImage Shift1,3,20
GrabImage Shift2,3,400
Cls
; Replace them on new location
DrawImage Shift1,0,20
DrawImage Shift2,0,400
; Draw the squars
DrawImage Image1,640 - Count,20
DrawImage Image2,640 - Count,400
; Recalculate the position of the squars
Count = Count +3
If Count > 65
; if squars is full on screen reset position
Count =3
EndIf
; Make it true othewise the screen flickers
Flip True
;repeat this untile 20 seconds are past
Until TimeTeller < MilliSecs()
End Function
--- Program ends here -----
In debug mode its run fine
in Full screen mode its going wrong.
----- program start here -------
;Run this in menu Program - Debug enabled on
; And the stip animation works
; Set Program - Debug enables off
; and the strip animation goes wrong
; Set graphics
Graphics 640,480,16
; Some image data
Global Image1
Global Image2
Global Shift1
Global Shift2
Global Count = 3
;set work screen
SetBuffer BackBuffer()
; create the figure for animation
Color 255,0,0
Rect 0,0,64,55,False
Rect 1,1,62,53,False
; call the funtion to execute the animanion
main
Function main ()
;Create the image size
Shift1 = CreateImage (640,55)
Shift2 = CreateImage (640,55)
Image1 = CreateImage (64,55)
Image2 = CreateImage (64,55)
;get the drawing for movement
GrabImage Image1,0,0
GrabImage Image2,0,0
; clear everything
Cls
; Set platime to 20 seconds
Timeteller = MilliSecs() +20000
Repeat
; Grab the long strips for animation
GrabImage Shift1,3,20
GrabImage Shift2,3,400
Cls
; Replace them on new location
DrawImage Shift1,0,20
DrawImage Shift2,0,400
; Draw the squars
DrawImage Image1,640 - Count,20
DrawImage Image2,640 - Count,400
; Recalculate the position of the squars
Count = Count +3
If Count > 65
; if squars is full on screen reset position
Count =3
EndIf
; Make it true othewise the screen flickers
Flip True
;repeat this untile 20 seconds are past
Until TimeTeller < MilliSecs()
End Function
--- Program ends here -----
A yes i forgot this info
my system is a laptop
Windows XP
version 2002
SP2
Intel (R) 82852/82855 graphics card
512 MB work memory.
80 GB HD Free 27 GB on HD
CPU centreno 1.76 Ghz
And latetst version of BB version 1.98 of all three parts.
my system is a laptop
Windows XP
version 2002
SP2
Intel (R) 82852/82855 graphics card
512 MB work memory.
80 GB HD Free 27 GB on HD
CPU centreno 1.76 Ghz
And latetst version of BB version 1.98 of all three parts.
In the main loop you repeatedly do:
Draw to back buffer
Flip
Grab from back buffer
This has unpredictable results. You can't be sure what the back buffer holds after a flip.
So your main loop should do:
Draw to back buffer
Grab from back buffer
Flip
Here's an example.
Draw to back buffer
Flip
Grab from back buffer
This has unpredictable results. You can't be sure what the back buffer holds after a flip.
So your main loop should do:
Draw to back buffer
Grab from back buffer
Flip
Here's an example.
Graphics 640, 480 SetBuffer BackBuffer() Shift = CreateImage (640,55) Image = CreateImage (64,55) Rect 0,0,64,55,False Rect 1,1,62,53,False GrabImage Image,0,0 Repeat Cls DrawImage Shift,0,20 DrawImage Image,640 - Count,20 GrabImage Shift,3,20 Flip True Count = Count + 3 If Count > 65 Then Count = 3 Until KeyDown(1)
Thanks for the info. I see what i am doing wrong now. Your completly right. When i follow my program its indeed that behave you say. The back screen is stil in previous step while iam grabbing it. And than i shift everyting while the motion is stil the previous one.
BTW how do you get the source code so beautiful on the screen.
BTW how do you get the source code so beautiful on the screen.
What are the forum codes?
I used the ordinary code tag. For longer code you can use a codebox, which has scroll bars.
I used the ordinary code tag. For longer code you can use a codebox, which has scroll bars.
Thanks btw your idea works perfect. I have change the code and now its going on the right way.