Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Possibly issue ??  (Read 2923 times)

0 Members and 1 Guest are viewing this topic.

Redee

  • Jr. Member
  • **
  • Posts: 97
    • View Profile
Possibly issue ??
« on: June 26, 2015, 10:04:08 am »
LOWORD / HIWORD.........
https://github.com/SFML/SFML/blob/master/src/SFML/Window/Win32/WindowImplWin32.cpp#L833

Msdn Warning !!! >
https://msdn.microsoft.com/en-us/library/windows/desktop/ms645616%28v=vs.85%29.aspx
Quote
Important  Do not use the LOWORD or HIWORD macros to extract the x- and y- coordinates of the cursor position because these macros return incorrect results on systems with multiple monitors. Systems with multiple monitors can have negative x- and y- coordinates, and LOWORD and HIWORD treat the coordinates as unsigned quantities.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Possibly issue ??
« Reply #1 on: June 26, 2015, 10:32:32 am »
Laurent Gomila - SFML developer

Redee

  • Jr. Member
  • **
  • Posts: 97
    • View Profile
Re: Possibly issue ??
« Reply #2 on: June 26, 2015, 02:49:20 pm »
You can do this manualy read / write bytes for 2 numbers without Windowsx.h header !!!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Possibly issue ??
« Reply #3 on: June 26, 2015, 03:17:26 pm »
Yes, that's what the current implementation does.
Laurent Gomila - SFML developer

Redee

  • Jr. Member
  • **
  • Posts: 97
    • View Profile
Re: Possibly issue ??
« Reply #4 on: June 26, 2015, 03:34:46 pm »
I no see in 2.3.x branch any changes.
https://github.com/SFML/SFML/blob/2.3.x/src/SFML/Window/Win32/WindowImplWin32.cpp#L673

And WORD / DWORD types its unsigned types.
We need read / write as > int.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11033
    • View Profile
    • development blog
    • Email
Re: Possibly issue ??
« Reply #5 on: June 26, 2015, 03:47:13 pm »
Do you actually have an issue or do you just make a fuss about something you read while not really understanding what the code base does? ::)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Redee

  • Jr. Member
  • **
  • Posts: 97
    • View Profile
Re: Possibly issue ??
« Reply #6 on: June 26, 2015, 05:25:11 pm »
There said we can get negative numbers, I said above convert to DWORD or WORD its unsigned types.

You tested at 2 monitors (1st half of window at first monitor, 2nd half at second monitor) ?
75% of all questions unfortunately  I fixing alone.

What prevent to simply write like this ? >
int Num = (int)lparam;
Int16 x = (Int16)(Num << 16 >> 16);
Int16 y = (Int16)(Num >> 16);
« Last Edit: June 26, 2015, 05:51:28 pm by Redee »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11033
    • View Profile
    • development blog
    • Email
Re: Possibly issue ??
« Reply #7 on: June 26, 2015, 06:01:28 pm »
You did not answer the question. Do you have an issue or not? ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Possibly issue ??
« Reply #8 on: June 26, 2015, 06:04:28 pm »
To be clear: the code in SFML is exactly what the suggested macros would do.
Laurent Gomila - SFML developer

 

anything