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 - Ancurio

Pages: [1] 2 3 ... 5
1
Graphics / Re: Out of Bounds World automatically NOT drawn?
« on: December 29, 2013, 04:47:02 pm »
Note that your graphics card typically processes all vertices, and then only emits fragments for visible portions (ie. a fragment shader would not run for occluded pixels). Your main bottleneck might therefore rather be in the large amount of data (the entire tilemap's worth of vertices) that is transferred each frame.

2
Graphics / Re: small breaks
« on: October 21, 2013, 10:39:45 pm »
Try turning on VSync:

Code: [Select]
window.setVerticalSyncEnabled(true);

3
But since SFML has no install script, and can be "installed" (= copied) anywhere, it wouldn't be safe anyway even if those files contained standard paths.

What install script would you need if you can just
make install
?

But you mentioned that you have a special setup of packaging etc., so if that would get messed up I'll accept your decision to leave things as they are.

4
I contacted him, here's an excerpt:

Quote
I've skimmed the forum thread: my opinion is that if the pkg-config
templates are being filled in with CMake build paths instead of
install paths then that's a bug and should be fixed. However, looking
at the current pkg-config template files on github, the variable they
look for is @CMAKE_INSTALL_PREFIX@, which should be the right thing
(it's basically equivalent to the --prefix variable you would pass to
./configure in an autotools build system). I would install the
pkg-config files by default, too, but for that you'll have to convince
the SFML maintainer(s).

Basically, what I said already.

5
If I remember correctly, the pkgconfig files will contain the path to the CMake build folder, not to the final install folder. As I said I'm not the one who implemented this feature, and I have no time to invest on it. But feel free to send a patch if you feel like it could be improved ;)

That's not how it works. The pkg-config files point to the libraries and headers where they would end up installed . If i was to send a patch, all it would do is remove the need to specifically enable them. I think I'll track down the guy that implemented them in the first place and ask his opinion on the matter.

Edit: You can look at the .pc.in file yourself, it uses @CMAKE_INSTALL_PREFIX@ so there's no way local build paths would sneak in anywhere.

6
Quote
I was saying "why are the pkgconfig files not installed by default when building from source"
The default set of options are (and must remain) what's used to create the official SFML packages, ready to be distributed. SFML packages containing local paths in pkgconfig files were distributed by mistake before (SFML 2.0), and it would have happened again if I didn't switch this option off by default.

I still don't understand... if you set the install path to something user specific under $HOME (I have no idea why anyone would want to do something insane like that), then the libraries in the package would be installed to this local path too. Ie., you can't install the pkg-config files into an non-sane path without screwing up the libraries as well.

I don't know where the official packages put the libraries, but it will probably be something like /usr/lib or /usr/lib64, hence the pkg-config files will always go into /usr/lib/pkgconfig or /usr/lib64/pkgconfig.

7
General / Re: Loading from this tileset
« on: October 13, 2013, 08:06:21 pm »
@Ancurio

This maybe irritating to you but I couldn't still understand what you just said. :(

I just looked into your original question again, and it seems all you want to do is animate a character sprite using a tileset that also holds tiles for composing the surrounding level/background.

In that case, thinking in terms of a tilemap is the wrong approach. All you want to do is create an sf::Sprite with the tileset sf::Texture attached to it, and then select the tile you want the sprite to display with ::setTextureRect(), feeding it the rectangle corresponding to the mario tiles. To animate, you'd simply call ::setTextureRect() again with the next animation tile and so on. Does that make sense?

8
Then you can use cmake -i.
Oh that looks pretty convenient, thanks!

I mean that if I distribute the pkconfig files that are generated by the CMake build, they will link to /home/laurent/sfml. Definitely not something you have on your own PC ;)

The pkgconfig files are ok only if you build & install SFML yourself.
Hm? I think we're having a misunderstanding. I was saying "why are the pkgconfig files not installed by default when building from source". The precompiled packages in Linux distro repositories (at least on Fedora, I'm pretty sure also on Debian based) always provide the pkg-config files already anyway, so it's really only people building from source that don't automatically get them.

9
Quote
Sometimes I wish cmake had something as convenient as ./configure --help .....
CMake has a complete manual page that explains everything.
That's not what I meant. I meant the part of "./configure --help" that will list you all configure time options, such as which parts of the library to enable, if static or shared, etc. All those options that aren't inherent in cmake, but which are defined by projects themselves.

Quote
Also, why aren't they generated/installed by default on Linux?? In two years I have never come across a library that doesn't automatically install those.
They are generated with local paths, so they can't be distributed.

Hm, not really sure what you mean by that.
Edit: What I'm saying is, libraries are installed with local paths just like the .pc files, this is completely normal on Linux.

10
General / Re: Loading from this tileset
« on: October 13, 2013, 02:52:15 pm »
I know this is a vague question but still I am asking it : how exactly is tilemap handling done in SFML and C++ using Tiled!

Can anyone please explain briefly to me the exact methods and algorithms used for loading and displaying tilemaps?

Thanks

For starters, you could just open a .tmx file and take a look yourself: Tiled saves maps as xml encoded strings of tile IDs (most commonly in cvs[comma separated values] form), where I believe 0 corresponds to "no tile" and from thereon tile ID 1 is the most top left tile in the tileset. The IDs cound up like you would read text, ie.

1, 2, 3, 4, 5, 6
7, 8, 9, 10, 11, 12 [etc]

so to map an ID to a tile, you have to do something like
Code: [Select]
int _id = id-1;
int tileX = (_id % mapWidth)*tileWidth; // 'mapWidth' in tiles, 'tileWidth/Height' in pixels
int tileY = (_id / mapWidth)*tileHeight;
and that's your pixel coordinates into the tileset.

Also note that Tiled supports multiple layers drawn on top of each other, so you will want to parse each layer separately.

11
Sorry for the premature thread, after more googling and experimenting, I finally found out how to do it:

Code: [Select]
cmake -DSFML_INSTALL_PKGCONFIG_FILES=true ..
Sometimes I wish cmake had something as convenient as ./configure --help .....

12
General / Re: Lethn's Programming Questions Thread
« on: October 13, 2013, 02:35:13 pm »
Well the C++ primer book I was recommended on this thread is very good but it's so frustrating to read, I think I'm just going to have to devote some proper time studying it bit by bit :S, I've gotten through a chunk of it but I'm only about two chapters in.

If you want to create games, but aren't interested in (or even repulsed by) programming, you could just use something like GameMaker.

13
General / Re: how do I make cmake configure/install the pkg-config files?
« on: October 13, 2013, 02:21:07 pm »
I can't help directly but since I'm sure it'll come up: What version of the SFML sources are you using?  From what I saw on Ubuntu the Linux packages for SFML are so out of date it's not even funny.

git head.

14
I apologize if this has been posted before. Being a cmake noob, I tried everything I could think of:

Code: [Select]
cmake INSTALL_PKGCONFIG_FILES ..
cmake SFML_INSTALL_PKGCONFIG_FILES ..
cmake BUILD_SHARED_LIBS:bool=true INSTALL_PKGCONFIG_FILES:bool=true ..
cmake BUILD_SHARED_LIBS:bool=true SFML_INSTALL_PKGCONFIG_FILES:bool=true ..

Frustrated, I just gave up and moved the pkg-config generating code out of the conditional clauses in CMakeLists.txt (and voila, I got my .pc files), but since I'm helping someone else install these I'd still like to know, how do you properly tell cmake to generate the pkg-config files?

Also, why aren't they generated/installed by default on Linux?? In two years I have never come across a library that doesn't automatically install those.

15
Graphics / Re: If object position is out of vissible screen, is it drawn?
« on: September 03, 2013, 05:52:29 pm »
Modern GPUs have optimized codepaths/hardware for culling invisible objects. However, if you pre-cull on CPU side, you'll save yourself the (probably small) bandwidth overhead of sending the vertex data to the GPU every frame.

Pages: [1] 2 3 ... 5
anything