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

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

0 Members and 1 Guest are viewing this topic.

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
SFML 2 for OS X comes true!
« Reply #60 on: January 22, 2011, 12:59:25 am »
Indeed it is :) .
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 #61 on: January 22, 2011, 10:25:50 am »
Now about
Quote
Creating a window and then calling sf::Window::Create() on the same window object makes the app crash randomly.

Does the following code crash ?
Code: [Select]
#include <SFML/Window.hpp>

int main(int, char**) {
   
    sf::Window window(sf::VideoMode(800, 600), "SFML");
   
    sf::Clock clock;
    while (clock.GetElapsedTime() < 100.f) {
        window.Create(sf::VideoMode(800, 600), "SFML");
        sf::Sleep(0.1); // not required.
    }
   
    return 0;
}
I can't reproduce the bug here.
SFML / OS X developer

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
SFML 2 for OS X comes true!
« Reply #62 on: January 22, 2011, 10:43:04 am »
Your code doesn't crash, but the following one does:
Code: [Select]
#include <SFML/Window.hpp>
#include <SFML/OpenGL.hpp>

int main(int, char**) {
   
    sf::Window window(sf::VideoMode(800, 600), "SFML");
   
    sf::Clock clock;
    while (clock.GetElapsedTime() < 100.f) {
        window.Create(sf::VideoMode(800, 600), "SFML");

sf::Event ev;
while (window.GetEvent(ev)) {

}

glClear(GL_COLOR_BUFFER_BIT);
window.Display();
        sf::Sleep(0.1); // not required.
    }
   
    return 0;
}


P.S.: it seems to crash as soon as you add the event handling code.
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 #63 on: January 24, 2011, 12:51:42 am »
WHaou! That was some serious bug! (5 different backtraces for the same bug (love memory guard) plus one other bug which gave me some weird «-[NSConcreteValue windowDidResignKey:] unrecognized selector sent to instance» comming from nowhere..) :shock:

Can you confirm it's working properly now ?
SFML / OS X developer

Kolja

  • Newbie
  • *
  • Posts: 22
    • View Profile
SFML 2 for OS X comes true!
« Reply #64 on: January 24, 2011, 01:13:38 pm »
Hey there!

Another Mac user here, I'll try to help with some testing when I find the time (currently it's exam time here though, so not now). But I'm really glad you are helping the OS X port along!

During my initial compile of the current SVN tarball I noticed (apart from the broken sndfile symlink) that all graphical examples only display something after the window has been obscured or moved - known bug or weird behavior on my system?

I'm on a MBP running 10.6.6 by the way, using the GeForce 9400M for now.

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
SFML 2 for OS X comes true!
« Reply #65 on: January 24, 2011, 01:56:59 pm »
Hi! Happy to see a new face. :)

I tried to reproduce the problem you described but I couldn't reproduce it (even with the tar.gz) and I have the same hardware/OS version.

Have you any other app non related to SFML that have the same behaviour ?
Maybe you haven't updated your driver ?
Any plugins ?

It's very weird..
SFML / OS X developer

Kolja

  • Newbie
  • *
  • Posts: 22
    • View Profile
SFML 2 for OS X comes true!
« Reply #66 on: January 24, 2011, 02:09:04 pm »
D'oh, sorry to have taken away your time. A reboot fixed it, now it works with both graphics cards. I'm not totally sure how such a bug "works" though, other hardware accelerated games worked fine.

Kolja

  • Newbie
  • *
  • Posts: 22
    • View Profile
SFML 2 for OS X comes true!
« Reply #67 on: January 24, 2011, 02:15:54 pm »
On an unrelated note, shaders in the examples directory are something SFML-specific, right? Because the example only tells me that shaders are unsupported on my system, but GLSL definitely works here ;-)
I only use SFML for audio, input and a cross-platform OpenGL context I do my own drawing in, so all the graphics and sprite features of SFML don't concern me too much.

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
SFML 2 for OS X comes true!
« Reply #68 on: January 24, 2011, 02:28:33 pm »
Same here -> added to my task list. I'll have a look soon.
SFML / OS X developer

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
SFML 2 for OS X comes true!
« Reply #69 on: January 24, 2011, 04:13:24 pm »
Quote from: "Hiura"
WHaou! That was some serious bug! (5 different backtraces for the same bug (love memory guard) plus one other bug which gave me some weird «-[NSConcreteValue windowDidResignKey:] unrecognized selector sent to instance» comming from nowhere..) :shock:

Can you confirm it's working properly now ?

It's working fine now, or at least... the given code does no more crash.
Want to play movies in your SFML application? Check out sfeMovie!

ideal phi

  • Newbie
  • *
  • Posts: 6
    • View Profile
SFML 2 for OS X comes true!
« Reply #70 on: January 28, 2011, 07:02:38 pm »
If you guys haven't got the joystick working for Mac OS X, there is a sample here:
http://homepage3.nifty.com/ysflight/macdev/joystick/e.html

Trunks7j

  • Newbie
  • *
  • Posts: 15
    • View Profile
SFML 2 for OS X comes true!
« Reply #71 on: January 28, 2011, 08:40:02 pm »
Hiura, thanks for your work on SFML2.

For reference, I am running OSX 10.6.4, gcc 4.2.1.  I was able to build the static libraries successfully using cmake -> unix makefiles.  However when trying to compile any of the graphical examples provided with SFML2, I get lots of undefined symbols.  I can paste the first third or so here:

Code: [Select]
Undefined symbols:
  "_jpeg_write_scanlines", referenced from:
      sf::priv::ImageLoader::WriteJpg(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<unsigned char, std::allocator<unsigned char> > const&, unsigned int, unsigned int)in libsfml-graphics-s-d.a(ImageLoader.cpp.o)
  "_FT_Get_Char_Index", referenced from:
      sf::Font::GetKerning(unsigned int, unsigned int, unsigned int) constin libsfml-graphics-s-d.a(Font.cpp.o)
      sf::Font::GetKerning(unsigned int, unsigned int, unsigned int) constin libsfml-graphics-s-d.a(Font.cpp.o)
  "_objc_msgSend_fpret", referenced from:
      -[SFWindowController resizeTo:by:] in libsfml-window-s-d.a(SFWindowController.mm.o)
      -[SFWindowController setWindowPositionToX:Y:] in libsfml-window-s-d.a(SFWindowController.mm.o)
      -[SFWindowController screenHeight] in libsfml-window-s-d.a(SFWindowController.mm.o)
      -[SFOpenGLView scrollWheel:] in libsfml-window-s-d.a(SFOpenGLView.mm.o)
  ".objc_class_name_NSOpenGLPixelFormat", referenced from:
      literal-pointer@__OBJC@__cls_refs@NSOpenGLPixelFormat in libsfml-window-s-d.a(SFContext.mm.o)
  "___glewUniform2fARB", referenced from:
      ___glewUniform2fARB$non_lazy_ptr in libsfml-graphics-s-d.a(Shader.cpp.o)
     (maybe you meant: ___glewUniform2fARB$non_lazy_ptr)
  "___glewCreateProgramObjectARB", referenced from:
      ___glewCreateProgramObjectARB$non_lazy_ptr in libsfml-graphics-s-d.a(Shader.cpp.o)
     (maybe you meant: ___glewCreateProgramObjectARB$non_lazy_ptr)
  "_FT_New_Face", referenced from:
      sf::Font::LoadFromFile(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)in libsfml-graphics-s-d.a(Font.cpp.o)
  "_CGDisplayPixelsWide", referenced from:
      sf::priv::VideoModeImpl::GetDesktopMode()     in libsfml-window-s-d.a(VideoModeImpl.cpp.o)
      sf::priv::VideoModeImpl::GetFullscreenModes()     in libsfml-window-s-d.a(VideoModeImpl.cpp.o)
  "___GLEW_ARB_vertex_shader", referenced from:
      ___GLEW_ARB_vertex_shader$non_lazy_ptr in libsfml-graphics-s-d.a(Shader.cpp.o)
     (maybe you meant: ___GLEW_ARB_vertex_shader$non_lazy_ptr)
  ".objc_class_name_NSObject", referenced from:
      .objc_class_name_SFApplication in libsfml-window-s-d.a(SFApplication.m.o)
  "___glewCompileShaderARB", referenced from:
      ___glewCompileShaderARB$non_lazy_ptr in libsfml-graphics-s-d.a(Shader.cpp.o)
     (maybe you meant: ___glewCompileShaderARB$non_lazy_ptr)
  "_FT_Get_Glyph", referenced from:
      sf::Font::LoadGlyph(unsigned int, unsigned int, bool) constin libsfml-graphics-s-d.a(Font.cpp.o)
  "_NSCalibratedRGBColorSpace", referenced from:
      _NSCalibratedRGBColorSpace$non_lazy_ptr in libsfml-window-s-d.a(SFWindowController.mm.o)
     (maybe you meant: _NSCalibratedRGBColorSpace$non_lazy_ptr)
  ".objc_class_name_NSString", referenced from:
      literal-pointer@__OBJC@__cls_refs@NSString in libsfml-window-s-d.a(cpp_objc_conversion.mm.o)
  "___glewDeleteObjectARB", referenced from:
      ___glewDeleteObjectARB$non_lazy_ptr in libsfml-graphics-s-d.a(Shader.cpp.o)
     (maybe you meant: ___glewDeleteObjectARB$non_lazy_ptr)
  "___glewGetObjectParameterivARB", referenced from:
      ___glewGetObjectParameterivARB$non_lazy_ptr in libsfml-graphics-s-d.a(Shader.cpp.o)
     (maybe you meant: ___glewGetObjectParameterivARB$non_lazy_ptr)
  "___CFConstantStringClassReference", referenced from:
      cfstring=--------RRRRRRRRGGGGGGGGBBBBBBBB in libsfml-window-s-d.a(VideoModeImpl.cpp.o)
      cfstring=-RRRRRGGGGGBBBBB in libsfml-window-s-d.a(VideoModeImpl.cpp.o)
      cfstring=PPPPPPPP in libsfml-window-s-d.a(VideoModeImpl.cpp.o)
      cfstring=NSScreenNumber in libsfml-window-s-d.a(SFWindowController.mm.o)
  ".objc_class_name_NSCursor", referenced from:
      literal-pointer@__OBJC@__cls_refs@NSCursor in libsfml-window-s-d.a(SFWindowController.mm.o)
  "___glewGetInfoLogARB", referenced from:
      ___glewGetInfoLogARB$non_lazy_ptr in libsfml-graphics-s-d.a(Shader.cpp.o)
     (maybe you meant: ___glewGetInfoLogARB$non_lazy_ptr)
  ".objc_class_name_NSNotificationCenter", referenced from:
      literal-pointer@__OBJC@__cls_refs@NSNotificationCenter in libsfml-window-s-d.a(SFOpenGLView.mm.o)
  "___glewUniform3fARB", referenced from:
      ___glewUniform3fARB$non_lazy_ptr in libsfml-graphics-s-d.a(Shader.cpp.o)
     (maybe you meant: ___glewUniform3fARB$non_lazy_ptr)
  "_FT_Done_Glyph", referenced from:
      sf::Font::LoadGlyph(unsigned int, unsigned int, bool) constin libsfml-graphics-s-d.a(Font.cpp.o)
  "_GetCurrentProcess", referenced from:
      sf::priv::WindowImplCocoa::SetUpProcessAsApplication()     in libsfml-window-s-d.a(WindowImplCocoa.mm.o)
  "___glewUseProgramObjectARB", referenced from:
      ___glewUseProgramObjectARB$non_lazy_ptr in libsfml-graphics-s-d.a(Renderer.cpp.o)
      ___glewUseProgramObjectARB$non_lazy_ptr in libsfml-graphics-s-d.a(Shader.cpp.o)
     (maybe you meant: ___glewUseProgramObjectARB$non_lazy_ptr)
  "___GLEW_ARB_fragment_shader", referenced from:
      ___GLEW_ARB_fragment_shader$non_lazy_ptr in libsfml-graphics-s-d.a(Shader.cpp.o)
     (maybe you meant: ___GLEW_ARB_fragment_shader$non_lazy_ptr)
  "_FT_Select_Charmap", referenced from:
      sf::Font::LoadFromMemory(void const*, unsigned long)in libsfml-graphics-s-d.a(Font.cpp.o)
      sf::Font::LoadFromFile(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)in libsfml-graphics-s-d.a(Font.cpp.o)
  "___glewCreateShaderObjectARB", referenced from:
      ___glewCreateShaderObjectARB$non_lazy_ptr in libsfml-graphics-s-d.a(Shader.cpp.o)
     (maybe you meant: ___glewCreateShaderObjectARB$non_lazy_ptr)
  "___glewActiveTextureARB", referenced from:
      ___glewActiveTextureARB$non_lazy_ptr in libsfml-graphics-s-d.a(Shader.cpp.o)
     (maybe you meant: ___glewActiveTextureARB$non_lazy_ptr)
  "_NSDefaultRunLoopMode", referenced from:
      _NSDefaultRunLoopMode$non_lazy_ptr in libsfml-window-s-d.a(SFApplication.m.o)
     (maybe you meant: _NSDefaultRunLoopMode$non_lazy_ptr)
  "_jpeg_finish_compress", referenced from:
      sf::priv::ImageLoader::WriteJpg(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<unsigned char, std::allocator<unsigned char> > const&, unsigned int, unsigned int)in libsfml-graphics-s-d.a(ImageLoader.cpp.o)
  ".objc_class_name_NSResponder", referenced from:
      .objc_class_name_SFWindowController in libsfml-window-s-d.a(SFWindowController.mm.o)
  "_FT_Bitmap_Embolden", referenced from:
      sf::Font::LoadGlyph(unsigned int, unsigned int, bool) constin libsfml-graphics-s-d.a(Font.cpp.o)
  "___GLEW_ARB_shader_objects", referenced from:
      ___GLEW_ARB_shader_objects$non_lazy_ptr in libsfml-graphics-s-d.a(Shader.cpp.o)
     (maybe you meant: ___GLEW_ARB_shader_objects$non_lazy_ptr)
  "_CGDisplayMoveCursorToPoint", referenced from:
      -[SFWindowController setCursorPositionToX:Y:] in libsfml-window-s-d.a(SFWindowController.mm.o)
  ".objc_class_name_NSOpenGLView", referenced from:
      .objc_class_name_SFOpenGLView in libsfml-window-s-d.a(SFOpenGLView.mm.o)
  "_jpeg_stdio_dest", referenced from:
      sf::priv::ImageLoader::WriteJpg(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<unsigned char, std::allocator<unsigned char> > const&, unsigned int, unsigned int)in libsfml-graphics-s-d.a(ImageLoader.cpp.o)
  "_FT_Glyph_To_Bitmap", referenced from:
      sf::Font::LoadGlyph(unsigned int, unsigned int, bool) constin libsfml-graphics-s-d.a(Font.cpp.o)
  "_TransformProcessType", referenced from:
      sf::priv::WindowImplCocoa::SetUpProcessAsApplication()     in libsfml-window-s-d.a(WindowImplCocoa.mm.o)
  "_NSApp", referenced from:
      _NSApp$non_lazy_ptr in libsfml-window-s-d.a(SFWindowController.mm.o)
      _NSApp$non_lazy_ptr in libsfml-window-s-d.a(SFApplication.m.o)
     (maybe you meant: _NSApp$non_lazy_ptr)
  "_FT_Outline_Embolden", referenced from:
      sf::Font::LoadGlyph(unsigned int, unsigned int, bool) constin libsfml-graphics-s-d.a(Font.cpp.o)
  "___glewAttachObjectARB", referenced from:
      ___glewAttachObjectARB$non_lazy_ptr in libsfml-graphics-s-d.a(Shader.cpp.o)
     (maybe you meant: ___glewAttachObjectARB$non_lazy_ptr)
  "_CGWindowLevelForKey", referenced from:
      -[SFWindowController initWithMode:andStyle:] in libsfml-window-s-d.a(SFWindowController.mm.o)
  "___glewUniform4fARB", referenced from:
      ___glewUniform4fARB$non_lazy_ptr in libsfml-graphics-s-d.a(Shader.cpp.o)
     (maybe you meant: ___glewUniform4fARB$non_lazy_ptr)
  ".objc_class_name_NSBitmapImageRep", referenced from:
      literal-pointer@__OBJC@__cls_refs@NSBitmapImageRep in libsfml-window-s-d.a(SFWindowController.mm.o)
  "_objc_msgSend", referenced from:


I have not tried with the dynamic libraries yet, will do that asap.

Edit: There appears to be no problem linking against the dynamic libs, only when I uncheck "BUILD_SHARED_LIBS" in cmake and then compile the examples to I get these errors.[/b]

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SFML 2 for OS X comes true!
« Reply #72 on: January 28, 2011, 10:11:33 pm »
There's no link step when creating static libraries, they are just archives of compiled files. Therefore, none of the external dependencies of SFML is "pre-linked", you need to link them to your final application.

Dyanmic libraries should be preferred, if you can use them. Static libraries are just a way to workaround the lack of shared library management on Windows and the mess it creates.
Laurent Gomila - SFML developer

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
SFML 2 for OS X comes true!
« Reply #73 on: January 29, 2011, 01:02:51 am »
Quote from: "ideal phi"
If you guys haven't got the joystick working for Mac OS X, there is a sample here:
http://homepage3.nifty.com/ysflight/macdev/joystick/e.html


Thank you, I'll have a look but I think I won't use it – I prefer do it myself even I it takes time because I don't want external dependences, but this may be to be discussed if it is very adapted to SFML joystick backend, of course.

PS: Laurent, I see you're always the fastest, great job  :D
I'd like to emphasize this a lot :
Quote
Dyanmic libraries should be preferred, if you can use them.


(On Mac, you can put your app dependencies into your app bundle (the .app folder thus installing your app won't be difficult at all) so use shared/dynamic lib as often as possible. It might even have better overall performances.)
SFML / OS X developer

ideal phi

  • Newbie
  • *
  • Posts: 6
    • View Profile
SFML 2 for OS X comes true!
« Reply #74 on: January 29, 2011, 01:16:40 am »
Quote from: "Hiura"

Thank you, I'll have a look but I think I won't use it – I prefer do it myself even I it takes time because I don't want external dependences, but this may be to be discussed if it is very adapted to SFML joystick backend, of course.


It should be a native example. There aren't any external dependencies outside the norm.

 

anything