A couple o' questions...
Blitz3D Forums/Blitz3D Beginners Area/A couple o' questions...
| ||
Hi all, I have just taken the plunge into BlitzPlus, and find the water to be most agreeable so far. There are a couple of ponderings I have: Firstly, is there any way from within a blitz program to temporarily disable/change windows mouse acceleration? It tends to mess around with the control system for the game I am working on, and although the user can switch it off from the windows control panel, it would be nice to be able to put in this functionality from within the options menu of the game. Can it be done? Secondly, is there a way to read and write data to an external MIDI port? It would be cool to put together a synth patch editor, but it would of course hinge on the ability to do this. Finally, is there a way to embed an icon into a compiled EXE, so it doesn't just appear with the crappy standard default EXE icon? Cheers, STOOP |
| ||
I can't answer the first two, but, I think Mark is aware of the problem with icons. You could try using Resource Hacker, if you can't find an icon resource (or it corrupts the exe) then this still needs fixing. |
| ||
(1) and (2): AFAIK there are no native commands that does that (at least, not yet); anyway, you could build/search for a DLL that does the trick, and use it from within Blitz. (3): What MasterBeaker said. Sergio. |
| ||
1) Yes, I believe you can change the mouse acceleration threshold through a WinAPI call to SystemParametersInfo (SystemParametersInfoA) found in user32.dll (and compatible with all versions of Windows from W95). See the SystemParametersInfo documentation on MSDN, and pay attention to the SPI_SETMOUSE parameter. It would probably be a simple matter to write a declaration and function call to do this, but keep in mind that you're changing a system-wide variable, and if your program didn't set it back to what it was (or crashed), that would likely frustrate the user. 2) You may be able to use Userlibs declarations to interface with the WinAPI WinMM.dll (also available in all versions of Windows), but I have no idea whether that's the best way or not. Try looking up one of the midi functions, like "midiOutMessage" on MSDN. Anyway, if you'd like to try these things, you can also read about the Userlibs specification in the Userlibs and/or BlitzPlus/Blitz3D forums, and the specifications found under Community->Specs and Utils. If you get stuck, post your questions and we can help. |
| ||
OK. Adding an icon resource into a quick little test program using the wonderful ResHack, then clearing the icon cache and restarting windows seems to have been a success. About the acceleratey stuff: yeah, I was thinking about having it as an option then putting it back to whatever state it started with upon exit. And hope that the program isn't very crashy. :D But clearly that and the MIDI stuff are going to require me to learn a bit more and do some messing around. I shall peruse the userlib malarkey further, and maybe do mouse accel in the next version. For now I will get back to optimising/tidying and cramming more UDP clients into this thing. I *WILL* have it running four players, or melt my brain trying! Thanks all for yer help, folks. STOOP |