My child window won't update
I am having trouble in my application, for a long time it has just been a single window and all was good, recently I decided to add a child window to it to have controls I can mess with rather than exiting changing and recompiling.
it won't update the contents of the control window, I have tried showing the window again and calling window update. but it just sits there and mocks me.
anywayin its final incarnation this time, I am planning on it being a economic simulation for a space game. the large white spheres are trade points, the small green ones will be ships.
I need to get the external control window up and running before i go further though :)
Here is the zipfile with the files, and compiled program in its current state
http://www.woodrell.com/joe/econ_sim.zip
Thanks guys.
oh the other thing is i wanted the rendering window to be active after everything loads. right now you have to click back on it before you can move around.
the controls to move:
W, S -> Pitch
A, D -> Yaw
Q, E -> Roll
R -> Rotation Dampening Brake
Numpad
8, 2 -> Forward / Back
4, 6 -> Left / Right
9, 3 -> Up / Down
5 -> Movement Dampening Brake'
Escape Exits
I haven't looked at the code in-depth, as I don't have my dev machine handy atm, but something about this rings familiar. I noticed you have your main message loop set up like this:
That means that only one message will get handled for each frame. These messages also control your application's updates to its child windows. There can be a few dozen messages delivered to an application's message queue in a fraction of a second. Even if you render at 60fps, this may form a large backlog (and the queue can even overflow).
Try changing the "if" around the PeekMessage block into a "while" and see if that helps.
while(TRUE){ if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { if (msg.message == WM_QUIT) break; TranslateMessage(&msg); DispatchMessage(&msg); } render_frame(); // check the 'escape' key if(KEY_DOWN(VK_ESCAPE)) PostMessage(hWnd, WM_DESTROY, 0, 0);}
That means that only one message will get handled for each frame. These messages also control your application's updates to its child windows. There can be a few dozen messages delivered to an application's message queue in a fraction of a second. Even if you render at 60fps, this may form a large backlog (and the queue can even overflow).
Try changing the "if" around the PeekMessage block into a "while" and see if that helps.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement