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

Pages: [1] 2 3 ... 5
After some more debugging I found out, that OpenCVs video grabber blocks the process somehow. If I don't initialize the camera, everything works as intended (the TCPListener is not to blame). Thanks for your help :)

If anybody reads my comment from above and looks for a way to do "unblocking I/O" in C++:
You can use the function kbhit() to get a boolean if any character was hit on the keyboard. May come in handy if you need to break an infinite loop without having a window open (no events / keyboard available).

I know about signals and already tried using a custom signal handler. It gets fired and prints a message, but even the following hard exit(1); does not stop the process.

The thread you mentioned did I read before I opened the thread, but I don't really get in which way this will help me with my problem? As I stated in the first post, I already tried using a non-blocking architecture.

Sorry, forgot the important things :D

Windows 8.1
SFML 2.2
Visual Studio 2013
Other used libraries: OpenCV, ArUco (AR marker tracking)

I start the process via the windows console command window.

Hi guys,
I'm using SFMLs network library to send simple data packets to a single client. That part works flawlessly.

When my program starts it initializes and in the end waits for a client using TCPListener.accept() with a blocking socket. When I want to close the program (console application) via CTLR+C "something" happens (e.g. OpenCV closes the connection to the webcam etc.) but the process itself doesn't quit. I have to terminate it via task manager.

If I comment the listening part out the program stops at the end of the main function as planned, so it should be a problem with the blocking socket.

What I tried is setting the socket unblocking and polling every 50ms in a while loop using sf::sleep(). But that also prevents the process to quit completely. I'd be okay using a keypress inside the while to break the loop and let the program run to the end of main, but I don't know how, as there is no window to get any events / key presses and I didn't find a way to do non-blocking console I/O via C++.

Additional information:

Windows 8.1
SFML 2.2
Visual Studio 2013
Other used libraries: OpenCV, ArUco (AR marker tracking)

I start the process via the windows console command window.

General / Re: How to find the Static DLL's?
« on: April 12, 2014, 01:33:24 am »
When you link statically on Windows you link against *.lib (VS) or *.a (MinGW) files. Now while they have the same file ending, it's not the same as the import libraries at all. SFML is helpful in that matter and provides the -s suffix. These static libraries actually contain all the code of the library. During the linking stage, the linker will look for the needed symbols in the static library and when used directly include it into the executable and since everything gets included there's no need for files such as *.dll.

I'd like to highjack the thread and ask a question: Why is the preprocessor flag SFML_STATIC necessary? Like you said, the "The linker is now happy and builds your executable" as long as he knows where to find the right code, may it be directly inside the lib or just linked into a .dll file. What does the preprocessor flag actually do?

Feature requests / Re: Collision detection integration
« on: April 10, 2014, 04:38:49 pm »
SFML is a multimedia library, not a game engine. [...] [/color]

I think its time to change :P
Go go for "SFGL", the simple and fast game library fork *g*

General discussions / Re: Current situation of SFML
« on: January 28, 2014, 10:33:11 am »
I think Nexus will do a great job and hope you're back soon :)

Graphics / Re: Drawing onto a surface
« on: January 18, 2014, 03:01:18 pm »
then just move them all around at once by moving the 'surface'

You should have a look at sf::View :)


General / Re: Mouse button press with mouse left checker is never true
« on: January 17, 2014, 09:00:09 pm »
How do you check if its true?

General / Re: Good SFML Tutorial?
« on: January 16, 2014, 09:01:47 pm »
Maybe what you need is a resource on C++ first? :)

Graphics / Re: non-ASCII characters
« on: January 14, 2014, 07:57:50 pm »
The L is only meant for string literals, not for variables :)
If you read you text from an utf encoded file, there shouldn't be a problem.

General / Re: SFML for ludum dare or game jams?
« on: January 13, 2014, 08:02:35 am »
If you use SFML and its standard C++ bindings, its very easy to port it to all platforms. Of you are using C# its gonna be much harder, because C# and .NET is meant for Windows and you need additional runtime libraries like mono etc.

Graphics / Re: Overriding draw() in sf::Drawable.
« on: January 11, 2014, 10:55:33 pm »
Didn't he just do that?

Graphics / Re: Font effects
« on: January 11, 2014, 10:53:58 pm »
There is no easy method for special effects like that, but you can fake some of them pretty easily:

Shadow: Render your text twice, once normal, once dark with a slight offset (render the normal text above the "shadow" text)

Border: Similar, but this time the "border" text that lies behind the normal text has to be a bit bigger (and also needs an offset to the top left corner)

Glow is a little "harder", but can be achived in a similar way. Just render the text twice and use a shader to blur the underlying text :)

Graphics / Re: Bitmap Font
« on: January 11, 2014, 10:49:44 pm »
Maybe I don't understand what you want to do, but whats wrong with the "simple" font system SFML provides? You can use it to load and render you own fonts. (eg. from http://www.dafont.com/bitmap.php)

A nice wrapper for this is the following RichText "Plugin":

Pages: [1] 2 3 ... 5