Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
1 vote
0 answers
93 views

Correctly handling input in case of frame drop

My game loop looks roughly like this: ...
pan's user avatar
  • 111
0 votes
4 answers
3k views

Should I bother with SDL_WaitEvent?

When I wrote my first application in SDL, it looked like this: while (!quit) { SDL_PollEvent(&event); switch (event) { // ... } } But ...
Jack M's user avatar
  • 183
0 votes
0 answers
285 views

How to implement jumping on the left and right?

I am trying to make a platform game in C++ and SDL2. I tried to add a jump in the update() function of the main code below , but it does not work as expected, as you can see in the video: Note: I did ...
The Thinker's user avatar
0 votes
2 answers
273 views

How can I benefit when I don't use gpu?

I am trying to make a 3D game with C++, SDL, and OpenGL. My program roughly looks like this: control function has only CPU operations. draw function has CPU and OpenGL functions operations. I just ...
Emre Kaya's user avatar
  • 555
3 votes
1 answer
2k views

SDL2 mouse motion event keeps occurring

The code I'm using is like so: ...
LASER BEAR ASSAULT UNIT's user avatar
-1 votes
1 answer
241 views

Is my frame rate being calculated correctly?

I'm having a long headache (which may not be that complicated) with this frame rate thing. I already tested several frame rate algorithms, lastly I tested this here and they all gave something strange ...
Dormin's user avatar
  • 34
0 votes
1 answer
2k views

Is there a way how to handle multiple SDL_PollEvent loops without clearing the event queue?

Is there a way how can I handle more SDL_PollEvent while loops for one SDL Event, without taking the events off from the event ...
Pins's user avatar
  • 589
1 vote
1 answer
84 views

How do i get the drawing to loop automatically with out need for user input scrolling?

...
The Ace's user avatar
  • 55
3 votes
2 answers
4k views

Game Loop getting 58-62 FPS. Why not exactly 60FPS? (SDL/C++/OSX)

Here's my game loop: ...
Phildo's user avatar
  • 292
4 votes
1 answer
1k views

How can I separate processing input and update?

I know that game loop is broken up into three distinct phases: processing inputs, update, and render, but I just can't see how I can make processing input and update independent of each other. Let's ...
user74454's user avatar
2 votes
1 answer
4k views

How do I implement a fixed delta time step with a SDL_Delay(15ms) precision

So I am using SDL2.0 for making a Game Engine. Where I am having a problem is using SDL_Delay(). SDL_Delay's minimum delay time is 15ms, I've tried everything, and my FPS is Stuck at 64 because of ...
HgMerk's user avatar
  • 109
2 votes
1 answer
333 views

Input processing performance

I'm building a game using SDL in Linux platform. Now I want to read user input with SDL_GetKeyboardState, but my doubt is wich is the best way using a thread or a ...
Luis Rossell's user avatar
3 votes
3 answers
6k views

Make openGL program only update every 1/60 seconds

I'm learning C++ and openGL and have this program as a result from tutorials and playing around. The problem is that the main loop is running at "full speed", making the program unnecessarily cpu ...
Anonymous Entity's user avatar
7 votes
3 answers
29k views

How can I implement a main menu?

I have been following the tutorials at http://lazyfoo.net/tutorials/SDL/index.php and although they are all very well written and I have learned more than I would have on my own, I am not sure how to ...
Elias's user avatar
  • 173
2 votes
1 answer
1k views

SDL2 focus lost = massive gain in FPS

Whenever I lose focus from my game window, I go from ~60FPS to 6000+, then when the window gains focus again, I go back to around 60 frames per second. And yes, this happens every time I run my game, ...
miguel.martin's user avatar

15 30 50 per page