New answers tagged sdl
I believe it is as simple as accelerating until you are a square root closer and then decelerating to 0. This is because the final distance is equal to the square of the number you begin to decelerate at. If you begin to slow right after 3 pixels, you will end up at 9 pixels from your starting point. If you stop after 20 pixels, the final result will be 400. ...
Let me put this simply. (Or I will try to) First of all, you should read up on Vectors, find out what these are: Vector Magnitude; Vector X,Y coordinates; Normalised Vector; After this, you should read up a bit on physics, especially Newtons three laws; kinetics; momentum; and collisions. After a week or so you should start to understand these ...
As SDL2 is but a wrapper over the graphics API (OpenGL or DirectX), out-of-view triangles will be culled by the GPU before reaching the rasterizer. As GPU's have hardwired or heavily optimized triangle culling, my guess is that the GPU will be faster than the CPU to do it. But ! The CPU/GPU bandwidth comes into play. The GPU may well be a triangle munching ...
No. SDL_Delay has a granularity of 10ms so it's not suitable for a game loop. It's simple to test: use SDL_GetPerformanceCounter() & SDL_GetPerformanceFrequency() to mesure the time taken by SDL_Delay(1) and you'll see it took 10ms. In general, get used to measuring the effects of your code.
Top 50 recent answers are included