Click here to Skip to main content
16,006,428 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
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 
Cyrilix wrote:
The graphics thread always has something to do. It has to draw the frames, whether or not user input is entered. If no user input or no AI interaction (that results in a change of what you can see on the screen) is there, then it should just draw the same frame, and then keep on drawing frames forever after that.

First, I'd like to ask whether or not you're disputing my statement above, because everything I mentioned in the last few posts is in question to whether or not you dispute drawing frames continuously.


I'm not sure if I dispute it. How do you control at what rate the frames are being updated? If on a given frame, nothing has changed, do you go ahead and redraw it anway? It seems you would only update at set time intervals (1/10 of a second or 1/100, whatever), in which case you could put the update code in the main thread and have it triggered by WM_TIMER messages. Or, if running continuously in a seperate thread, Sleeping for a set time interval on each iteration. Maybe the AI engine could be running continuously in a seperate thread, and when it was time for an update, you could query it, and it could give the best data it had at the moment.

------

I guess I need to read more carefully - you did say a frame is updated whether its changed or not. I would say it should be on a timer.
You did say you were a beginner. I have written a several thousand line long windows app that is fairly entertaining game that is a little more sophisticated than pac-man.
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 
Questionstack overflow Pin
Lord_Vader18-Jun-07 6:26
Lord_Vader18-Jun-07 6:26 
AnswerRe: stack overflow Pin
led mike18-Jun-07 6:39
led mike18-Jun-07 6:39 
GeneralRe: stack overflow Pin
Lord_Vader18-Jun-07 6:44
Lord_Vader18-Jun-07 6:44 
GeneralRe: stack overflow Pin
Cyrilix18-Jun-07 6:46
Cyrilix18-Jun-07 6:46 
GeneralRe: stack overflow Pin
Lord_Vader18-Jun-07 6:52
Lord_Vader18-Jun-07 6:52 
GeneralRe: stack overflow Pin
James R. Twine18-Jun-07 7:14
James R. Twine18-Jun-07 7:14 

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.