Sign in to follow this  

I think I have seen a bug ... in dxut

This topic is 4817 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I was just playing a bit with framework that comes with sdk 9c, and I think I have found a bug (I'm not sure - maybe I did somethign wrong). Nothing serious but anyway ... This code should open a window and install a keyboard callback that closes app when 'q' is pressed. However if u press F2 it has same effect too even if framework is initialized not to handle default keys. A bug? #include "dxstdafx.h" #include "resource.h" void CALLBACK KeyboardProc( UINT nChar, bool bKeyDown, bool bAltDown ){ if( bKeyDown ) { switch( nChar ) { case 'q': case 'Q': PostQuitMessage( 0 ); } } } INT WINAPI WinMain(HINSTANCE,HINSTANCE, LPSTR, int){ DXUTInit(false,false,true); DXUTSetCallbackKeyboard( KeyboardProc ); DXUTCreateWindow(); DXUTCreateDevice(); DXUTMainLoop(); return DXUTGetExitCode(); } The code is stripped of anything else then a window and keyboard callback for simplicity.

Share this post


Link to post
Share on other sites
That's true!

Didn't know that one; thnks

But do I use lower 'q' in that case? If I run code above with only 'Q' compiled, it doesn't matter if I use caps lock or not, it responds on both cases. Does it mean I can only use "one" case with this framework?

Share this post


Link to post
Share on other sites

This topic is 4817 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this