comparison os2/dw.c @ 527:e0ea29c3d1eb

Fixed dw_window_pointer() so it works on Windows. Tried to fix the timer problems on Windows, but only managed to reduce the problem and eliminate obsolete timer code. Fixed a calling convention problem caused by incorrect placement of the definition of API in the compat.h header. Make dw_beep() not block on OS/2 and Windows.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Tue, 23 Mar 2004 11:00:04 +0000
parents d3ce0afa6cf5
children 82a203664aa9
comparison
equal deleted inserted replaced
526:d3ce0afa6cf5 527:e0ea29c3d1eb
7613 WinReleasePS(hpsdest); 7613 WinReleasePS(hpsdest);
7614 if(!srcp) 7614 if(!srcp)
7615 WinReleasePS(hpssrc); 7615 WinReleasePS(hpssrc);
7616 } 7616 }
7617 7617
7618 /* Run DosBeep() in a separate thread so it doesn't block */
7619 void _beepthread(void *data)
7620 {
7621 int *info = (int *)data;
7622
7623 if(data)
7624 {
7625 DosBeep(info[0], info[1]);
7626 free(data);
7627 }
7628 }
7629
7618 /* 7630 /*
7619 * Emits a beep. 7631 * Emits a beep.
7620 * Parameters: 7632 * Parameters:
7621 * freq: Frequency. 7633 * freq: Frequency.
7622 * dur: Duration. 7634 * dur: Duration.
7623 */ 7635 */
7624 void API dw_beep(int freq, int dur) 7636 void API dw_beep(int freq, int dur)
7625 { 7637 {
7626 DosBeep(freq, dur); 7638 int *info = malloc(sizeof(int) * 2);
7639
7640 if(info)
7641 {
7642 info[0] = freq;
7643 info[1] = dur;
7644
7645 _beginthread(_beepthread, NULL, 100, (void *)info);
7646 }
7627 } 7647 }
7628 7648
7629 /* Open a shared library and return a handle. 7649 /* Open a shared library and return a handle.
7630 * Parameters: 7650 * Parameters:
7631 * name: Base name of the shared library. 7651 * name: Base name of the shared library.