mousePong

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Tomio.

Hello,

since recently I have a strange behavior (I call it "mousePong") with programs on WinXP, e.g. the one below.

The program is for demonstration only. It does nothing than waiting for Key_Escape.
BUT: WHENEVER you press a mousebutton, a sound occurs.
It's the same "pong" you hear with a MessageRequester command.
This mousePong does NOT happen, if I remove the FlipBuffers() line!

Unfortunately my oldest unmodified exe is 10 days old only. With this program there is no mousePong!

But EVERY program (complex or simple) I compile new (or choose from Programme/Purebasic/Examples/Sources) with the FlipBuffers command has this sound.
The demo program was compiled with my first PB version, PB2.90. The same mousePong!

From that I conclude that it's not PB, but some modification/installation of WinXP being responsible for.
But I can't remember any installation in the last days.

Perhaps one of you has an idea what could be the reason. If not, I'll have to live with mousePongs in PB's exe for the life of this computer.

;demo mousePong
If InitKeyboard() = 0
MessageRequester("Error", "Can't initialize Keyboard", 0)
End
EndIf
If InitSprite() = 0
MessageRequester("Error", "Can't initialize Sprite", 0)
End
EndIf
If OpenScreen(800, 600, 16, "Mouse") = 0
MessageRequester("Error", "screen",0)
End
EndIf
;
Repeat
FlipBuffers() ;no mousePong if removed!
ExamineKeyboard()
Until KeyboardPushed(#PB_Key_Escape)

../tomio
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by tranquil.

I know there was a problem in the past with this command. Danilo reported it to fred in the PB IRC Chat and Fred removed this "Pong".

Are you using the actual version of PB?

Mike

Tranquilizer/ Secretly!
http://www.secretly.de
Registred PureBasic User
System: Windows 2000 Server, 512 MB Ram, GeForce4200 TI 128 MB DDR, Hercules Theater 6.1 DTS Sound
System 2: Mobile Pentium 4 2.4GHz 512 MB DDR GeForce4 420-32, Windows XP Home
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Tomio.

Mike,

> Danilo reported it to fred in the PB IRC Chat
How can I find it?

> Are you using the actual version of PB?
I've tried it with PB 2.90, 3.50, 3.61

../tomio

tomio
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Tomcat.

Hi Tomio,

I don't know exactly why, but if you add InitMouse() and examine the mousestatus within the loop, this mousePong is gone:

Code: Select all

;demo with no mousePongIf InitKeyboard() = 0
MessageRequester("Error", "Can't initialize Keyboard", 0)
End
EndIf
If InitMouse() = 0
MessageRequester("Error", "Can't initialize Mouse", 0)
End
EndIf
If InitSprite() = 0 
MessageRequester("Error", "Can't initialize Sprite", 0)
End
EndIf
If OpenScreen(800, 600, 16, "Mouse") = 0
MessageRequester("Error", "screen",0)
End
EndIf
;
Repeat
FlipBuffers()
ExamineKeyboard():ExamineMouse()
Until KeyboardPushed(#PB_Key_Escape)
Bye,
Tomek
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Tomio.

Hello Tomek,

you are right (partly).
With PB2.90 + PB3.50 the mousePong is gone in the little testprogram. Very funny.

My big program cannot be compiled with 2.90.
But with 3.50 the mousePong still is there.
But I've some hope that playing around with the ExamineMouse() location may kill the mousePong.

But at the moment I can't test, because I've upgraded to PB 3.62 and now I've another more serious problem with FakeEndSelect (see my next topic).

Anyway, thank you for the interesting tip!
../tomio
Post Reply