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

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

0 Members and 5 Guests are viewing this topic.

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
SFML 2 for OS X comes true!
« on: November 25, 2010, 06:02:31 pm »
Hello,

Detailed informations about SFML on Mac are available here.

I make it quick and go straight to the point. I just commited into the svn the SFML 2 port for Mac OS X. However, keep in mind that SFML 2 will continue to evolve thanks to Laurent! Thank you again Laurent for you really amazing job here!  :D

> use cmake as explained in the tutorial

> You'll see some warning during the compiling about some stuff are not yet implemented.

> test the examples (installed into /usr/local/share/SFML/examples/).

> test as many things you can and report me your bugs ;-)

> comment my code if you have time. =)

> have fun!
SFML / OS X developer

Spodi

  • Full Member
  • ***
  • Posts: 150
    • View Profile
    • http://www.netgore.com/
SFML 2 for OS X comes true!
« Reply #1 on: November 25, 2010, 10:07:48 pm »
Great work, Hiura! Greater portability is always a good thing. :)

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
SFML 2 for OS X comes true!
« Reply #2 on: November 27, 2010, 09:11:21 pm »
(up-to-date as on August, 2011)
Here is it how to use SFML 2 on mac.

First download the last sources from the git repository (see github project page for more info). Follow the tutorial on CMake (here) and choose Makefile (you may have some issues with right access with Xcode). build and install with «sudo make install». (SFML goes by default into /usr/local/ or /Library/Frameworks)

Now, if you want to use Makefile it's the same as on Linux.

If you're using Xcode 4 you can create very easily a new project with the SFML templates.

Otherwise, with Xcode 3 follow these steps :
> Create a new «command line tool» project with C++ selected.
> Double click on your target to open the target info.
> In «General» tab, click on the + in the left bottom.
> Scroll down to libsfml-* and choose the .dylib (not 2.0.dylib nor 2.0.0.dylib) for each module you will use. You can also use SFML frameworks. (Don't forget OpenGL framework if you use Graphics module)
> If you have some errors about include files not found, go to build tab, select «All Configuration» then search for «header search path» and add «/usr/local/include/». If you have not to add such search path please advise me.

If you encounter some «sndfile.framework/sndfile, file was built for unsupported file format which is not the architecture being linked (i386)» errors, please refer to this post.

If you got some crash with sf::String or sf::Text about some std::basic_string stuff add '-D_GLIBCXX_FULLY_DYNAMIC_STRING=1' to CMAKE_CXX_FLAGS (advanced option of cmake).

Some more details here. Post quoted :
Quote from: "Hiura"
Frameworks are now available. BUILD_FRAMEWORKS can be set to TRUE to build SFML as frameworks. NB : frameworks are only available in release. There is no sfml-*-d.framework.

Cmake automatically installs the xcode 4 templates for you if INSTALL_XCODE4_TEMPLATES is set to TRUE.

The templates were updated to let you choose between frameworks and dylibs.

If you choose to create a application bundle (.app) SFML dylibs or SFML frameworks, and sndfile framework, are copied to your bundle so you can send it as-is to people when you build it for "archive".

Please refer to xcode/templates/readme.txt for more details.

Have fun!  :wink:


If you need more information, don't hesitate to ask. ;-)
SFML / OS X developer

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
SFML 2 for OS X comes true!
« Reply #3 on: November 27, 2010, 09:23:30 pm »
One more thing : this is not the final version. You'll have frameworks instead of dylib if everything goes right in a few months. You'll also have some templates for your projects, of course.  :wink:
SFML / OS X developer

Terrydil

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
SFML 2 for OS X comes true!
« Reply #4 on: November 28, 2010, 04:49:49 pm »
This is completely awesome Hiura, nice job.  Can't wait to try it out. :)

Thanks Hiura and of course Laurent, y'all rock.

Vit

  • Newbie
  • *
  • Posts: 14
    • View Profile
SFML 2 for OS X comes true!
« Reply #5 on: November 29, 2010, 11:18:57 am »
Hooray :D
Let's see if the bugs I noticed in 1.6 are fixed (a few SFML + OpenGL integration bugs, and transparent bitmap blitting).

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
SFML 2 for OS X comes true!
« Reply #6 on: November 30, 2010, 09:12:46 pm »
Here is the list of know bugs :

> Managing SFML window with external NSWindow cause some trouble with Graphics module (works fine with Window module).

> The blocking mode for event listening (sf::Window::WaitEvent instead of GetEvent) is buggy – try opengl example to see what I mean. It's really weird!!

And the list of not implemented feature (yet!) :

> Managing SFML window with an external NSView (both modules).

> Updating OGL context version inside sf::Settings.

> RenderImageImplPBuffer

> Joystick

> Menu bar

> (PPC arch and CMake producing frameworks)

If you spot some other thing, please tell me!  :)
SFML / OS X developer

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
SFML 2 for OS X comes true!
« Reply #7 on: November 30, 2010, 09:37:41 pm »
Okay, so here is my very small report :D

When using the fullscreen mode, the menu bar remains on top of the window, the window is unable to get focus and pressing any key causes beeps.
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 #8 on: November 30, 2010, 10:05:20 pm »
I admit : I forgot to try fullscreen so I fully guilty!  :oops:

Will be fixed ASAP!

Thanks for your report.
SFML / OS X developer

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
SFML 2 for OS X comes true!
« Reply #9 on: December 01, 2010, 12:02:41 am »
Should be ok now. Can you confirm ?
SFML / OS X developer

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
SFML 2 for OS X comes true!
« Reply #10 on: December 01, 2010, 12:22:57 am »
Working fine now :) (as for this point :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 #11 on: December 03, 2010, 11:52:08 pm »
Could someone check my PBuffer impl of RenderImage ? Thanks  :)
SFML / OS X developer

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
SFML 2 for OS X comes true!
« Reply #12 on: December 04, 2010, 05:29:41 pm »
Currently there is a problem with the use of a NSWindow as an external handle for SFML. It works perfectly right with only window module/opengl content but with the graphics module I got a black window.

You can try it by downloading this archive.

The only thing that is different between «graphics» and «handle_nswindow_graphics» targets (from SFML point of view) is the call one of these functions of SFWindowController (from window module) :

Code: [Select]
-(id)initWithMode:(sf::VideoMode const*)mode andStyle:(unsigned long)style;
-(id)initWithWindow:(NSWindow*)window;


I don't see any difference between them that could explain this strange behaviour... Does anyone of you ?

Maybe I did something stupid in the handle_nswindow_graphics sample ?

Any help would be appreciate.  :)
SFML / OS X developer

automata

  • Newbie
  • *
  • Posts: 8
    • View Profile
SFML 2 for OS X comes true!
« Reply #13 on: December 11, 2010, 04:57:19 am »
An issue with CMake and the current SVN version of sfml2:

Code: [Select]
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
GLEW_INCLUDE_PATH
   used as include directory in directory /Users/Laptop/Documents/sfml2/src/SFML/Graphics

Configuring incomplete, errors occurred!


I get this regardless of whether I try to setup a build environment for XCode or makefiles.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SFML 2 for OS X comes true!
« Reply #14 on: December 11, 2010, 11:54:53 am »
Quote
An issue with CMake and the current SVN version of sfml2

Should be fixed now.
Laurent Gomila - SFML developer

 

anything