SFML community forums

Help => Window => Topic started by: waxx on January 22, 2013, 10:06:03 pm

Title: How to get offset of a View? (conversion from world position to window position)
Post by: waxx on January 22, 2013, 10:06:03 pm
Tried convertCoords but it works the other way around I need. My version is 2.0.
Title: Re: How to get offset of a View? (conversion from world position to window position)
Post by: Foaly on January 22, 2013, 10:22:49 pm
What version of sfml 2 are you using exactly? The rc or a self compiled version? If you using the rc you should compile sfml yourself (or use one of the unofficial nightly builds) because the function you want has only been added recently. See here: https://github.com/SFML/SFML/commit/6ce6014dd8517ee3012c0b969484f6bc258e65ef
Title: Re: How to get offset of a View? (conversion from world position to window position)
Post by: eXpl0it3r on January 22, 2013, 10:27:55 pm
My version is 2.0.
Use the latest version fomr GitHub, which implements mapPixelToCoords. ;)
Title: Re: How to get offset of a View? (conversion from world position to window position)
Post by: waxx on January 22, 2013, 10:29:50 pm
Can't seem to find a project for VC to build and compile this version (or maybe I'm missing, not a fan of git/svn and things like that). What do?
Title: Re: How to get offset of a View? (conversion from world position to window position)
Post by: Foaly on January 22, 2013, 10:32:15 pm
If you don't want to compile SFML from source yourself, you can use the Unofficial nightlies (http://en.sfml-dev.org/forums/index.php?topic=9513.0) provieded by exploit3r.
Title: Re: How to get offset of a View? (conversion from world position to window position)
Post by: eXpl0it3r on January 22, 2013, 10:37:24 pm
Can't seem to find a project for VC to build and compile this version.
SFML uses a 'meta build system'. You don't directly get project/make files, but you get CMake files, which then generate any supported project/make file you'd ever want.
So you could generate VS project files on Windows and makefiles on Linux and the maintainer of the source code, doesn't have to provide any of them and 'just' write a CMake script. ;)

(not a fan of git/svn and things like that). What do?
If you want to keep going in the programming section, you'll sooner rather than later have to get familiar with it. It's not only the best way to distribute code, but it's also the best way to keep track of code changes and work in teams. ;)
Title: Re: How to get offset of a View? (conversion from world position to window position)
Post by: waxx on January 22, 2013, 10:44:09 pm
Did the SFML_STATIC flag change or something? Without it I'm getting tons of linker errors as usual, but with it I'm getting them as well as fatal error LNK1169: one or more multiply defined symbols found (not sure if it is about this preprocessor call).

@SVN
For me it's way too bothersome, or at least for now when I'm working alone and I prefer to work alone.
Title: Re: How to get offset of a View? (conversion from world position to window position)
Post by: eXpl0it3r on January 22, 2013, 10:48:02 pm
Well you need to give use some more information...
What version did you now get?
How are you setting things? Are you sure you don't use the old versions somehow?
Did you make a clean rebuild?
Which version of VC are you using?
etc. :D
Title: Re: How to get offset of a View? (conversion from world position to window position)
Post by: waxx on January 22, 2013, 10:52:49 pm
okay, that was silly thing by me, I quickly opened static-std folder just because I saw "static".

Works like a charm now, thanks guys.