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

Author Topic: SFML 2 for OS X comes true!  (Read 101117 times)

0 Members and 1 Guest are viewing this topic.

automata

  • Newbie
  • *
  • Posts: 8
    • View Profile
SFML 2 for OS X comes true!
« Reply #45 on: December 25, 2010, 07:09:43 am »
Merry Christmas, Hiura; you've been making some great progress with the port! Keep up the good work.

My 32-bit OSX system choked on the current SVN commit; it looks like the precompiled sndfile library got built for 64-bits only. I was able to build from the SVN about a month ago on this system, so it's probably just a minor regression.

Code: [Select]
[ 84%] Building CXX object src/SFML/Audio/CMakeFiles/sfml-audio.dir/SoundStream.cpp.o
Linking CXX shared library ../../../lib/libsfml-audio.dylib
ld: warning: in /Users/Laptop/Documents/sfml2/extlibs/libs-osx/Frameworks/sndfile.framework/sndfile, file was built for unsupported file format which is not the architecture being linked (x86_64)
Undefined symbols:
  "_sf_open", referenced from:
      sf::priv::SoundFile::OpenRead(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)in SoundFile.cpp.o
      sf::priv::SoundFile::OpenWrite(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, unsigned int)in SoundFile.cpp.o
  "_sf_open_virtual", referenced from:
      sf::priv::SoundFile::OpenRead(void const*, unsigned long)in SoundFile.cpp.o
  "_sf_seek", referenced from:
      sf::priv::SoundFile::Seek(float)in SoundFile.cpp.o
  "_sf_write_short", referenced from:
      sf::priv::SoundFile::Write(short const*, unsigned long)in SoundFile.cpp.o
  "_sf_strerror", referenced from:
      sf::priv::SoundFile::OpenRead(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)in SoundFile.cpp.o
      sf::priv::SoundFile::OpenWrite(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, unsigned int)in SoundFile.cpp.o
      sf::priv::SoundFile::OpenRead(void const*, unsigned long)in SoundFile.cpp.o
  "_sf_read_short", referenced from:
      sf::priv::SoundFile::Read(short*, unsigned long)in SoundFile.cpp.o
  "_sf_close", referenced from:
      sf::priv::SoundFile::~SoundFile()in SoundFile.cpp.o
      sf::priv::SoundFile::~SoundFile()in SoundFile.cpp.o
      sf::priv::SoundFile::OpenRead(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)in SoundFile.cpp.o
      sf::priv::SoundFile::OpenWrite(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, unsigned int)in SoundFile.cpp.o
      sf::priv::SoundFile::OpenRead(void const*, unsigned long)in SoundFile.cpp.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[2]: *** [lib/libsfml-audio.2.0.0.dylib] Error 1
make[1]: *** [src/SFML/Audio/CMakeFiles/sfml-audio.dir/all] Error 2
make: *** [all] Error 2

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
SFML 2 for OS X comes true!
« Reply #46 on: December 25, 2010, 07:13:00 pm »
Merry Christmas to you too!

Looks weird. This framework was build month ago by Ceylo and worked fine until now. Does the following command
Code: [Select]
file /Users/Laptop/Documents/sfml2/extlibs/libs-osx/Frameworks/sndfile.framework/sndfile give you something like
Quote
sndfile: Mach-O universal binary with 3 architectures
sndfile (for architecture ppc):   Mach-O dynamically linked shared library ppc
sndfile (for architecture i386):   Mach-O dynamically linked shared library i386
sndfile (for architecture x86_64):   Mach-O 64-bit dynamically linked shared library x86_64
? If you try to delete it and get it back, does it change anything ?
SFML / OS X developer

Mon ouïe

  • Newbie
  • *
  • Posts: 27
    • View Profile
SFML 2 for OS X comes true!
« Reply #47 on: December 25, 2010, 10:38:28 pm »
I had a similar issue. Files which were supposed to be symlinks had been replaced by normal files containing the path to the actual file. Making the symlinks myself worked until the installation, at which point I... simply removed my symlinks and copied the files :p

Code: [Select]
ld: warning: in /Users/Laptop/Documents/sfml2/extlibs/libs-osx/Frameworks/sndfile.framework/sndfile, file was built for unsupported file format which is not the architecture being linked (x86_64)
That doesn't mean it was only built for x86_64. That means the architecture being linked is x86_64. ;)

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
SFML 2 for OS X comes true!
« Reply #48 on: January 20, 2011, 01:54:00 pm »
A little bug to submit about the mouse position with the different event types.

Mouse move event is ok.
Mouse wheel event contains a wrong position.
Mouse button pressed event contains a wrong position.
Mouse button release event contains a wrong position.

The code I used :
Code: [Select]
#include <SFML/Graphics.hpp>
#include <cstdio>

using namespace sf;

int main()
{
    RenderWindow win(sf::VideoMode(640, 480), "huhu");
    Event ev;
   
    while (win.IsOpened())
    {
        while (win.GetEvent(ev))
        {
            if (ev.Type == Event::KeyPressed)
            {
                if (ev.Key.Code == Key::Escape)
                    win.Close();
            }
            else if (ev.Type == Event::MouseMoved)
                printf("moved : %d %d\n", ev.MouseMove.X, ev.MouseMove.Y);
            else if (ev.Type == Event::MouseWheelMoved)
                printf("wheel : %d %d\n", ev.MouseWheel.X, ev.MouseWheel.Y);
            else if (ev.Type == Event::MouseButtonPressed)
                printf("pressed : %d %d\n", ev.MouseButton.X, ev.MouseButton.Y);
            else if (ev.Type == Event::MouseButtonReleased)
                printf("released : %d %d\n", ev.MouseButton.X, ev.MouseButton.Y);
        }
       
        win.Clear();
        win.Display();
    }
    return 0;
}
Want to play movies in your SFML application? Check out sfeMovie!

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
SFML 2 for OS X comes true!
« Reply #49 on: January 20, 2011, 02:04:51 pm »
Thanks, now it's fixed! =)
SFML / OS X developer

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
SFML 2 for OS X comes true!
« Reply #50 on: January 20, 2011, 02:24:35 pm »
Great :D

Do you have some news about the other bugs ?
Want to play movies in your SFML application? Check out sfeMovie!

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
SFML 2 for OS X comes true!
« Reply #51 on: January 20, 2011, 02:29:01 pm »
I'm currently installing a bug tracker because I forget everything. So I think tomorrow I'll be able to work on the others bugs. at last!
SFML / OS X developer

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
SFML 2 for OS X comes true!
« Reply #52 on: January 21, 2011, 08:55:05 pm »
About
Quote from: "A long time ago Ceylo"
sf::Window::SetPosition(0, 0) does not put the window at the right place as far as the Y axis is concerned.

I cannot reproduce the bug with the following code.
Code: [Select]

#include <SFML/Window.hpp>
#include <SFML/OpenGL.hpp>

#include <iostream>

int main(int, char**) {
    sf::Window window(sf::VideoMode(800, 600, 32), "SFML");
   
    window.SetPosition(0, 0);
   
    while (window.IsOpened()) {
        sf::Event event;
        while (window.GetEvent(event)) {
            if (event.Type == sf::Event::Closed ||
                (event.Type == sf::Event::KeyPressed && event.Key.Code == sf::Key::Escape)) {
                window.Close();
            }
        }
       
        glClear(GL_COLOR_BUFFER_BIT);
       
        window.Display();
    }
   
    return 0;
}

SFML / OS X developer

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
SFML 2 for OS X comes true!
« Reply #53 on: January 21, 2011, 10:02:27 pm »
With your code and the latest sources, I still get the same bug :? . The window is put on the left of the screen but not in the top left corner (rather in the middle of the height).
Want to play movies in your SFML application? Check out sfeMovie!

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
SFML 2 for OS X comes true!
« Reply #54 on: January 21, 2011, 10:04:58 pm »
Which version of OSX do you use ?
SFML / OS X developer

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
SFML 2 for OS X comes true!
« Reply #55 on: January 21, 2011, 10:06:53 pm »
Mac OS X 10.6.6
Want to play movies in your SFML application? Check out sfeMovie!

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
SFML 2 for OS X comes true!
« Reply #56 on: January 21, 2011, 10:16:09 pm »
Ok, That's strange... I'm using the same version...

What is your screen resolution and what do you get with
Code: [Select]
NSLog(@"Screen Height : %f", NSHeight([[myWindow screen] visibleFrame])); (inserted on line 265 of SFWindowController.mm) ?

Have you any plugins to manage window size or anything like that ?
SFML / OS X developer

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
SFML 2 for OS X comes true!
« Reply #57 on: January 21, 2011, 10:23:59 pm »
Your line says :
Quote
2011-01-21 22:22:52.038 sf[10700:903] Screen Height : 717.000000


My screen size is 1280x800. I have no plugin to manage the window size or whatever :P .
Want to play movies in your SFML application? Check out sfeMovie!

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
SFML 2 for OS X comes true!
« Reply #58 on: January 21, 2011, 10:29:28 pm »
You have a dock on the bottom of your screen set not to hide. (That's not a question.  :P ) That's why it doesn't work for you.

Now I have to find something else to workaround that stuff. Shouldn't take too long.
SFML / OS X developer

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
SFML 2 for OS X comes true!
« Reply #59 on: January 21, 2011, 11:43:35 pm »
should be ok now.  :wink:
SFML / OS X developer