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

Pages: 1 [2] 3 4 ... 9
16
General / Re: How to handle dead characters in game?
« on: April 28, 2014, 12:54:30 pm »
The way I do it: store all enemies in a container and delete it from the container as soon as it is dead. This dereferences the object as zsbzsb mentions.

17
General / Re: Flickering
« on: April 25, 2014, 03:49:09 am »
The Box2D tutorial states:
Quote
We also don't like the time step to change much. A variable time step produces variable results, which makes it difficult to debug. So don't tie the time step to your frame rate (unless you really, really have to).
Which makes sense for a physics engine.

18
Graphics / Re: Strange behavior when I draw a chequered design
« on: April 23, 2014, 01:19:03 pm »
Minimal and complete example, right from the forum rules.

19
General / Re: CMake doesn't work for VS 2013
« on: April 23, 2014, 01:15:00 pm »
I might have missed it, but have you installed a 32 or 64-bit of Visual Studios? Regardless of your system, you should choose the 32-bit version.

20
I followed a link to the 1.6 tutorials from a separate website.
Why are you using SFML 1.6 and not 2.0/2.1? The official tutorials for all of them are located here.

21
General / Re: SFML VS13 Entry Point Not Found
« on: April 18, 2014, 03:22:38 pm »
Can you post the error message? This is normally shown in the output window.

22
Window / Re: Events outside loop
« on: April 18, 2014, 03:11:17 pm »
Ok, thanks for the explanation :)

23
Window / Re: Events outside loop
« on: April 17, 2014, 05:42:46 pm »
But the CPU and GPU work asynchronous, so why would the CPU wait if it only needs to add a command to the GPU's queue? Or does calling display() imply you want it to display immediately rather than when it's finished?



To answer the question from the OP. No, it isn't abnormal to have a nested while loop. A typical loop would look like
while (window.isOpen()) {
    sf::Event ev;
    while (window.pollEvent(ev)) {
        // process events
    }
}

And a couple of remarks:
  • Try to avoid using global variables and #defines.
  • Don't mix real-time input and events: sf::Keyboard::isKeyPressed(...) is real-time. This returns true if the key is pressed at that exact moment. event.key.code == sf::Keyboard::... returns true at least once inside the event loop if the key was pressed since the previous event loop.

24
Window / Re: Events outside loop
« on: April 17, 2014, 05:18:44 pm »
Calling display() later leaves the opportunity for the CPU to do something useful (like updating the game logic) while the GPU is busy, instead of blocking the application.
Isn't it entirely the GPU's task to display? Why should the CPU wait for the GPU when calling display()?

25
Also, please use code tags for readability :)
Code: [Select]
[code] or [code=cpp]

26
General / Re: SFML VS13 Entry Point Not Found
« on: April 17, 2014, 04:13:40 pm »
Indeed, notice that in MSVCRP110D.dll you can recognize MSVC11 which is Microsoft Visual C++ 2012. So as zsbzsb mentions, you probably have libraries for 2012(=11) instead of 2013(=12).

27
Graphics / Re: Not your standard move mechanics
« on: April 17, 2014, 12:51:33 am »
If you do want to understand it you can use the rotation matrix. You just have to know matrix calculations :)
The derivation to get to the rotation matrix is pretty straightforward when looking at a rotation of a (1,0) and (0,1) vector

28
General / Re: Can't compile test project
« on: April 12, 2014, 02:53:38 pm »
It's better to take the time to try and learn those things. It will save you much frustration later on.
And it doesn't even cost a lot of time either.

29
General / Re: Snake game - block positions
« on: April 06, 2014, 01:08:19 pm »
Also this, if you wan't more detailed information about the different container of STL.

30
General / Re: Why degrees?
« on: April 03, 2014, 01:09:55 pm »
You can also open the subforum list at the bottom of the search page and select only a few subforums, thus preventing errors.
I meant this error. I get it quite frequently when wanting to search.


Thanks for the tip :)

Pages: 1 [2] 3 4 ... 9
anything