Free Download Gameloop For Windows 7

0 views
Skip to first unread message

Elly Garnand

unread,
Aug 3, 2024, 3:57:50 PM8/3/24
to nucmoreme

I have seen different "basic" game loops both from books like "Introduction to 3D game programming with DX11" or online tutorial ( Rastertek ) and if we take off all the fancy stuff to control framerate and more they all look roughly like this :

If you run it this way it works perfectly, but the thing that i do not understand is the else.If i look naively at the loop i might think that if the system keeps sending events ( key presses, mouse clicks and more ) the else part will never be executed, am i wrong ? ( yes!! i am but this is exactly the point, i don't understand why! ).

I'd like to understand why the loop works this way. If the messages were strictly related to the window ( resizing,moving,closing ) i'd understand it, but they are not. Let's say that i keep pressing any key a WM_KEYDOWN message is repeatedly sent and a message is peeked, thus never allowing the else part to execute

I've not searched the documentation for this but Windows is probably not spamming messages all the time: they have to come at regular intervals or they'd be clobbering the system. Maybe they use the keyboard refresh rate if you keep pressing one key. Maybe they use the screen refresh rate.

Let's say a new message comes every t ms, reasonably greater than epsilon. The [A] part of the loop will process all stacked messages very quickly: it will run for epsilon ms and start again, which leaves no chance for new messages to arrive. As soon as all messages are consumed, the [B] part will run and new messages will stack again.

Here you can see that as long the duration of [A] stays reasonably small compared to the message rate (it's already very exaggerated here), the game will still have plenty of time to update its frames.

So this explains why such a game loop structure doesn't prevent a game to run normally. But the solution CoderScott proposed in his answer makes this execution flow much more explicit, so in my opinion it should be preferred.

No, you are not wrong. Actually that's true - if there are too many events the else will never be run, or at least will not be run quickly enough. If your UI methods take too much time to process the event this could lock the OpenGL refresh. First of all you should check why processing events is taking that much processing, but in sometimes you can be spammed by events (like quick mouse move with big refresh rates) and then even simple processing takes too much time to be in line with OpenGL frame refresh timings.

if/else in your loop will process windows messages before anything. It will not block loop too long (of course if your WndProc will be good). Usually there is not so much messages. I dont think there is a better way to prevent window from stop responding and save FPS. If you will keep your message processing code good i think your loop will be great.

Here is my code, i believe it will be interesting for you, and it is quite usable. But one day i will code a new one. At least it is much better than many other. For playable game you will definitely need a stable state update() rate. Windows messages will not break it.

I am working on an OpenGL Shader Engine from www.MarekKnows.com and the framework is setup as follows: An Engine Class that is part of a static library with other helpful and important classes. Then there is the main startup project where the Game Class resides along with Game Properties. This structure is to keep all Engine code separate from Game code. The nice thing about this setup is it can be reused to create a variety of games just by inheriting from the Engine lib. It is not complete as of yet as each week another segment or class object is being incorporated.

If you would like to see more of this code then you will have to visit www.MarekKnows.com for his wonderfully well structured and clearly explained video tutorials for Game Development using OpenGL. For copy right reasons I will only give small snippets as suggestions to others that may help them with a specific case problem. I can not claim this as my own source code, however with following his course setup everything is personally hand typed and personally debugged. There is no copying and pasting! Almost everything I have learned about Game Programming is accredited to Marek's videos along with a few other sources.

I can try to explain this the best I can from what I have learned and following the code's execution. Somewhere in the program the Engine::start() function is invoked. The first thing that happens is we go into an infinite while loop;within this while loop we check to see if any messages from windows were peeked and if they are we check to see if the WM_QUIT message was set from some other place. If it was set we break out of the while loop and return from this function and the application will clean up memory, destroy window and close; otherwise we then call TranslateMessage() & DispatchMessage(). If the PeekMessage() returns false then we go into the else statement and call proccessFrame().

On my machine I am rending basic GUI objects at about 100-120 frames per second with this framework. I have an EVGA NVidia GeForce GTX 750Ti 2GB with overclocking and dual fan coolant running on Windows 7 64bit with 8GB Ram on an Intel Core 2 Quad Extreme 3.0Ghz.

We have not yet delved into extensive animations, physics, particles systems, collision detections as of yet. We did however cover all of that in one of his older video series were the older GameEngine was based on OpenGL v1.0 and everything was done on the CPU. With this series we are now working on using Shaders & the GPU. I am sure with this frame work we can have a full 2D or 3D game running on a system similar to mine at a full 40 - 60 FPS with ease.

Another great source for learning is to check out www.GeometricTools.com and check out the book section. A few years ago I purchased their book: 3D Game Engine Design (2nd Edition) by David H. Eberly, The Morgan Kaufmann Series in Interactive 3D Technology, and it is a great read. I have not yet had the chance to purchase their newest book: GPGPU Programming for Games and Scienceby David H. Eberly, but would soon like to own it since it is more relevant, current and up to date with modern hardware & software development. Good luck to you!

So today I tried to emulate a game on gameloop however it said I have hyper v installed and its incompatible, I was confused because I have windows 11 home version therefore it should not have hyper V. I checked task manager virtualization was on I opened BIOS and it had no hyper V settings. so I ran systeminfo on cmds and it says "a hypervisor has been detected. Features required for Hyper - V will not be displayed. whenever I tried to remove it using power shell it would say that it doesn't recognize the feature ( meaning it somehow doesnt exist ) even though my system says it does and so does gameloop, I have tried looking troubleshooting this for hours updated my windows version installed Restoro to no avail. if anyone can help I would appreciate it

If you decide at a later time to use virtualization, just reverse these steps. If you need to switch frequently, export all the Hyper-V keys in each state(e.g., HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HvHost) , auto and disabled, and combine into two .reg files, one to enable Hyper-V, the other to disable.

I believe most W11 home computers now default to a mode called 's-mode' if your computer is running s-mode, there are many default security features enabled by default - one of them is virtualization of the kernel for the purposes of memory integrity. Memory integrity is a great security feature, but it also decreases performance of the RAM.

I've tried to install Gameloop app (an android emulator) on my surface pro 7 ,but there are several errors popping up as soon as i start the installation,and most of them are ".dll" related.i've tried to download the required dll files manually,but it does not work.
I've installed bluestacks(another android emulator) though,and it runs perfectly on my device,butdue to some lag problems i need to install the gameloop.
tnx for your support

Haven't received your message a few days, was your issue resolved?If not, please reply and tell us what's going on to provide further assistance.
If the reply is helpful, please accept it as answer to help other community members quickly find useful responses.

If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

Gameloop is built For High performance gaming on pc. There are two versions of tencent gaming buddy + gameloop beta 7.1. you need to install beta it's for windows version.
Gameloop Gobal
Gameloop beta 7.1

This is a PSA to Ally owners who want to boost the performance of their Ally (who doesn't?). From my testing, turning off Windows 11's Memory Integrity/Core Isolation gave me up to 10 FPS more in games like Forza Horizon 5 and Cyberpunk.

Microsoft itself recommends turning these features off to optimize gaming performance. Follow this guide from Microsoft on how to do it: -us/windows/options-to-optimize-gaming-performance-in-windows-11-a25...

It doesn't have any negative affects that you will notice. Core Isolation is a security feature that makes your device more secure, but it matters more on personal PCs than on a handheld dedicated to gaming.

c80f0f1006
Reply all
Reply to author
Forward
0 new messages