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.

Topics - netrick

Pages: [1] 2 3
DotNet / How to compile SFML.Net under Linux
« on: July 17, 2015, 04:25:38 pm »
I have troubles compiling latest SFML.Net sources under Linux. I have SFML 2.3.1 and CSFML 2.3.1 compilled and installed in my system. They are up and running.

I have newest Mono (4.0.2) and MonoDevelop (5.9.4) installed from official Xamarin repository for Ubuntu.

I opened the .sln file from SFML.Net sources, hit build and instantly got the following error:

Code: [Select]
Error: /home/user/Downloads/SFML.Net-master/src/System/sfml-system.csproj: /home/user/Downloads/SFML.Net-master/src/System/sfml-system.csproj
could not import "$(MSBuildBinPath)\Microsoft.CSharp.targets" (sfml-system)

Any ideas?

General discussions / Missing UDev dependency in tutorial
« on: July 16, 2015, 05:21:31 pm »
In the "Compiling SFML with CMake" tutorial: http://www.sfml-dev.org/tutorials/2.3/compile-with-cmake.php there is a missing dependecy for Linux.

UDev is not listed and on Ubuntu 15.04 it's not installed by default. The actual package name is "libudev-dev".

Without UDev, CMake gives following errors:
(click to show/hide)

DotNet / SFML.Net performance (GC)
« on: July 16, 2015, 04:04:25 pm »
I have a question related to the following issue: https://github.com/SFML/SFML.Net/issues/5.

I see it's still not fixed, so I'm wondering if there are some problems related to performance/stuttering/memory usage using this binding?
I am asking about both Microsoft CLR (Windows) and Mono (Linux).

Thank you

General / Problem with shared libs on Linux [2.3.1]
« on: July 14, 2015, 12:45:19 am »
I downloaded SFML 2.3.1 sources from http://www.sfml-dev.org/files/SFML-2.3.1-sources.zip. I compiled and "make installed" them (using cmake) on freshly installed Ubuntu 15.04 64 bit (which means there had been no SFML libs in the system).

When I want to launch my SFML app I get following error:
Code: [Select]
error while loading shared libraries: libsfml-graphics.so.2.3: cannot open shared object file: No such file or directory

Using ldd ./myapp I get following output related to SFML (standard C++ libs are found)
Code: [Select]
libsfml-graphics.so.2.3 => not found
libsfml-window.so.2.3 => not found
libsfml-system.so.2.3 => not found

Which is a bit strange, because my /usr/local/lib looks like this: http://i.imgur.com/ueD8Bfx.png. And I have some static libs in /usr/local/lib and linker founds them without problems. There are also no problems with headers in /usr/local/include.

I link following libraries: "sfml-network;sfml-audio;sfml-graphics;sfml-window;sfml-system".

Do you have any idea? I remember there was a terminal command related to ld that refreshed shared library cache but I don't remember it. Anyway I think it should be done automatically after reboot, so this probably isn't the problem.

This is very strange as I've been using SFML on Linux for years without any linking problems. Now I installed Ubuntu 15.04 and the problems appeared. Maybe Ubuntu stopped looking in /usr/local/lib for shared libs? Or something is messed up with SFML libs' links in 2.3.1?


Well the magical command which I didn't remeber was "sudo ldconfig". It solved the problem. Altough I am almost sure that ldconfig happens automatically during reboot... I have no idea why reboots didn't trigger it.

Anyway you can delete this thread. Problem is solved and it turned out to be Linux problem, rather than SFML one.

Network / Max number of TCP sockets
« on: August 29, 2014, 01:24:12 pm »
What is maximum number of concurrent TCP sockets using SFML networking on Linux system?

I'm not asking about bandwith/performance thingy, I'm just interested in SFML limitation. Because for example, ENet has hard-coded limit of 4096 concurrent connections. I'm wondering if there is such a limit in SFML.

And the second question, is there a hard-coded limit of maximum sockets that can be put in sf::SocketSelector?


DotNet / Why .chm doc?
« on: August 02, 2013, 12:55:02 pm »
Why SFML.Net uses Windows-specific .chm instead of something crossplatfrom (HTML)? For example on my distro (Lubuntu) there is nothing installed that can open it. I guess that there are some apps for linux that can open .chm, but why bother? As SFML.Net is also aimed at mono, it should provide cross platform doc.

Graphics / sf::View strange behaviour
« on: July 24, 2013, 09:38:35 am »
My windows is 1300x690. When the view is default my "map" renders properly:

Now I want using view place my map at position (400, 0) with size (900 x 690).
So I use:
sf::View view = window.getView();
view.setViewport(sf::FloatRect(400.f/1300.f, 0, 900.f/1300.f, 1));
view.setSize(900, 690);

Now the map rendering position is moved by a few tiles (look there are no green tiles on the left):

Is it something wrong here or it is how view works? If so, how can I use viewport without changing the rendering position of things?

After applying viewport at (400, 0), I want (0, 0) position when rendering be at (400, 0)... It seems quite logic to me. But it is at about (335, 0) or so, I don't understand it really.

Graphics / Vertex array - HUGE memory usage and bad performance
« on: July 23, 2013, 07:27:10 pm »
I use vertex array tile map code from the tutorial. I use exactly the same draw function as in tutorial and the loading is the same algorithm (I only load from a file but the in-app representation is the same as in tutorial).

When my map is 100 x 100 32px tiles I get 1350 FPS and memory usage of my app is 39mb. Great.
When my map is 300 x 300 32px tiles I get 200 FPS and memory usage 59mb. Well acceptable.

However when I draw a map which is 1000 x 1000 32px tiles, memory usage is 300mb and FPS is 19. That's very bad, I need maps of that size in my game.

Debug and release builds change nothing here. Is it a bug in SFML that memory usage and fps are that bad with increasing number of vertexes? It seems like vertexes are stored in some ineffective way (why they take so much of memory?)

Also I think that vertex array should be stored on GPU side rather than on RAM, correct?

Or it has to be that way and vertex array is overrated? In that case I will just use quad tree of vertex arrays but I'd like to avoid it for the sake of simplicity.

It looks like one vertex takes 65 bytes of RAM which is quite a lot. It should be a lightweight object stored on GPU side I think.

Graphics / Seg fault in loadFromFile
« on: July 23, 2013, 01:57:29 pm »
Lubuntu 13.04 64 bit, g++ 4.7, SFML2 from github (very recent build).

#include <SFML/Graphics.hpp>

int main()
sf::Texture tex;
text.loadFromFile("data/");  //CRASH if data folder actually exists
//alternative version:
text.loadFromFile("data"); //CRASH if data folder actually exists

There will be seg fault on loadFromFile when the dir actually exist. When the folder "data" doesn't exist in app's location there is no seg fault. It may be linux-only as well.

Call stack:
0  0x00007ffff78bf66c  stbi_load   
1  0x00007ffff78c33f4  sf::priv::ImageLoader::loadImageFromFile(std::string const&, std::vector<unsigned char, std::allocator<unsigned char> >&, sf::Vector2<unsigned int>&)   
2  0x00007ffff78c8843  sf::Texture::loadFromFile(std::string const&, sf::Rect<int> const&)   

I encountered this bug in following situation: (so it's a bug which may affect some ppl in rare situations)
sf::Texture tex;
std::string textureDir = "data/";
std::string textureName = map.getTextureName(..); // by error in map file, it returned empty string


What I expect in above case is that loadFromFile will return false and I will have an empty texture.
However, it simply crashed.

Remember that it must be existing folder as the function argument. When I set:
textureDir = "muhahadfjs2343434/";

Then there is no crash and expected output in console:
Failed to load image "muhahadfjs2343434/". Reason : Unable to open file

I hope that you will look into it. I can provide more debug info if you want.

Graphics / Vertex array questions
« on: July 23, 2013, 09:31:39 am »
1) Is vertex array RAII object? I mean when I have a vector of vertex arrays and I call "vector.clear()", will there be any memory leaks?


void sf::VertexArray::clear()

Clear the vertex array.

This function removes all the vertices from the array. It doesn't deallocate the corresponding memory, so that adding new vertices after clearing doesn't involve reallocating all the memory.

Does this mean that if I don't add new verticles after clearing vertex arrays there will be memory leak?

Network / Endianness of sf::Packet
« on: July 22, 2013, 09:43:29 pm »
What is the endianness used by sf::Packet? I want to communicate with server written in other language (client is C++ SFML) and I need to know which endianness I must use on the server when receiving and sending data.

C / Cmake doesn't work on Linux
« on: July 20, 2013, 06:38:22 pm »
(I have SFML 2 installed of course.)

When I try to run "cmake ." on CSFML sources I get:

Code: [Select]
CMake Error at src/SFML/CMakeLists.txt:27 (find_package):
  By not providing "FindSFML.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "SFML", but
  CMake did not find one.

  Could not find a package configuration file provided by "SFML" (requested
  version 2.0) with any of the following names:


  Add the installation prefix of "SFML" to CMAKE_PREFIX_PATH or set
  "SFML_DIR" to a directory containing one of the above files.  If "SFML"
  provides a separate development package or SDK, be sure it has been

-- Configuring incomplete, errors occurred!

How can I fix it? I know nothing about configuring Cmake. Also as SFML is installed, why it didn't install the Cmake configuration file?

Java / JSFML using github SFML
« on: July 17, 2013, 08:11:09 pm »
I wonder if it's possible to have JSFML based on current SFML github version? There was one extremely important bug fixed after sfml2 went stable and I'd like to have it in Java as well.

DotNet / No network module?
« on: July 12, 2013, 10:08:24 pm »
Why there is no network module for c#? SFML packets are so useful for networking and generally .net socket classes are a bit low level. Also I'm not aware of crossplatform c# network module which has good open source license.

General / Is it worth to support 1024x768?
« on: June 27, 2013, 08:52:08 pm »
I want my 2d game (non-commercial, so it doesn't have to support everyone's resolution, but I'd like it to be available for as many users as possible) to run normally in window with option for fullscreen (for smaller resolutions or just if you want).

I'm choosing beetwen 1366x768 and 1024x768. The 1366 would make gui in my game much better and overall I prefer that resolution. There are many 1366x768 budget screens/notebooks so such users could just run my game in fullscreen.

Do you think it's "safe" not to support 1024x768 in my game? 3.5% steam users have this resolution so that's not much and my target is gamers, so ppl that have 10 year old pc and use it only to browse net don't bother me.

Yes, I know that I could make my game scalable so I could support everything, but that's a bit of work and I'd like to avoid that.

Pages: [1] 2 3