Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
1 answer
399 views

Simulated light for a 2D tile-map with just SDL2?

I'm working on a 2D tile-map RPG with C++17 and SDL2 + SDL_Image. There are daily cycles, weekly cycles and seasons. Even a kind of weather engine provides atmosphere. The moods and times of day are ...
El_Codepone's user avatar
0 votes
1 answer
212 views

Key presses and game quit sometimes delayed by seconds

U'm currently trying to develop a 2D RPG similar to early Final Fantasy titles for the NES. Up until now I've been reading C++ tutorials on SDL2 and doing my best to convert the concepts into OCaml. ...
Nameless King's user avatar
0 votes
2 answers
301 views

Why does the triangle rendered by OpenGL ES 2.0 , with SDL 2.0 context, vanishes after a single render, if events are not polled?

I was experimenting with OpenGL ES 2.0 and being new to OpenGL, I was trying to render a simple triangle. But I was shocked to see that, if I do not call ...
Aravind A's user avatar
  • 103
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
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
243 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
0 votes
2 answers
393 views

Do I still need limit FPS when I have a variable timestep?

Lets say I have a simple game loop (variable timestep - but it applies also for other timesteps): ...
Pins's user avatar
  • 589
1 vote
1 answer
87 views

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

...
The Ace's user avatar
  • 55
0 votes
2 answers
636 views

Prevent rendering queue from overflowing when using Vsync

My game loop currently looks something like this: ...
strNOcat's user avatar
  • 119
11 votes
3 answers
7k views

UPS and FPS - What should I limit and why?

I'm currently writing a game using C++ and SDL2 and there's one thing that I'm wondering about - does it make sense to limit my frames per second (FPS) and/or my updates per second (UPS)? I get the ...
DocCoock's user avatar
  • 113