Comments (5)
Hey, Typically "throttling" would be down to the user - there are several ways to achieve it, the simplest being just calling "this_thread::sleep_for(20ms)" would lock it to 50fps - however, that also locks up user input and everything else.
from javidx9.
I had guessed that throttling could be an option in CGE. Thanks for the response.
I think I'll work on throttling, once I can set up Netbeans to compile the header.
Should I close this issue, or keep it open for further discussions on throttling?
from javidx9.
from javidx9.
Just chiming in here with an observation: I often keep an eye on the CPU usage graph in Visual Studio debug mode in @OneLoneCoder 's videos when he runs the code and I never really see it spike or run the CPU really hot.
@OneLoneCoder brilliant channel, thanks for the great videos and insight.
from javidx9.
Hi,
I have used the SDL_Delay function to slow down the updates and it worked very well (for example delaying by 10 or 20 milliseconds as suggested by @OneLoneCoder ). Something that I did not manage to achieve is to decide on a constant update period (say 0.02 sec) and use the (0.02-fElapsedTime) * 1000 as an argument to SDL_Delay. Somehow this does not work. I suspect there could be a problem with the granularity of those delay functions that are usually around 10 or 20 ms.
I also want to mention, that this issue can go beyond the CPU getting hot. On one desktop with 8 i7 cores, the examples run fine, although they take ~100% of one of the cores and have a FPS of 1800. However, on an intel nuc, with 4 i5 cores, the examples lock the computer's graphical interface completely (at around 5-600 FPS). I have been running the SDL version on Ubuntu 18.04, but I suspect this could happen on not that powerful windows machines as well. The only way to kill the process was to enter a text based login because the graphical interface was completely unresponsive.
Great job by the way.
from javidx9.
Related Issues (20)
- Easier to use SetConsoleScreenBufferInfoEx
- olcConsoleGameEngine.h does not display correctly HOT 3
- olcCosoleEngine doesn't work with linux HOT 7
- Non-circular Spline - looks strange or I don't get it :)
- ERROR: SCREEN Height / Font Height Too Big
- olcConsoleGameEngine.h - ERROR: Screen Height / Font Height Too Big
- Unhandled exception thrown: write access violation. this->m_bufScreen was 0x1110112. HOT 2
- Video
- Should reset dw1_step to zero here too.
- OneLoneCoder_olcEngine3D_Part3.cpp line 330 can be deleted
- 3D Graphics Engine Part #3. Clip against the frustum
- onUserSoundSample bug at 127 seconds after start HOT 2
- Not an issue but a request. Hidden line removal
- Small bug with Perlin-like noise generator HOT 1
- 3d console game engine does not display properly in Windows Terminal HOT 3
- Out of bounds? HOT 1
- Missing assets from multiple videos HOT 1
- Shame on David for boasting about his stupidity. HOT 3
- RPG_Main.cpp(55,24): error C2440: '=': cannot convert from 'OneLoneCoder_RPG *' to 'RPG_Engine *' HOT 2
- DDA vMapCheck truncation only works in positive axis
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from javidx9.