While working on the next release of AGIL, I have run into a problem in implementing the multi-slot saved games. They work great on Linux and DOS/DJGPP, but Windoze (Mingw32) does not have getwd(). I was going to use this for the default directory for the saved games (Unix uses ~/.agil/<gameid>), DJGPP has getwd().
Any help would be appreciated (substitute for getwd).
Also people the SDL driver's key handling is broken. (event.key.keysym.sym is always zero, and therefore cannot be used) If anyone can help with this it would be greatly appreciated.
Windoze Programming.
Re: Windoze Programming.
have you looked at the sarien SDL driver? we handle key events differently but you should get some idea of a working driver.
-- Stu --
Re: Windoze Programming.
df: I will look at the Sarien SDL driver now. I may also checkout the sound code. The sound in AGIL (OSS only) plays for longer than it should.
Forget about the getwd() thing, I'm just using the gamedir as the default savegame directory. This is given on the command line, or defaults ot "./"
Forget about the getwd() thing, I'm just using the gamedir as the default savegame directory. This is given on the command line, or defaults ot "./"
Re: Windoze Programming.
Just been looking at Sarien SDL driver. Also the checkkeys.c that comes with SDL.
Sarien driver works on same principle as mine, although the design is different.
I can't figure out why event.key.keysym.sym is always zero. It isn't in Sarien, nor checkkeys.c.
Copying code strait from checkkeys.c does not event give the save results.
It also seems that If I don't waste enough time in driver_kb_update() I get sementation faults.
ie.
SDL_Event event;
while(SDL_PollEvent(&event) {
}
causes a segmentation fault.
Has anyone looked at my code?
Sarien driver works on same principle as mine, although the design is different.
I can't figure out why event.key.keysym.sym is always zero. It isn't in Sarien, nor checkkeys.c.
Copying code strait from checkkeys.c does not event give the save results.
It also seems that If I don't waste enough time in driver_kb_update() I get sementation faults.
ie.
SDL_Event event;
while(SDL_PollEvent(&event) {
}
causes a segmentation fault.
Has anyone looked at my code?
Re: Windoze Programming.
I have looked at your code did not understand some of it I guess now is a good time as any to get back into c and try to remember what is what.
Re: Windoze Programming.
Hey, I figured out the keyboard problem.
It's that AGIL was compiled with -fshort_enums, and SDL was not. So AGIL's SDL_Event was smaller that SDL's SDL_Event. This is what caused segmentation faults with SDL_PollEvent().
Working great now, I lost backward compatibility with saved games anyway adding the multi-slot code.
For people complaining about the small window, the window unlikely to be any larger in next release, but (if I can get it to work) I will add a "Press F11 to toggle full screen mode". Full screen mode does not work on my box (not even in NAGI), it says no graphics mode large enough for 320x200, when 'doze is running 640x480. I'll see, I'll put the code in the next release even if it doesn't work properly.
It's that AGIL was compiled with -fshort_enums, and SDL was not. So AGIL's SDL_Event was smaller that SDL's SDL_Event. This is what caused segmentation faults with SDL_PollEvent().
Working great now, I lost backward compatibility with saved games anyway adding the multi-slot code.
For people complaining about the small window, the window unlikely to be any larger in next release, but (if I can get it to work) I will add a "Press F11 to toggle full screen mode". Full screen mode does not work on my box (not even in NAGI), it says no graphics mode large enough for 320x200, when 'doze is running 640x480. I'll see, I'll put the code in the next release even if it doesn't work properly.
Re: Windoze Programming.
What does getwd() do? Does it return the working directory? As a general rule, if you want to find a Windows API function to do something, the name will be spelled out completely (so you unfortunately don't have such easily understood names as axftostp() or whatever). The Windows API command to get the current directory for a process is GetCurrentDirectory(). It takes a number of characters to retrieve followed by an appropriately sized buffer (needs to be a char buffer for Windows 95/98/Me and a wchar_t buffer if you compile for Windows NT).
Re: Windoze Programming.
Thanks for your help. Oh how I hate windoze.
getwd() does get the working directory. It's a POSIX function, who would have thought that Micros**t could give the funtions their real names.
getwd() does get the working directory. It's a POSIX function, who would have thought that Micros**t could give the funtions their real names.