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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Anonymouseable

Pages: [1]
1
Window / Re: [OSX] Segfault in sf::Window::pollEvent
« on: August 12, 2013, 01:43:30 pm »
UPDATE: Turns out I was corrupting my window... My bad.

[on a side note, GO VALGRIND]

2
Window / [FIXED] Segfault in sf::Window::pollEvent
« on: August 11, 2013, 09:12:34 pm »
Hi,
SFML seems to be having some trouble asking Mac OS for joystick information... I'll just leave you with this stacktrace (the window and event objects are should be valid).
Code: [Select]
#0  0x00007fff8fc90250 in objc_msgSend ()
#1  0x00000001000fce18 in typeinfo for sf::GlResource ()
#2  0x00007fff8f2a4602 in __CFRunLoopModeIsEmpty ()
#3  0x00007fff8f2c8037 in CFRunLoopRunSpecific ()
#4  0x00000001000dd934 in sf::priv::HIDJoystickManager::update (this=0x1000fdeb0) at /Users/linus/Programming/SFML/src/SFML/Window/OSX/HIDJoystickManager.cpp:127
#5  0x00000001000dd8e9 in sf::priv::HIDJoystickManager::getJoystickCount (this=0x1000fdeb0) at /Users/linus/Programming/SFML/src/SFML/Window/OSX/HIDJoystickManager.cpp:58
#6  0x00000001000ddc9e in sf::priv::JoystickImpl::isConnected (index=0) at /Users/linus/Programming/SFML/src/SFML/Window/OSX/JoystickImpl.cpp:87
#7  0x00000001000d046a in sf::priv::JoystickManager::update (this=0x1000fcf48) at /Users/linus/Programming/SFML/src/SFML/Window/JoystickManager.cpp:80
#8  0x00000001000d60c5 in sf::priv::WindowImpl::processJoystickEvents (this=0x1013104d0) at /Users/linus/Programming/SFML/src/SFML/Window/WindowImpl.cpp:148
#9  0x00000001000d5f9e in sf::priv::WindowImpl::popEvent (this=0x1013104d0, event=@0x7fff5fbff988, block=false) at /Users/linus/Programming/SFML/src/SFML/Window/WindowImpl.cpp:105
#10 0x00000001000d537c in sf::Window::pollEvent (this=0x7fff5fbffa90, event=@0x7fff5fbff988) at /Users/linus/Programming/SFML/src/SFML/Window/Window.cpp:186
#11 0x0000000100003f3b in Sim::run (this=0x7fff5fbffa30) at /Users/linus/programming/swarmers-v3/Sim.cpp:65
#12 0x0000000100002ec9 in main () at /Users/linus/programming/swarmers-v3/main.cpp:7

Thanks in advance to anyone who can help me!
I'm also taking a look at the problem but am not expecting to find out much (I'm not in the slightest experienced with Objective-C and the Mac OS APIs).

Notes:
  • SFML from git, on master (currently d077210). Also occurs with SFML 2.0 (sorry, haven't tested it with stock 2.1, but it doesn't seem all that likely that it was fixed in 2.1 only to regress again).
  • OSX 10.8.4

3
General / Re: Tracking a point on a sprite after rotation.
« on: July 18, 2013, 02:13:20 am »
Which one? CurPos?

4
Thanks.  I hadn't seen the libs in the SFML source distro. 

That got me a few steps further.  I was also missing the LIBRARY and INCLUDE variables for the various libraries in the toolchain file.  Now it's failing like so:

Linking CXX shared library ../../../lib/sfml-graphics-2.dll
..
undefined reference to `glewInit'
undefined reference to `_jpeg_std_error'
etc.

I would have thought that there was a script to perform this process already, since the MinGW binary downloads on the website must be produced using a method such as this, using MinGW, on Linux, to create Windows binaries.

Rgds,
ElColmo
No, the builds on the site are probably made using MinGW on Windows. As for finding the libraries, it's possible that your toolchain script doesn't define all the necessary CMake variables. As I said:
Could you upload the toolchain file?

5
General / Re: Architecture from a basic state manager
« on: July 16, 2013, 12:22:20 am »
You can make the handleEvents/update/draw methods private and make the Game be a friend class of StateManager, then have a pointer to the StateManager as a member of the State class.

I think.

Please don't do this without anyone who knows what they're doing confirming what I've said.

6
So basically what you want is a multi-dimensional infinite-size storage/search scheme... Right?

also looks to me like you're trying to clone Dwarf Fortress/Towns/Gnomoria :P

7
The headers are the same between different platforms so no you won't need to download different dev packages.
However you will need to get compatible binary versions of the libraries SFML depends on (freetype, glew, sndfile, openal). The versions included in the extlibs directory should be compatible (I think), but CMake might simply not want to use them because of some variables that are usually defined when compiling for windows but aren't by your toolchain file. Could you upload the toolchain file?

8
General / Re: Linux , how to link static?
« on: July 15, 2013, 11:42:35 pm »
-lsfml-graphics will make ld search the library path (usually /usr/local/lib and /usr/lib and /lib among others) for libsfml-graphics.so (which should be a link to libsfml-graphics.so.2 which in turn should be a link to libsfml-graphics.so.2.0). To use the debug version you'd use -lsfml-graphics-d - so you do have to specify. This is not necessary when using a build system like cmake which will select the libraries necessary depending on the kind of build you've asked it to produce (if you write the CMakeLists.txt correctly.)

9
General / Re: Role of extlibs in build
« on: July 15, 2013, 11:34:28 pm »
There is something we haven't discussed yet.

What about older OS version? I fear that using homebrew to build SFML for older OS version (say, 10.5 since we currently support it) won't be possible.

One other thing: what happen when SFML if build & installed with freetype x.y and then freetype is upgraded to x.z or v.w without rebuilding SFML? That may introduced some incompatibility, or am I wrong?
I'm not sure. We'd have to test it. I need to ask my dad if he has some OS 10.5 installation media, if he does I can test it in a VM.

The other thing: I'm also not sure. I think they should be compatible.

10
General / Re: Role of extlibs in build
« on: July 11, 2013, 12:11:08 am »
Yes, that's what I meant - not supporting frameworks from the homebrew formula at all.

Also my patch that allows choosing not to use the extlibs seems to be generating quite some controversy... *sigh* I guess I'll just include it in the formula.

11
Try adding -ljpeg to the commandline?

12
General / Re: Role of extlibs in build
« on: July 10, 2013, 07:07:44 pm »
So I've finally had some time to look at it (been busy, moving to a different country and whatnot).

Homebrew simply doesn't seem to be framework-friendly enough. The freetype and sndfile formulae both don't support building/installing frameworks. This leaves us with three options (as far as I can tell):
  • Use the extlibs (ugly)
  • Modify freetype and sndfile formulae (probably not a good option because so many other formulae depend on them and I'm not sure everyone really wants them to change)
  • Drop framework support; modify the XCode templates to use dylibs; (this seems the nicest option to me; Any input on this?)
None of these are great, but homebrew simply doesn't have any in-house support or standardisation for frameworks so to me it seems nicer to just leave them out completely.


EDIT: I've done option 3, having added an option in the SFML CMakeLists that allows the user to decide not to use the extlibs. I've put it in a patch which I've included in the formula as well as submitting a pull request for this option at the SFML github repo. I'll wait for some input on the whole thing before making a pull request to homebrew; meanwhile you can check it out on the appropriate branch in my fork of homebrew.

13
General / Re: Role of extlibs in build
« on: July 03, 2013, 12:07:30 am »
For reference, here is some work done to create a Formula for Homebrew with a beginning of discussion: https://github.com/mxcl/homebrew/pull/20765
Yes, that was me (see the similar name? ;) )
Having messed up quite a bit in the pull request and whatnot, I'm starting the formula anew. This is why I actually created this thread.

Currently, I'm not sure how to approach this issue. I'm not experienced enough with Homebrew, I guess. But it would really be nice to make `brew install sfml` possible. :)

In the discussion on github I mentioned, vaguely, the possibility to use a special patch to build SFML from brew. I don't know exactly how the patching system works with brew but I've seen it with vim formula, I think. But here are a (non-exhaustive) list of issues that need to be addressed with such patch:

  • Xcode templates needs sndfile.framework, freetype.framework and SFML frameworks in /Library/Frameworks/. If they are saved in another location, such as /usr/local/somewhere, that's not an issue as long as this location is fixed and can be determined when installing the templates. I can create a patch for the current template to do that quite easily.
  • Xcode templates needs sndfile.framework and freetype.framework. This is because the shell script used by the templates expect frameworks. But a patch can easily be written to use dylibs instead of frameworks.
  • Xcode templates need to be installed in /Library/Developer/Xcode/Templates/. You mentioned that brew won't install anything outside its prefix. This can be worked around with some linking, I think. I've seen some formulae installing application to ~/Applications.
  • Theoretically, custom version of extlibs can be used to compile SFML when configuring properly CMake. I haven't tested it though. But, as eXpl0it3r said, it would be easier to use brew version of these external libs.
  • If SFML is compiled as frameworks, but are not installed in /Library/Frameworks, and cannot be linked there, I can patch the Xcode templates and make sure the compiler will look for them in the right place.
You participated in the discussion on github? Are you mantognini?
So, now for addressing these...

  • I think the best/neatest/correct way to do this would be to have a templated template* where CMake replaces the strings appropriate to generate the working XCode project template. Then we could install the frameworks to an arbitrary location, like /usr/local/Library/ (assuming the default brew prefix, /usr/local).
  • If we do the above that should fix this issue too.
  • That seems like an ugly way of doing it to me - the point isn't that brew cannot install outside its prefix, but should not.
  • Using the brew versions makes the most sense to me, seeing the reason why they were included with SFML in the first place (thanks eXpl0it3r).
  • See 1.

*

14
General / Role of extlibs in build
« on: July 02, 2013, 05:15:26 pm »
Hi,

I've been working on writing a homebrew formula for SFML, and am slightly perplexed as to why/how the extlibs are necessary. Why not install them separately?

Anyway, in this scenario, I see 2 options:
  • Use the extlibs (though to my knowledge homebrew doesn't provide any mechanisms or standards for installing frameworks, which would make this a sub-optimal solution)
  • To specify freetype, sndfile, GLEW and jpeg as dependencies of SFML in the formula. This would mean that if other homebrew formulae depending on these libraries are installed, they wouldn't have to be installed in double. However, it would not install the frameworks for these libraries, and I don't know how that will play along with using SFML in XCode.
Which of these would be preferable, or can anyone propose another alternative?

Thanks in advance.

EDIT:
Quote from: Homebrew website
Homebrew won’t install files outside its prefix, and you can place a Homebrew installation wherever you like.
I can't break this convention if I want the formula to get included in the main Homebrew repository, so seeing as Mac OS doesn't search /usr/local/ for frameworks (right? correct me if I'm wrong) installing frameworks from a homebrew formula isn't really a possibility/desirable functionality.

Pages: [1]