Jump to content
  • Advertisement
Sign in to follow this  
load_bitmap_file

DirectInput - Exclusive or Nonexclusive Mode?

This topic is 4734 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

Greetings, would I be correct if I said nearly every game I've seen uses DirectInput in exclusive mode? From what I can tell, if nonexclusive mode is set, you can alt + f4 out of a program, whereas with exclusive mode set, you cannot alt + f4 out of a program. Nearly every game I have played did not let you alt + f4 to close the program and quit. So, assuming I am correct with the ^ above, another characteristic I've noticed of DirectInput's exclusive mode is that it hides the normal Windows cursor and forces you to use the Direct3D cursor. If I have to use the Direct3D cursor, is there anyway to set the Direct3D cursor to look like the normal windows cursor? I believe Half-Life/Half-Life2/Counter-Strike use the normal windows cursor for the menus and stuff, but as far as I can tell it uses exclusive mode. To Summarize: 1. Does nearly every game use DirectInput in exclusive mode? 2. If I put DirectInput in exclusive mode which forces me to use the Direct3D cursor, how can I make the Direct3D cursor appear like the standard Windows arrow cursor?

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by load_bitmap_file
1. Does nearly every game use DirectInput in exclusive mode?

Quite likely. Although I've noticed a few cases where even outside of exclusive mode you can still trap alt-tab/alt-f4 type presses because your application "consumes" the keys but doesn't do anything with them..

Quote:
Original post by load_bitmap_file
2. If I put DirectInput in exclusive mode which forces me to use the Direct3D cursor, how can I make the Direct3D cursor appear like the standard Windows arrow cursor?

Draw one as a texture [smile] that's what I got my artists to do[attention]

I guess theres probably some funky Win32 call to retrieve the standard cursors as a DC that you can copy to a texture, but I can't see much need for that when it's relatively easy (and sometimes looks better) to draw your own.

hth
Jack

Share this post


Link to post
Share on other sites
Quote:
Original post by jollyjeffers
Quote:
Original post by load_bitmap_file
1. Does nearly every game use DirectInput in exclusive mode?

Quite likely. Although I've noticed a few cases where even outside of exclusive mode you can still trap alt-tab/alt-f4 type presses because your application "consumes" the keys but doesn't do anything with them..


Okay, good. Making DirectInput exclusive will make things a lot cleaner. [smile]

Quote:
Quote:
Original post by load_bitmap_file
2. If I put DirectInput in exclusive mode which forces me to use the Direct3D cursor, how can I make the Direct3D cursor appear like the standard Windows arrow cursor?

Draw one as a texture [smile] that's what I got my artists to do[attention]

I guess theres probably some funky Win32 call to retrieve the standard cursors as a DC that you can copy to a texture, but I can't see much need for that when it's relatively easy (and sometimes looks better) to draw your own.

hth
Jack


Heh, I was wondering if there was indeed some funky way to retrieve the standard cursor but I guess yeah, I'll just have the user make their own cursor image.

Thanks.

Share this post


Link to post
Share on other sites
Quote:
Original post by load_bitmap_file
Okay, good. Making DirectInput exclusive will make things a lot cleaner. [smile]

If you want to support window-mode, make sure your engine does not rely on exclusive input.

Quote:
Heh, I was wondering if there was indeed some funky way to retrieve the standard cursor but I guess yeah, I'll just have the user make their own cursor image.

You're gonna make the user draw one? Uh oh. You're not making a game engine builder, are you? [smile]

Share this post


Link to post
Share on other sites
Quote:
Original post by Jiia
Quote:
Original post by load_bitmap_file
Okay, good. Making DirectInput exclusive will make things a lot cleaner. [smile]

If you want to support window-mode, make sure your engine does not rely on exclusive input.


I specified DISCL_FOREGROUND so if whoever's running the program wants to do something else I'm pretty sure it the program wouldn't screw up.

Quote:
Quote:
Heh, I was wondering if there was indeed some funky way to retrieve the standard cursor but I guess yeah, I'll just have the user make their own cursor image.

You're gonna make the user draw one? Uh oh. You're not making a game engine builder, are you? [smile]


By "user" I meant the programmer using the engine [smile]. By the look of things, that "user" is only going to be me :P

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!