1. RE: Need Win Guru/Tester
- Posted by Patrick.Barnes at transgrid.com.au Jan 13, 2003
- 456 views
I don't know your exact code, but I'd rearrange the loop so that SDL_PumpEvents() is at the very end of the loop. Simpler example below, for reading input in from a file: --Instead of this: atom fn object line sequence text text = {} fn = open("myfile", "r") line = {} while sequence(line) do line = gets(fn) if sequence(line) then text &= line end if end while close(fn) --end-- --Try and write it like this: atom fn object line sequence text text = {} fn = open("myfile", "r") line = gets(fn) while sequence(line) do text &= line line = gets(fn) end while close(fn) --end-- HTH, ============================================== _______<-------------------\__ / _____<--------------------__|=== | |_ <-------------------/ \__| Patrick Barnes -----Original Message----- From: C. K. Lester [mailto:cklester at yahoo.com] Sent: Tuesday, 14 January 2003 09:51 To: EUforum Subject: Re: Need Win Guru/Tester Pete! Thanks so much! After I sent that last post, I realized that my loop should probably be more controlled... that I really didn't have a hook into it (like you did with the done variable). However, didn't know where to go with it so I'm glad you responded. How would you resolve this, however: the loop uses done, but then it exits if done is true inside the actual looping code. What I'm thinking is that it can be optimized or done differently so there aren't two tests for done in the same loop code. while done=0 do -- here's done SDL_PumpEvents() if done then exit end if -- here's done Again, much appreciated! -ck ----- Original Message ----- From: "Pete Lomax" <petelomax at blueyonder.co.uk> To: "EUforum" <EUforum at topica.com> Sent: Monday, January 13, 2003 1:03 PM Subject: Re: Need Win Guru/Tester On Mon, 13 Jan 2003 12:10:41 -0600, "C. K. Lester" <cklester at yahoo.com> wrote: > >Windows gurus... Please go here and test the available code: > >http://www.cklester.com/euphoric/win32lib_sdl_test.htm > >The program simply attempts to open an SDL resizable window from within a >IDE-generated win32lib program. When I click <Close> the program crashes >with some memory error. RobC, could you please check this as well?! > change: setHandler( bttn_Close, w32HClick, routine_id("PushButton2_onClick")) to: setHandler( bttn_Close, w32HClick, routine_id("bttn_Close_onClick")) at the end of sdl_done() I added: done=1 and also put an extra exit line in the main loop as follows: while done=0 do SDL_PumpEvents() if done then exit end if --<< here Pete ==^^=============================================================== This email was sent to: cklester at yahoo.com TOPICA - Start your own email discussion group. FREE! TOPICA - Start your own email discussion group. FREE! *********************************************************************** ***********************************************************************
2. RE: Need Win Guru/Tester
- Posted by "C. K. Lester" <cklester at yahoo.com> Jan 14, 2003
- 469 views
I actually was trying to test having a Win32Lib window controlling an SDL window, and it works beautifully. The SDL code I have is the sample provided in the package. I'll be coding my own stuff anyway... :) Thanks, Patrick! -ck > -----Original Message----- > From: Patrick.Barnes at transgrid.com.au > [mailto:Patrick.Barnes at transgrid.com.au] > Subject: RE: Need Win Guru/Tester > > > > I don't know your exact code, but I'd rearrange the loop so that > SDL_PumpEvents() is at the very end of the loop. > > Simpler example below, for reading input in from a file: > > --Instead of this: > atom fn > object line > sequence text > text = {} > fn = open("myfile", "r") > line = {} > while sequence(line) do > line = gets(fn) > if sequence(line) then > text &= line > end if > end while > close(fn) > --end-- > > --Try and write it like this: > atom fn > object line > sequence text > text = {} > fn = open("myfile", "r") > line = gets(fn) > while sequence(line) do > text &= line > line = gets(fn) > end while > close(fn) > --end-- > > > HTH, > > ============================================== > _______<-------------------\__ > / _____<--------------------__|=== > | |_ <-------------------/ > \__| Patrick Barnes > > > -----Original Message----- > From: C. K. Lester [mailto:cklester at yahoo.com] > Sent: Tuesday, 14 January 2003 09:51 > To: EUforum > Subject: Re: Need Win Guru/Tester > > > Pete! Thanks so much! > > After I sent that last post, I realized that my loop should > probably be more > controlled... that I really didn't have a hook into it (like you did with > the done variable). However, didn't know where to go with it so > I'm glad you > responded. > > How would you resolve this, however: the loop uses done, but then it exits > if done is true inside the actual looping code. What I'm thinking > is that it > can be optimized or done differently so there aren't two tests for done in > the same loop code. > > while done=0 do -- here's done > SDL_PumpEvents() > if done then exit end if -- here's done > > > Again, much appreciated! > > -ck > > ----- Original Message ----- > From: "Pete Lomax" <petelomax at blueyonder.co.uk> > To: "EUforum" <EUforum at topica.com> > Sent: Monday, January 13, 2003 1:03 PM > Subject: Re: Need Win Guru/Tester > > > On Mon, 13 Jan 2003 12:10:41 -0600, "C. K. Lester" > <cklester at yahoo.com> wrote: > > > > >Windows gurus... Please go here and test the available code: > > > >http://www.cklester.com/euphoric/win32lib_sdl_test.htm <snip> > >