   Vista Nightmare with XNA App
  I've been working on a Level Editor for a game another person and I are doing.  However he's getting some unexpected problems when running the program.  I developed the application on Windows XP 32bit.  He's on Vista 64bit, if that matters.  I have bounding box collisions setup for a button, however he's unable to select that button for some reason.  When I do it on my computer it works fine though, and I even did it step by step how he had showed me.  It uses nothing more the the current mouse x and y positions while checking against the button.I'm wondering if anyone else has experienced problems when developing on XP with XNA and running it on Vista.  Is this a common problem for development on XP to Vista?EDIT:He just tried in on XP and ran into no problems, so its a Vista problem.  If anyone can guide me on how to fix such issues that would be great.   
Quote:Original post by MrCpawI've been working on a Level Editor for a game another person and I are doing.  However he's getting some unexpected problems when running the program.  I developed the application on Windows XP 32bit.  He's on Vista 64bit, if that matters.  I have bounding box collisions setup for a button, however he's unable to select that button for some reason.  When I do it on my computer it works fine though, and I even did it step by step how he had showed me.  It uses nothing more the the current mouse x and y positions while checking against the button.I'm wondering if anyone else has experienced problems when developing on XP with XNA and running it on Vista.  Is this a common problem for development on XP to Vista?EDIT:He just tried in on XP and ran into no problems, so its a Vista problem.  If anyone can guide me on how to fix such issues that would be great.I'm not sure about XNA, but is this game running fullscreen?Because using RAW DirectX10 I encountered some difference in the managing of the fullscreen. Basically the resolution remain the desktop one while the image is stretched making all coordinate based system to screw because the mouse return the xy position related to the desktop resolution while you are waiting the xy position related to the backbuffer size.(it may not be of help cause i don't really know the XNA framework)   ;  It's a windowed application.  The major problem we're going to have is when this game starts getting closer to being completed, we want Vista to be able to run it.  We're working around the editor issue by him using XP, however I would like to make it so Vista runs it as well.   ;  Strange, I cross develop XNA between Vista and XP all the time, Vista at home and XP at work.  I'm using XNA's mouse stuff to get the mouse position to display a cursor and use my own buttons so a similiar thing.  This works both windowed and fullscreen (as I tend to develop in windowed mode, then go fullscreen when it's working).  I wonder if its a 64bit thing as I use Vista32 but I don't see why.  Try setting up some a small text function to display your mouse pos and collision data on the screen during runtime and see if that shows up where the problem is.Maybe try posting some of the relevant code.   ;  There was one bug he said that would happen with Vista.  You would be drawing a tile and it wouldn't draw unless you clicked.The code for drawing is kinda like this:if (Cursor_X < Map_1.Bounding_Box_Right &&Cursor_X > Map_1.Bounding_Box_Left &&Cursor_Y > Map_1.Bounding_Box_Top &&Cursor_Y < Map_1.Bounding_Box_Bottom &&MS_Current_State.LeftButton == ButtonState.Pressed){   // Do Tile Drawing}Map_1 just refers to the current map you've created, such as 640x480 map.  It just insures it wont tile if you attempt to draw outside of the array bounds.He said it would only draw if he clicked the mouse, holding didn't work.I really don't know if these issues are true or not because I haven't seen it with my own eyes.  Nor do I have a Vista machine.[Edited by - MrCpaw on June 13, 2009 10:49:40 PM];  It's a bit hard to tell from your snippit but are you calling the mousestate from your update or draw routines.All the mouse position stuff needs to be done in your update routines and just the drawing in the draw sections.Here is my button code (in "update", well in the update area of my UI code)mouse = Mouse.GetState();foreach (Button butt in buttons){    if (butt.CheckButton(mouse.X, mouse.Y))    {   butt.on = true;   butt.active = false;    }    else    {   butt.on = false;   butt.active = false;    }} The on and active states are to change the way button renders for a "mouse over" effect (I just change the render colour)Each button has a "check" function that returns true if the given mouse range is within the button's region.Click detection is really easy, I use a bool to detect the change in mouse state. //Click Detect  if ((mouse.LeftButton == ButtonState.Pressed) & !lastLeftDown)  { lastLeftDown = true; //Button Pressed int result = -1; //TODO: redo this as a foreach for (int x = 0; x < buttons.Length; x++) {if (buttons[x].CheckButton(mouse.X, mouse.Y)) result = x; } if (result > -1) {BreakDownButtons(gameMode, result, dmx, sound, names); }  }  if (mouse.LeftButton == ButtonState.Released)  { lastLeftDown = false;  }iepublic bool CheckButton(int posX, int posY)   {  if (posX < Pos.X) return false;  if (posX > PosEndX) return false;  if (posY < Pos.Y) return false;  if (posY > PosEndY) return false;  return true;   }Each button has it's own render section which is called as part of the UI's render section.  All the buttons use the same sprite batch.public void RenderButton(SpriteBatch batch)   {  //DrawButton  if (active &!on)  { batch.Draw(Texture, Pos, OnColor);  }   if (on)  { batch.Draw(Texture, Pos, OverColor);  }  if(!active & !on)  {batch.Draw(Texture, Pos, NormalColor);  }   }I realize this isn't exactly what you are trying to achieve but I would look at adding some text on your screen to show you (and him) what is going on with the mouse state etc.  It could be even be a threading issue with the mouse state and the render area.   ;  All the C and C++ game programming I've done has taught me always to split logic and drawing up.  So yes, my mouse events along with anything else not related to drawing is in the Update area.  The example was mainly to show if the mouse button is pressed draw something.  However it appears he can never get it to act is if the button is always down.  Here is a better example:// Global Stuff (This is outside of the Update)MouseState MS_Current_State, MS_Previous_State;int Cursor_X = 0;int Cursor_Y = 0;// Logic StuffMS_Current_State = Mouse.GetState();Cursor_X = (int)MS_Current_State.X + Camera_X;Cursor_Y = (int)MS_Current_State.Y - 32 + Camera_Y;if (MS_Current_State.Left_Button == ButtonState.Pressed){Map_1.Level[Cursor_Y / Map_1.Tile_Height, Cursor_X / Map_1.Tile_Width] = 1;}// MS_Previous_State isn't used for this example, but is used for button clickingMS_Previous_State = MS_Current_State;I don't see any possible way it wouldn't draw on Vista from that.  It clearly checks to make sure the mouse button is pressed down.  It works perfect on all the XP systems.  If I had a Vista system, I could better see what is going on by debugging it on Vista.My button clicking is as simple as this:// At the start of the Update get the current mouse stateMS_Current_State = Mouse.GetState();if (MS_Current_State.LeftButton == ButtonState.Pressed &&MS_Previous_State.LeftButton == ButtonState.Released &&MS_Current_State.X > Objects_Button.Button_Bounding_Box_Left &&MS_Current_State.X < Objects_Button.Button_Bounding_Box_Right &&MS_Current_State.Y < Objects_Button.Button_Bounding_Box_Bottom &&MS_Current_State.Y > Objects_Button.Button_Bounding_Box_Top){    // Do stuff}MS_Previous_State = MS_Current_State;The above is a very small example.  However, either way I do not see any possible reason why the mouse wouldn't be working right.  It really doesn't make sense to me.  Without a Vista machine to debug on I wouldn't know unless someone else has similar problems.   ;  Hate to say it but you are going to have to debug it on Vista,  I certainly haven't noticed any differences between runnning on XP vs Vista on any XNA stuff I've written including the mouse stuff.  Have you had a chance to try it on another Vista machine it might be something strange on your friends machine/mouse.Like I said before I'd use some simple text printing to print all the relevant variables to the screen and that way you might be able to track what is going on without having to run under debug.Maybe code a really simple "button state" display program and that way you can see if the mouse button is actually staying "down".But please let us know when you find it 'cause it is certainly interesting :).   ;  What about running software in Windows XP compatibility mode?   ;  That's a good idea, it doesn't really solve the OPs origional issue and it would be good to know why it is happening, but XP compatability mode might show it up to be a problem with the system rather than Vista itself.   