1. EuSFML2 Updated
- Posted by Icy_Viking Mar 05, 2017
- 1431 views
Hello All,
I have updated my SFML 2 wrapper for Euphoria. It now supports SFML 2.4
http://www.rapideuphoria.com/uploads/eusfml2.zip - The link is here. It should be on the main site in a little while.
2. Re: EuSFML2 Updated
- Posted by ChrisB (moderator) Mar 06, 2017
- 1368 views
Hi
I downloaded the package, and ran it under Phix.
If you
--/* include std/machine.e --*/ include EuSys2.ew include EuGfx2.ew
and
integer eventType = peek4s(event) integer code = peek4s(event+4) integer alt = peek4s(event+8) atom control = peek4s(event+14) atom shift = peek4s(event+16) atom system = peek4s(event+20)
at the beginning of the executable programs, and
--/* include std/dll.e include std/machine.e --*/
at the beginning of the includes, and add
--SoundBuffer Functions atom C_DWORDLONG = C_DOUBLE
on line 449 of EuAud2.ew, then it works with Phix. (Phix doesn't have a C_DWORDLONG or a C_LONGLONG)
Note the audio demo asks to load test.wav, but you supply test.wma, which eusfml2 does not seem to support.
Sound doesn't sound right yet, but I will fiddle more and let you know if it works
Cheers
Chris
3. Re: EuSFML2 Updated
- Posted by ChrisB (moderator) Mar 06, 2017
- 1354 views
Hi, in the audio demo (AudDemo.exw), you were looping round too quickly, and consequently you were trying to play the sound over and over too many times. If you add
integer played = 0 --and if played = 0 then sfMusic_play(snd) played = 1 end if
Then it works fine
Cheers chris
4. Re: EuSFML2 Updated
- Posted by Icy_Viking Mar 06, 2017
- 1341 views
Hi, in the audio demo (AudDemo.exw), you were looping round too quickly, and consequently you were trying to play the sound over and over too many times. If you add
integer played = 0 --and if played = 0 then sfMusic_play(snd) played = 1 end if
Then it works fine
Cheers chris
Thanks. However whenever I try to run the Audio now demo now, I get an error saying machine level exception sfMusic_setVolume, line 200. I'm not sure why this is coming up. The code is correct.
public constant xsfMusic_setVolume = define_c_proc(aud,"sfMusic_setVolume",{C_POINTER,C_FLOAT}) public procedure sfMusic_setVolume(atom mus,atom vol) c_proc(xsfMusic_setVolume,{mus,vol}) --this is line 200 end procedure
I'm on Windows 7 Ultimate 64-bit. I assume its a bug, but I'm not sure what would be causing it.
5. Re: EuSFML2 Updated
- Posted by ChrisB (moderator) Mar 06, 2017
- 1322 views
Hi
Do the other demos still work, as under eu 4.05 I'm now getting a machine level exception (5) from sfWindow_isOpen() from all the demos? (Under 4.1, it doesn't tell me anything at all, just exits)
Just wondering, because changing the integers to atoms shouldn't make a blind bit of difference (changed them back, and it doesn't), unless the size of the number goes outside the integers range. At this point I usually give up trying to get these to work, and just go back to Phix. I think this is another example of Eu's inability to be consistent with loading of dlls.
Cheers
Chris
6. Re: EuSFML2 Updated
- Posted by ChrisB (moderator) Mar 07, 2017
- 1296 views
Hi
Actually it happens with any first call to the sfml library.
sfRenderWindow_create() is returning 0 - ie the window is not being created, and the application is not being initialised.
Cheers
Chris
7. Re: EuSFML2 Updated
- Posted by Icy_Viking Mar 07, 2017
- 1264 views
Interesting. I'm still using Euphoria 4.0.5. All the other demos were working besides the audio demo. Perhaps I should make a Phix version? It wouldn't be too hard. When you put it like that, it seems like Phix is the true succesor to Euphoria.
8. Re: EuSFML2 Updated
- Posted by ChrisB (moderator) Mar 07, 2017
- 1239 views
Hi
See above.
Cheers
Chris
9. Re: EuSFML2 Updated
- Posted by ChrisB (moderator) Mar 07, 2017
- 1272 views
Hi
The other thing to note of course, is that it could be me. Some other people just running it on their systems would be nice.
Cheers
Chris