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 - Jesper Juhl

Pages: 1 2 [3] 4 5 ... 94
31
There are seseveral problems with your solution.

- your vector holding textures is problematic since if the vector copies sprites when it needs to grow you'll invalidate any pointers held by sprites to elements in the vector. You can mitigate that either by holding pointers (or better yet, smart pointers) to textures in your vector or by making sure the vector never resizes by calling .reserve() on ot before you push_back the textures and then never push more into it than you reserve.

- don't use srand()/rand() they produce really poor random numbers and time(NULL) is a horrible seed. Use the facilities in the <tt>random</tt> header instead. See these two links:
 http://en.cppreference.com/w/cpp/numeric/random
 https://channel9.msdn.com/Events/GoingNative/2013/rand-Considered-Harmful

- setting textures on all sprites every frame is inefficient and needless.

32
General / Re: Black Screen [iOS] [SOLVED]
« on: May 05, 2016, 04:18:33 pm »
Good to hear you got it working :-)

33
General / Re: Black Screen [iOS]
« on: May 04, 2016, 08:15:39 pm »
I don't know if it's what's causing your problem. But; 1) your program draws two frames and doesn't clear the screen between them - you should clear/draw/display for every frame. 2) your program exits very quickly (after drawing just two frames) - what does iOS do then? I don't know, but reverting to a black screen doesn't sound unreasonable.

34
General / Re: App not running in Xcode
« on: April 24, 2016, 09:16:30 pm »
Why do you clear everything before you display?
The logical order is; clear, draw, display.

35
General / Re: linking issue : Undefined Reference to `_Unwind_Resume'
« on: April 24, 2016, 06:56:47 pm »
Another option that always works is to simply compile SFML yourself, using your chosen compiler. Then it's guaranteed to be compatible with the executables you produce.

36
SFML projects / Re: Screenshot Thread
« on: April 20, 2016, 10:19:47 pm »
Nice. I liked it :-)

37
Graphics / Re: [SFML2.0][sf::text] OpenGL internal call fail
« on: April 19, 2016, 11:32:04 pm »
How about you answer eXpl0it3r's question?

"Can you run the example binaries that come with the SFML SDK on your machine?"

38
General / Re: Unstable fps
« on: April 16, 2016, 12:56:59 pm »
If your code is not able to achieve 60fps on your hardware or contains issues that cause some frames to occasionally take a significantly longer time than other frames. Then neither vsync nor SFML will be able to keep your FPS at 60 nor keep it stable/smooth.

39
Graphics / Re: Highlight sprite when selected
« on: April 13, 2016, 08:00:07 am »
A simple way would be to just have two images. One with the normal sprite and one with a highlight, then just draw the right one dependin on whether or not it is selected.

Another option would be to use a shader.

40
Graphics / Re: how do I create copies of sprite or shapes?
« on: April 11, 2016, 06:56:03 pm »
There are lots of examples in the wiki and tutorial:

https://github.com/SFML/SFML/wiki

http://www.sfml-dev.org/tutorials/2.3/

41
General / Re: Problem locking framerate
« on: April 11, 2016, 03:10:52 pm »
Why don't you use setFramerateLimit()?

42
General / Re: SFML version to use?
« on: April 09, 2016, 12:40:37 am »
Just download the latest version and compile it yourself.

43
Graphics / Re: Check collision with vector of shapes
« on: April 07, 2016, 04:27:57 pm »
You could also just use something like std::find_if with a lambda.
Or if you just need to know if there is a collision but don't care about the colliding element, then there is std::any_of.

44
General / Re: Distribute linux binary using SFML
« on: April 03, 2016, 09:15:36 pm »
Running ldd -v on a file will list its dependencies.

45
General / Re: SFML for Dev C++?
« on: April 03, 2016, 05:54:34 pm »
Just compile SFML yourself. It's simple and there's even a tutorial for it: http://www.sfml-dev.org/tutorials/2.3/compile-with-cmake.php - it'll take you 5-10min tops.

Pages: 1 2 [3] 4 5 ... 94