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

Pages: [1]
1
General discussions / Re: RenderWindow object breaks srand
« on: April 09, 2017, 04:10:40 pm »
Which version of SFML are you running? There's no call to "srand()" in SFML's source.

Edit:
Also, what happens if you create a second sf::RenderWindow and run the loop again (without calling srand() a second time)?

(click to show/hide)

out:
(click to show/hide)

2
General discussions / Re: RenderWindow object breaks srand
« on: April 09, 2017, 04:06:19 pm »
It really strange
see :

code:
(click to show/hide)

out:
(click to show/hide)

like
RenderWindow app(vdm, "Game!");
reinitializes srand()

3
General discussions / Re: RenderWindow object breaks srand
« on: April 09, 2017, 04:01:25 pm »
I tried the latest stable version
code:
(click to show/hide)
out:
(click to show/hide)

the same problem
putting srand() after RenderWindow app(vdm, "Game!"); repairs for me.

It can be bag?

$ uname -a
Linux dunaev-desktop 4.4.0-71-generic #92-Ubuntu SMP Fri Mar 24 12:59:01 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
 
What else about the system to provide?

4
General discussions / Re: RenderWindow object breaks srand
« on: April 09, 2017, 03:46:47 pm »
As for me, it looks like RenderWindow object initializes srand with one const number

5
General discussions / Re: RenderWindow object breaks srand
« on: April 09, 2017, 02:41:13 pm »
see screenshot
srand out of loop before RenderWindow initialise
it only once, at the start of main()
If i will put srand after RenderWindow creation, everything OK.

6
General discussions / RenderWindow object breaks srand
« on: April 08, 2017, 08:01:54 pm »
When
srand((unsigned)time(NULL));
called before RenderWindow class object creation, rand() return same value, like srand() initialize by const var.
If i will put srand after RenderWindow creation, everything OK.
see attached screenshot

I'm confused that the example "examples/pong/Pong.cpp" uses a similar code:
https://github.com/SFML/SFML/blob/fae3b65f0567f87fa9925cd42d28df15eb69e79c/examples/pong/Pong.cpp
srand before RenderWindow

P.S. sorry for my English, it's my second language.

code and compile parameters:
(click to show/hide)

Pages: [1]