Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: SFML 1.3 and OS X  (Read 47590 times)

0 Members and 1 Guest are viewing this topic.

coral

  • Newbie
  • *
  • Posts: 37
    • View Profile
SFML 1.3 and OS X
« Reply #45 on: August 28, 2008, 07:48:52 pm »
Hey, i try to build it but it doesn't find the contents in the AL folder, is there som path you hard set in your xcode project?

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
SFML 1.3 and OS X
« Reply #46 on: August 28, 2008, 10:30:15 pm »
There is no path to set, you just need to install OpenAL... BUT the audio package does not work (because of problems with the Mac OS X OpenAL backend).
Want to play movies in your SFML application? Check out sfeMovie!

dorkfish

  • Newbie
  • *
  • Posts: 38
    • View Profile
SFML 1.3 and OS X
« Reply #47 on: September 01, 2008, 08:10:55 am »
I got it to work by tweaking the openal includes. Change "AL/al.h" to "OpenAL/al.h", and do the same for the other includes that produce an error. Sorry I can't explain better, I'm not in MacOS right now. I think that that bit of code should be changed to use #ifdef to import the proper headers, given an OS.

coral

  • Newbie
  • *
  • Posts: 37
    • View Profile
SFML 1.3 and OS X
« Reply #48 on: September 02, 2008, 11:08:47 am »
Hey, what are the exact problem's with Open AL OSX Backend?

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
SFML 1.3 and OS X
« Reply #49 on: September 03, 2008, 12:53:24 pm »
A crash when finishing reading the sound.
Want to play movies in your SFML application? Check out sfeMovie!

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
SFML 1.3 and OS X
« Reply #50 on: September 08, 2008, 07:03:41 pm »
Latest news : the OpenAL framework provided with Mac OS X 10.4 and later seems to be working fine. That means, the SFML audio package is probably usable (still to be checked).
Want to play movies in your SFML application? Check out sfeMovie!

Gammenon

  • Newbie
  • *
  • Posts: 27
    • View Profile
SFML 1.3 and OS X
« Reply #51 on: September 19, 2008, 10:41:37 am »
Thanks you all for your work, gentlemen!

What is the current status of SFML in Mac OS X?

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
SFML 1.3 and OS X
« Reply #52 on: September 19, 2008, 12:58:36 pm »
A little personal raodmap for what's been done since last time and what's remaining (green=done, orange=to do+low priority, red=to do+high priority) :

Quote
TO DO:
- mouse position setting function
- joysticks handling
- handle MouseEntered and MousedExited events
- implement fullscreen mode

TO FIX:
- closing all the SFML windows may leave your app blocked (no more event handling)
- SFML windows cannot be used properly in Cocoa applications (just messing up everything in the run loop)
- there are missing keys (as an Apple keyboard does not have the same keys as an PC's one)
- not all the keys (text events are not concerned) are language independant
- using the '^' key and 'e' key produces an 'e' instead of 'ê' (same for other characters that need two keys)
- correct WindowImplCocoa::SetIcon()


I'm currently working on the fullscreen feature, but I have some troubles.

As you may now, each window and "full screen" has its own OpenGL context. All of these contexts use a main shared context, so that resources don't have to be loaded more than once. But now the problem is the public contexts must have the same properties as the shared one. That means I can't share a context made for a window with a fullscreen context. Same with contexts using antialiasing.

For now, the solution would be using a window fitting the whole screen, which means loss of performance (direct screen rendering *can* be faster than rendering in a window).
Want to play movies in your SFML application? Check out sfeMovie!

coral

  • Newbie
  • *
  • Posts: 37
    • View Profile
SFML 1.3 and OS X
« Reply #53 on: September 20, 2008, 12:19:46 pm »
Hey, just trying out to build it on Leopard again (10.5.5).

First problem: is the Malloc.h it's using, i'm not seeing a clear point in using this at all since stdlib.h takes care of what malloc.h was doing, it's sort of a deprecated header file.

But just to try i copied it into my build folder.

Second problem was this:
Code: [Select]
@executable_path/../Frameworks/sfml-audio-d.framework/Versions/A/sfml-audio-d -dynamiclib /Users/coral/Documents/Kod/Projektarbete/sfml/build/xcode/../../extlibs/libs-xcode/libsndfile.a -framework OpenAL -lsndfile

ld: library not found for -lsndfile

collect2: ld returned 1 exit status


I am at this stage right now, aiming to solve it. Give me a tip or two!

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
SFML 1.3 and OS X
« Reply #54 on: September 20, 2008, 12:36:16 pm »
Quote from: "coral"
First problem: is the Malloc.h it's using, i'm not seeing a clear point in using this at all since stdlib.h takes care of what malloc.h was doing, it's sort of a deprecated header file.

But just to try i copied it into my build folder.

Don't worry about this, malloc.h is not needed, you can remove the #include for this file.

Quote from: "coral"
Second problem was this:
[/b]
Code: [Select]
@executable_path/../Frameworks/sfml-audio-d.framework/Versions/A/sfml-audio-d -dynamiclib /Users/coral/Documents/Kod/Projektarbete/sfml/build/xcode/../../extlibs/libs-xcode/libsndfile.a -framework OpenAL -lsndfile

ld: library not found for -lsndfile

collect2: ld returned 1 exit status


I am at this stage right now, aiming to solve it. Give me a tip or two!

Uh... a mistake :lol: . libsndfile doesn't need to be linked twice. I'm going to fix this as soon as possible.


EDIT: fixed.
Want to play movies in your SFML application? Check out sfeMovie!

coral

  • Newbie
  • *
  • Posts: 37
    • View Profile
SFML 1.3 and OS X
« Reply #55 on: September 20, 2008, 12:47:21 pm »
Nice, i updated my sources to yours and tried to build it again but ended up with a pile of errors:

Code: [Select]
   cd /Users/coral/Documents/Kod/Projektarbete/sfml/build/xcode
    /Developer/usr/bin/g++-4.0 -o /Users/coral/Documents/Kod/Projektarbete/sfml/build/xcode/build/Debug/sfml-audio-d.framework/Versions/A/sfml-audio-d -L/Users/coral/Documents/Kod/Projektarbete/sfml/build/xcode/build/Debug -F/Users/coral/Documents/Kod/Projektarbete/sfml/build/xcode/build/Debug -filelist /Users/coral/Documents/Kod/Projektarbete/sfml/build/xcode/build/SFML.build/Debug/sfml-audio.build/Objects-normal/i386/sfml-audio-d.LinkFileList -framework sfml-system-d -arch i386 -prebind -Wl,-single_module -compatibility_version 1 -current_version 1 -install_name @executable_path/../Frameworks/sfml-audio-d.framework/Versions/A/sfml-audio-d -dynamiclib /Users/coral/Documents/Kod/Projektarbete/sfml/build/xcode/../../extlibs/libs-xcode/libsndfile.a -framework OpenAL
ld: warning in /Library/Frameworks//OpenAL.framework/OpenAL, file is not of required architecture
Undefined symbols:
  "_alGetListenerf", referenced from:
      sf::Listener::GetGlobalVolume()     in Listener.o
  "_alcCreateContext", referenced from:
      sf::priv::AudioDevice::AudioDevice()in AudioDevice.o
  "_alcCloseDevice", referenced from:
      sf::priv::AudioDevice::~AudioDevice()in AudioDevice.o
  "_alcCaptureOpenDevice", referenced from:
      sf::SoundRecorder::Start(unsigned int)in SoundRecorder.o
  "_alSourcePause", referenced from:
      sf::Sound::Pause()    in Sound.o
  "_alGetSourcef", referenced from:
      sf::Sound::GetVolume() constin Sound.o
      sf::Sound::GetPitch() constin Sound.o
      sf::Sound::GetMinDistance() constin Sound.o
      sf::Sound::GetAttenuation() constin Sound.o
      sf::Sound::GetPlayingOffset() constin Sound.o
  "_alGetSourcei", referenced from:
      sf::Sound::GetLoop() constin Sound.o
      sf::Sound::GetStatus() constin Sound.o
      sf::SoundStream::CleanUp()     in SoundStream.o
      sf::SoundStream::Run()     in SoundStream.o
  "_alcCaptureStop", referenced from:
      sf::SoundRecorder::CleanUp()     in SoundRecorder.o
  "_alGenBuffers", referenced from:
      sf::SoundBuffer::SoundBuffer()in SoundBuffer.o
      sf::SoundBuffer::SoundBuffer(sf::SoundBuffer const&)in SoundBuffer.o
      sf::SoundStream::Run()     in SoundStream.o
  "_alcDestroyContext", referenced from:
      sf::priv::AudioDevice::~AudioDevice()in AudioDevice.o
  "_alSourceQueueBuffers", referenced from:
      sf::SoundStream::FillAndPushBuffer(unsigned int)in SoundStream.o
  "_alDeleteBuffers", referenced from:
      sf::SoundBuffer::~SoundBuffer()in SoundBuffer.o
      sf::SoundBuffer::~SoundBuffer()in SoundBuffer.o
      sf::SoundStream::CleanUp()     in SoundStream.o
  "_alListenerf", referenced from:
      sf::Listener::SetGlobalVolume(float)in Listener.o
  "_alcMakeContextCurrent", referenced from:
      sf::priv::AudioDevice::AudioDevice()in AudioDevice.o
      sf::priv::AudioDevice::~AudioDevice()in AudioDevice.o
  "_alListener3f", referenced from:
      sf::Listener::SetPosition(float, float, float)in Listener.o
  "_alGetError", referenced from:
      sf::priv::ALCheckError(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned int)in Listener.o
      sf::priv::ALCheckError(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned int)in Sound.o
      sf::priv::ALCheckError(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned int)in SoundBuffer.o
      sf::priv::ALCheckError(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned int)in SoundStream.o
  "_alGetEnumValue", referenced from:
      sf::priv::AudioDevice::GetFormatFromChannelsCount(unsigned int) constin AudioDevice.o
      sf::priv::AudioDevice::GetFormatFromChannelsCount(unsigned int) constin AudioDevice.o
      sf::priv::AudioDevice::GetFormatFromChannelsCount(unsigned int) constin AudioDevice.o
      sf::priv::AudioDevice::GetFormatFromChannelsCount(unsigned int) constin AudioDevice.o
  "_alListenerfv", referenced from:
      sf::Listener::SetTarget(float, float, float)in Listener.o
  "_alGetBufferi", referenced from:
      sf::SoundBuffer::GetChannelsCount() const in SoundBuffer.o
      sf::SoundBuffer::GetSampleRate() const in SoundBuffer.o
      sf::SoundStream::Run()     in SoundStream.o
  "_alcIsExtensionPresent", referenced from:
      sf::SoundRecorder::CanCapture()      in SoundRecorder.o
  "_alcCaptureCloseDevice", referenced from:
      sf::SoundRecorder::CleanUp()     in SoundRecorder.o
  "_alcCaptureStart", referenced from:
      sf::SoundRecorder::Start(unsigned int)in SoundRecorder.o
  "_alcOpenDevice", referenced from:
      sf::priv::AudioDevice::AudioDevice()in AudioDevice.o
  "_alSourcePlay", referenced from:
      sf::Sound::Play()    in Sound.o
  "_alSourcef", referenced from:
      sf::Sound::SetPitch(float)in Sound.o
      sf::Sound::SetVolume(float)in Sound.o
      sf::Sound::SetMinDistance(float)in Sound.o
      sf::Sound::SetAttenuation(float)in Sound.o
      sf::Sound::SetPlayingOffset(float)in Sound.o
      sf::Sound::Sound(sf::Sound const&)in Sound.o
      sf::Sound::Sound(sf::Sound const&)in Sound.o
      sf::Sound::Sound(sf::SoundBuffer const&, bool, float, float, sf::Vector3<float> const&)in Sound.o
      sf::Sound::Sound(sf::SoundBuffer const&, bool, float, float, sf::Vector3<float> const&)in Sound.o
  "_alSourcei", referenced from:
      sf::Sound::SetLoop(bool)in Sound.o
      sf::Sound::~Sound()in Sound.o
      sf::Sound::~Sound()in Sound.o
      sf::Sound::Sound(sf::Sound const&)in Sound.o
      sf::Sound::Sound(sf::Sound const&)in Sound.o
      sf::Sound::Sound(sf::SoundBuffer const&, bool, float, float, sf::Vector3<float> const&)in Sound.o
      sf::Sound::Sound(sf::SoundBuffer const&, bool, float, float, sf::Vector3<float> const&)in Sound.o
      sf::Sound::Sound()in Sound.o
      sf::Sound::SetBuffer(sf::SoundBuffer const&)in Sound.o
  "_alGetListener3f", referenced from:
      sf::Listener::GetPosition()     in Listener.o
  "_alSourceUnqueueBuffers", referenced from:
      sf::SoundStream::CleanUp()     in SoundStream.o
      sf::SoundStream::Run()     in SoundStream.o
  "_alcCaptureSamples", referenced from:
      sf::SoundRecorder::ProcessCapturedSamples()      in SoundRecorder.o
  "_alGenSources", referenced from:
      sf::Sound::Sound(sf::Sound const&)in Sound.o
      sf::Sound::Sound(sf::SoundBuffer const&, bool, float, float, sf::Vector3<float> const&)in Sound.o
      sf::Sound::Sound()in Sound.o
  "_alBufferData", referenced from:
      sf::SoundBuffer::Update(unsigned int, unsigned int)in SoundBuffer.o
      sf::SoundStream::FillAndPushBuffer(unsigned int)in SoundStream.o
  "_alcGetIntegerv", referenced from:
      sf::SoundRecorder::ProcessCapturedSamples()      in SoundRecorder.o
  "_alSource3f", referenced from:
      sf::Sound::SetPosition(float, float, float)in Sound.o
      sf::Sound::Sound(sf::Sound const&)in Sound.o
      sf::Sound::Sound(sf::SoundBuffer const&, bool, float, float, sf::Vector3<float> const&)in Sound.o
  "_alGetListenerfv", referenced from:
      sf::Listener::GetTarget()    in Listener.o
  "_alGetSource3f", referenced from:
      sf::Sound::GetPosition() constin Sound.o
  "_alDeleteSources", referenced from:
      sf::Sound::~Sound()in Sound.o
      sf::Sound::~Sound()in Sound.o
  "_alSourceStop", referenced from:
      sf::Sound::Stop()    in Sound.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
SFML 1.3 and OS X
« Reply #56 on: September 20, 2008, 01:03:50 pm »
Quote from: "coral"
/Library/Frameworks//OpenAL.framework/OpenAL, file is not of required architecture

You're using a non UB (universal) framework. Looks like it is ppc only.
Anyway you don't need this, the OpenAL framework is already in /System/Library/Frameworks. And that one is UB.

So just remove OpenAL.framework from the /Library/Frameworks directory.


PS: does the OpenAL.framework you're using come from my website ? All of the downloads I provide in it are PPC only.
Want to play movies in your SFML application? Check out sfeMovie!

coral

  • Newbie
  • *
  • Posts: 37
    • View Profile
SFML 1.3 and OS X
« Reply #57 on: September 20, 2008, 01:56:05 pm »
I don't know where it came from, i think i placed it there when the AL building wasn't working. However, i removed it and it works like a charm. Everything compiled and it's ready to go for OSX 10.5.5.

I will try to publish my Leopard builds here:
http://frittelan.se/code/sfmlosxbuild/index.php

Now it's time for some testing!

coral

  • Newbie
  • *
  • Posts: 37
    • View Profile
SFML 1.3 and OS X
« Reply #58 on: September 20, 2008, 02:06:27 pm »
Hmm, the first test turned out not to be working. I modified the demo code and stripped it to this:

Code: [Select]
#include <SFML/Audio.hpp>
 #include <SFML/Graphics.hpp>
 #include <SFML/System.hpp>
 
 int main()
 {
     // Create the main window
     sf::RenderWindow App(sf::VideoMode(800, 600), "SFML window");
 
     // Create a graphical string to display
     sf::Font Arial;
     if (!Arial.LoadFromFile("Arial.ttf"))
         return EXIT_FAILURE;
     sf::String Text("Hello SFML", Arial, 50);
 
     // Start the game loop
     while (App.IsOpened())
     {
         // Process events
         sf::Event Event;
         while (App.GetEvent(Event))
         {
             // Close window : exit
             if (Event.Type == sf::Event::Closed)
                 App.Close();
         }
 
         // Draw the string
         App.Draw(Text);
 
         // Update the window
         App.Display();
     }
 
     return EXIT_SUCCESS;
 }


I got this:

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
SFML 1.3 and OS X
« Reply #59 on: September 20, 2008, 02:09:50 pm »
Quote from: "coral"
I don't know where it came from, i think i placed it there when the AL building wasn't working. However, i removed it and it works like a charm. Everything compiled and it's ready to go for OSX 10.5.5.

I will try to publish my Leopard builds here:
http://frittelan.se/code/sfmlosxbuild/index.php

Now it's time for some testing!

I suppose you provide this only for early tries for everyone, don't you ?
By the way, you only put the release frameworks, not the debug ones :P .
Want to play movies in your SFML application? Check out sfeMovie!