Question about Jim's Core_System.h

Started by
15 comments, last by wiseachoo 21 years, 5 months ago
quote:Original post by wiseachoo
Thanks for the input guys, what about my scrolling green bar issue? Anyone have any ideas?


Not sure exactly what you mean by it. Are you clearing the back buffer each frame?

pan narrans
Study + Hard Work + Loud Profanity = Good Code
Minister of Propaganda : leighstringer.com : Nobody likes the man who brings bad news - Sophocles (496 BC - 406 BC), Antigone
Advertisement
man, you like that quote tag don''t you?

Much greatness is achieved thru perseverance and faith.
Much greatness is achieved thru perseverance and faith.
quote:Original post by Paladin__
man, you like that quote tag don''t you?


What quote tag???

pan narrans
Study + Hard Work + Loud Profanity = Good Code
Minister of Propaganda : leighstringer.com : Nobody likes the man who brings bad news - Sophocles (496 BC - 406 BC), Antigone
pan: thx for reminding me...yea I forgot to call ClearDisplay() before calling BeginScene()...I've done some testing....I drew out a little spaceship and saved it as a texture. Loaded it into my application as a cTexture. Then Blitted it to the screen and created a cInputDevice object for the keyboard. Couple questions. Number 1, I noticed that whenever I check for any of the following:

if (m_Keyboard.GetKeyState(KEY_LEFT) == TRUE)
if (m_Keyboard.GetKeyState(KEY_RIGHT) == TRUE)
if (m_Keyboard.GetKeyState(KEY_UP) == TRUE)
if (m_Keyboard.GetKeyState(KEY_DOWN) == TRUE)

I get this issue: truncation from 'const int' to 'char'
However, if I use any other keys on the keyboard such as the numpad keys, or escape, or lettered keys, I have no problem. All of the keys are typedefined the same way in Core_Input.h. I see no reason for there to be any differences between which keys I am checking... Have you tried creating a cInputDevice for the keyboard and calling GetKeyState on the arrow keys? I'd 'like' to get those working since those are the first place most people's hands flock when playing around with a game.

My second question is regarding the application losing focus. Since I am running in windows mode, I often times click over to other apps while its running, however this seems to lag my system to death until the application gains focus again. I think I read a post about this a while back but the solution has slipped my mind.

Thanks.

[edited by - wiseachoo on November 13, 2002 3:40:33 AM]

[edited by - wiseachoo on November 13, 2002 3:42:42 AM]
quote:Original post by wiseachoo
truncation from ''const int'' to ''char''

Assuming you''re using VC++ 6.0: go to project->settings->C/C++ tab->Project Options and add /J to the end. Look at the appendices for the reason (char becomes unsigned char).

quote:My second question is regarding the application losing focus.

Not quite as simple
You need to detect when the window loses focus and halt the processing of the game until your app regains focus.

pan narrans
Study + Hard Work + Loud Profanity = Good Code
Minister of Propaganda : leighstringer.com : Nobody likes the man who brings bad news - Sophocles (496 BC - 406 BC), Antigone
Ok, the /J switch has been added and it did appear to remove that truncation issue. However, the KEY_LEFT, KEY_RIGHT, KEY_UP, and KEY_DOWN just don''t respond unlike the other keys which do...i''ll look more into it when I have some time this evening...its just strange that they don''t act the same as the rest of the keys (which are working).

As for checking when the application loses focus, that sounds like a check that should be done within each frame call since the user can alt-tab or click over to another application at any given time, correct?

''Chris
You need to add a check for the WM_ACTIVATE message in the message pump.

case WM_ACTIVATE:
if (!HIWORD(wParam)
// Program is being activated
else
// Program is being deactivated

You probably would add a boolean to easily track the window''s state. Then all you do is to check if that bool is true, in your main loop, and then render or not.

while(msg.message != WM_QUIT)
if (PeekMessage(yadayada)
// check for quit message blahablaha process msgs
else
if (Active)
// Render


(lazy)

/Sandman
________________________________pro.gram.mer - an organism that turns caffeine into code

This topic is closed to new replies.

Advertisement