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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - BagOfBones

Pages: [1]
1
Window / Centering mouse
« on: February 12, 2017, 01:37:43 pm »
Hi. Im using sfml for implementing fps style camera and Ive recently noticed some strange behaviour. Code structure looks like this

int main()
{
  sf::RenderWindow window(sf::VideoMode(1280, 720), "test");
  // ...
  // ...

  // main loop
  while(!exitLoop)
  {
      //...
     sf::Vector mousePosition = sf::Mouse::getPosition(window);
     sf::Mouse::setPosition(sf::Vector2i(640, 360), window);

     update(mousePosition);
    // ...
  }
}
 

The thing is I use laptop with another monitor. When I set laptop window as a main screen and run an app, everything works fine. But when I set my second monitor as a main screen, sometimes setting the mouse into the center of a screen actually sets the mouse position into slightly diffrent values like (639, 360), (640, 359) etc...which causes some small offset against the center and constantly moves my camera, even when Im not touching my mouse. Sorry if its some stupid mistake. Thanks for help.

2
General / 360 degree camera
« on: August 27, 2016, 03:23:19 pm »
Hi! In next couple of days Im starting to work on first big project and I want to ask about some tips and advices on how to correctly implement 360 degree camera (not sure about terminology). I want to achieve camera similar to adventures like Scratches, Process or Nikopol. Thanks!

Pages: [1]