Hello and thanks for any help!
THIS PROGRAM works fine inclusive 5.71!
It does not work under 6.00 (it loops without ending) !
Repeat
ExamineMouse()
mausLeftG=MouseButton( #PB_MouseButton_Left)
do_something_like_drawing_on_a_SCREEN()
FlipBuffers()
Delay(10)
Until mausLeftG=0
Any help or changes in PB to make it compatible working in 6.00?
Thanks a lot
Greetings
Rolf
Mouse RAW INPUT since PB 6.0 has different behavior
Re: Mouse RAW INPUT since PB 6.0 has different behavior
Works fine here (tested on Windows 10 with PB 6.0 - x64 ASM & C and x86 C):
Code: Select all
EnableExplicit
Procedure.i Main()
Protected exit.i
Protected mb.i
If InitSprite() And InitKeyboard() And InitMouse()
If OpenWindow(0,0,0,320,200,#Null$,#PB_Window_SystemMenu|#PB_Window_ScreenCentered|#PB_Window_MinimizeGadget)
If OpenWindowedScreen(WindowID(0),0,0,WindowWidth(0),WindowHeight(0))
SetFrameRate(60)
Repeat
Repeat
Select WindowEvent()
Case #PB_Event_CloseWindow
exit = #True
Case #PB_Event_None
Break
EndSelect
ForEver
ExamineKeyboard()
ExamineMouse()
mb = MouseButton(#PB_MouseButton_Left)
ClearScreen($0)
If StartDrawing(ScreenOutput())
Box(MouseX() - 4,MouseY() - 4,8,8,#Red)
StopDrawing()
EndIf
FlipBuffers()
Until exit Or KeyboardReleased(#PB_Key_Escape) Or mb
CloseScreen()
EndIf
CloseWindow(0)
EndIf
EndIf
ProcedureReturn #Null
EndProcedure
Main()
End
Re: Mouse RAW INPUT since PB 6.0 has different behavior
Hi Mijikai!
Thank for your Answer!
Your Program is runng fine at my PC.
Maybe it is a Problem because I ONLY youse a SCREEN not a windowed Screen.
Maybe there is an Update sometimes which enables the old 5.73 MOUSE behavior at SCREEN
Greetings
Rofl
Thank for your Answer!
Your Program is runng fine at my PC.
Maybe it is a Problem because I ONLY youse a SCREEN not a windowed Screen.
Maybe there is an Update sometimes which enables the old 5.73 MOUSE behavior at SCREEN
Greetings
Rofl
Re: Mouse RAW INPUT since PB 6.0 has different behavior
I will wait for a runnable example
Re: Mouse RAW INPUT since PB 6.0 has different behavior
You need an event loop (While WindowEvent() : Wend) .
Re: Mouse RAW INPUT since PB 6.0 has different behavior
Hi Fred! Thanks for your answer and this great basic I am using long long time .
In my program I NEVER used a WINDOWED Screen, so WindowEvent() does not work for me
I use only a SCREEN without a Window...
Greetings Rolf
Re: Mouse RAW INPUT since PB 6.0 has different behavior
I will check then, it should work out of the box !
Re: Mouse RAW INPUT since PB 6.0 has different behavior
I tried to reproduce it, but without success. Can anybody else confirm ?
Code: Select all
If InitSprite() = 0 Or InitKeyboard() = 0
MessageRequester("Error", "Sprite system can't be initialized", 0)
End
EndIf
InitMouse()
If OpenScreen(800, 600, 32, "Sprite")
; Load our 16 bit sprite (which is a 24 bit picture in fact, as BMP doesn't support 16 bit format)
;
LoadSprite(0, #PB_Compiler_Home + "examples/sources/Data/PureBasic.bmp")
CopySprite(0, 1, 0)
Repeat
; Inverse the buffers (the back become the front (visible)... And we can do the rendering on the back)
FlipBuffers()
ClearScreen(RGB(0,0,0))
; Draw our sprite
ClipSprite(0, 0, 0, x, x/8)
DisplaySprite(0, x, 100)
DisplaySprite(1, x, x)
DisplaySprite(0, 600-x, x)
x+1
ExamineMouse()
If MouseButton(#PB_MouseButton_Left)
DisplaySprite(1, MouseX(), MouseY())
EndIf
ExamineKeyboard()
Until KeyboardPushed(#PB_Key_Escape)
Else
MessageRequester("Error", "Can't open a 800*600 - 32 bit screen !", 0)
EndIf
Re: Mouse RAW INPUT since PB 6.0 has different behavior
Hello Fred!
Your example works fine!
My big program (16000 Lines) not under 6.0.
Maybe I have programmed something unclean that works under 5.71 but not under 6.0.
I will have a look insinde my code once more.
If I found a hint I will tell it here!
Thanks for your support so far!
A happy user for all the years!
Rolf
Your example works fine!
My big program (16000 Lines) not under 6.0.
Maybe I have programmed something unclean that works under 5.71 but not under 6.0.
I will have a look insinde my code once more.
If I found a hint I will tell it here!
Thanks for your support so far!
A happy user for all the years!
Rolf
Re: Mouse RAW INPUT since PB 6.0 has different behavior
Hello to all the Helpers! Partely SOLVED for me!
Repeat
ExamineMouse()
mausLeftG=MouseButton( #PB_MouseButton_Left)
;----------------------
FlipBuffers() ; ==> whithout FlipBuffers() here it does not work under PB 6.00. But it works under 5.71
;----------------------
Until mausLeftG=0
Under 5.71 it works without FlipBuffers() in this Loop!
Under 6.00 only with FlipBuffers()
Thanks for all your Help!
Greetings RolfT
(Here is a running but flickering demonstration.
if you remove the FlipBuffers() in the first Loop it freezes under 6.00)
=============================================================
If InitSprite() = 0 Or InitKeyboard() = 0
MessageRequester("Error", "Sprite system can't be initialized", 0)
End
EndIf
InitMouse()
If OpenScreen(800, 600, 32, "Sprite")
; Load our 16 bit sprite (which is a 24 bit picture in fact, as BMP doesn't support 16 bit format)
;
LoadSprite(0, #PB_Compiler_Home + "examples/sources/Data/PureBasic.bmp")
CopySprite(0, 1, 0)
Repeat
x+1
Repeat
ExamineMouse()
mausLeftG=MouseButton( #PB_MouseButton_Left)
;----------------------
FlipBuffers() ; ==> whithout FlipBuffers() here it does not work under PB 6.00. But it works under 5.71
;----------------------
Until mausLeftG=0
Repeat
ExamineMouse()
mausLeftG=MouseButton( #PB_MouseButton_Left)
DisplaySprite(0, x, 100)
DisplaySprite(1, x, x)
DisplaySprite(0, 600-x, x)
If mausLeftG<>0
DisplaySprite(1, MouseX(), MouseY())
Repeat
ExamineMouse()
mausLeftG=MouseButton( #PB_MouseButton_Left)
FlipBuffers()
Delay(10)
Until mausleftG=0
EndIf
FlipBuffers()
Delay(10)
Until mausLeftG=0
ExamineKeyboard()
Until KeyboardPushed(#PB_Key_Escape)
Else
MessageRequester("Error", "Can't open a 800*600 - 32 bit screen !", 0)
EndIf
Repeat
ExamineMouse()
mausLeftG=MouseButton( #PB_MouseButton_Left)
;----------------------
FlipBuffers() ; ==> whithout FlipBuffers() here it does not work under PB 6.00. But it works under 5.71
;----------------------
Until mausLeftG=0
Under 5.71 it works without FlipBuffers() in this Loop!
Under 6.00 only with FlipBuffers()
Thanks for all your Help!
Greetings RolfT
(Here is a running but flickering demonstration.
if you remove the FlipBuffers() in the first Loop it freezes under 6.00)
=============================================================
If InitSprite() = 0 Or InitKeyboard() = 0
MessageRequester("Error", "Sprite system can't be initialized", 0)
End
EndIf
InitMouse()
If OpenScreen(800, 600, 32, "Sprite")
; Load our 16 bit sprite (which is a 24 bit picture in fact, as BMP doesn't support 16 bit format)
;
LoadSprite(0, #PB_Compiler_Home + "examples/sources/Data/PureBasic.bmp")
CopySprite(0, 1, 0)
Repeat
x+1
Repeat
ExamineMouse()
mausLeftG=MouseButton( #PB_MouseButton_Left)
;----------------------
FlipBuffers() ; ==> whithout FlipBuffers() here it does not work under PB 6.00. But it works under 5.71
;----------------------
Until mausLeftG=0
Repeat
ExamineMouse()
mausLeftG=MouseButton( #PB_MouseButton_Left)
DisplaySprite(0, x, 100)
DisplaySprite(1, x, x)
DisplaySprite(0, 600-x, x)
If mausLeftG<>0
DisplaySprite(1, MouseX(), MouseY())
Repeat
ExamineMouse()
mausLeftG=MouseButton( #PB_MouseButton_Left)
FlipBuffers()
Delay(10)
Until mausleftG=0
EndIf
FlipBuffers()
Delay(10)
Until mausLeftG=0
ExamineKeyboard()
Until KeyboardPushed(#PB_Key_Escape)
Else
MessageRequester("Error", "Can't open a 800*600 - 32 bit screen !", 0)
EndIf