Click here to Skip to main content
15,927,127 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHandling input and graphics in a game engine Pin
Cyrilix18-Jun-07 7:33
Cyrilix18-Jun-07 7:33 
AnswerRe: Handling input and graphics in a game engine Pin
Force Code18-Jun-07 8:10
Force Code18-Jun-07 8:10 
GeneralRe: Handling input and graphics in a game engine Pin
Cyrilix18-Jun-07 8:29
Cyrilix18-Jun-07 8:29 
GeneralRe: Handling input and graphics in a game engine [modified] Pin
Force Code18-Jun-07 8:51
Force Code18-Jun-07 8:51 
GeneralRe: Handling input and graphics in a game engine Pin
Cyrilix18-Jun-07 9:01
Cyrilix18-Jun-07 9:01 
GeneralRe: Handling input and graphics in a game engine Pin
Force Code18-Jun-07 9:15
Force Code18-Jun-07 9:15 
GeneralRe: Handling input and graphics in a game engine Pin
Cyrilix18-Jun-07 9:26
Cyrilix18-Jun-07 9:26 
GeneralRe: Handling input and graphics in a game engine Pin
Force Code18-Jun-07 9:51
Force Code18-Jun-07 9:51 
Cyrilix wrote:
Then my question is, how do you explain the current crop of games today? They don't update the frame buffer synchronously. They won't be trying to send you 60 frames per second all the time. On heavier scenes, the frames may drop down to the 20s, and on lighter scenes, they may jump up to 150. What else, besides a while loop displaying graphics would do this?


To make sure I understood correctly, I thought you were saying your graphics thread would literally have nothing to do until it recieved some sort of input, so it would do nothing but check an inbox, continuously, billions of times a second, until it recieved a message. This is pointless processing, even if you put in a seperate thread. If you're running a seperate *process* as opposed to thread, sometimes that sort of wait loop is necessary, but then you call Sleep() with each iteration to avoid wasting the CPU. A windows application behind the scenes has a message loop, but when it calls GetMessage, windows doesn't return until there is actually a message, so the calling process isn't wasting time continuosly checking.

AS far as modern games, I didn't think you were developing for PlayStation X or some specific game processor, but they can ascertain the game state (e.g. how many frames to display at a given time), without the sort of loop you're talking about.

Just to reiterate, I think the way to go for game state updates is a windows timer (don't know what the precise synax in MFC is).
GeneralRe: Handling input and graphics in a game engine [modified] Pin
Cyrilix18-Jun-07 10:01
Cyrilix18-Jun-07 10:01 
GeneralRe: Handling input and graphics in a game engine Pin
Force Code18-Jun-07 10:33
Force Code18-Jun-07 10:33 
GeneralRe: Handling input and graphics in a game engine Pin
Cyrilix18-Jun-07 10:43
Cyrilix18-Jun-07 10:43 
GeneralRe: Handling input and graphics in a game engine Pin
Force Code18-Jun-07 10:48
Force Code18-Jun-07 10:48 
GeneralRe: Handling input and graphics in a game engine Pin
Cyrilix18-Jun-07 11:18
Cyrilix18-Jun-07 11:18 
GeneralRe: Handling input and graphics in a game engine Pin
Force Code18-Jun-07 12:10
Force Code18-Jun-07 12:10 
GeneralRe: Handling input and graphics in a game engine Pin
Cyrilix18-Jun-07 12:29
Cyrilix18-Jun-07 12:29 
GeneralRe: Handling input and graphics in a game engine Pin
Matthew Faithfull18-Jun-07 10:55
Matthew Faithfull18-Jun-07 10:55 
GeneralRe: Handling input and graphics in a game engine Pin
Cyrilix18-Jun-07 11:09
Cyrilix18-Jun-07 11:09 
GeneralRe: Handling input and graphics in a game engine Pin
Matthew Faithfull18-Jun-07 13:03
Matthew Faithfull18-Jun-07 13:03 
QuestionMultiple bitmap in VMR9 Pin
houari_id18-Jun-07 7:30
houari_id18-Jun-07 7:30 
AnswerRe: Multiple bitmap in VMR9 Pin
Mark Salsbery18-Jun-07 7:45
Mark Salsbery18-Jun-07 7:45 
GeneralRe: Multiple bitmap in VMR9 Pin
houari_id18-Jun-07 8:00
houari_id18-Jun-07 8:00 
GeneralRe: Multiple bitmap in VMR9 Pin
Mark Salsbery18-Jun-07 8:47
Mark Salsbery18-Jun-07 8:47 
QuestionC++ Program with date and class Pin
berni2k18-Jun-07 6:41
berni2k18-Jun-07 6:41 
AnswerRe: C++ Program with date and class Pin
led mike18-Jun-07 7:10
led mike18-Jun-07 7:10 
GeneralRe: C++ Program with date and class Pin
berni2k18-Jun-07 8:36
berni2k18-Jun-07 8:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.