Game loop
-
Hi all, I'm writing a game application with a main lobby where players can select a game which opens in a different frame window. Players can open several games at a time so actually there's only one view that needs to be rendered at a time. The game loop should respond to key and mouse events using directInput (directX). My question is where do i place the game loop? Should it be in the main application's run method? Should it answer onpaint messages on the currently active view? Thanks in advnace. Snir_ya.
-
Hi all, I'm writing a game application with a main lobby where players can select a game which opens in a different frame window. Players can open several games at a time so actually there's only one view that needs to be rendered at a time. The game loop should respond to key and mouse events using directInput (directX). My question is where do i place the game loop? Should it be in the main application's run method? Should it answer onpaint messages on the currently active view? Thanks in advnace. Snir_ya.
snir_ya wrote:
My question is where do i place the game loop?
This is an open ended question as we don't really know your plan. Are these individual games running in their own process space, in a new thread, or what? Each game (assuming they are independent) should have its own main loop more times than not - even if they have to interact with one another via IPC or whatever. Also, don't put your main game loop in WM_PAINT for D3D or DD. It should be independent of GDI operations and either ran in or called from within the process' main loop (e.g.; WinMain(), main(), etc.).
Jeremy Falcon Oatmeal, It's What's for Dinner.[^]
-
snir_ya wrote:
My question is where do i place the game loop?
This is an open ended question as we don't really know your plan. Are these individual games running in their own process space, in a new thread, or what? Each game (assuming they are independent) should have its own main loop more times than not - even if they have to interact with one another via IPC or whatever. Also, don't put your main game loop in WM_PAINT for D3D or DD. It should be independent of GDI operations and either ran in or called from within the process' main loop (e.g.; WinMain(), main(), etc.).
Jeremy Falcon Oatmeal, It's What's for Dinner.[^]
Jeremy Falcon wrote:
don't put your main game loop in WM_PAINT
:-D mmmm...oatmeal... Happy new year Jeremy!
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
Jeremy Falcon wrote:
don't put your main game loop in WM_PAINT
:-D mmmm...oatmeal... Happy new year Jeremy!
Mark Salsbery Microsoft MVP - Visual C++ :java:
Mark Salsbery wrote:
mmmm...oatmeal...
;)
Mark Salsbery wrote:
Happy new year Jeremy!
You too man! Here's to another great year of procrastination! :laugh:
Jeremy Falcon Oatmeal, It's What's for Dinner.[^]
-
Mark Salsbery wrote:
mmmm...oatmeal...
;)
Mark Salsbery wrote:
Happy new year Jeremy!
You too man! Here's to another great year of procrastination! :laugh:
Jeremy Falcon Oatmeal, It's What's for Dinner.[^]
Jeremy Falcon wrote:
Here's to another great year of procrastination!
I'm putting that off for a while...
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
Jeremy Falcon wrote:
Here's to another great year of procrastination!
I'm putting that off for a while...
Mark Salsbery Microsoft MVP - Visual C++ :java: