Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8979441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:50:55+00:00 2026-06-15T19:50:55+00:00

I was going to use GetInput() for this code but I have to use

  • 0

I was going to use

GetInput()

for this code but I have to use something different instead. pollEvent gives me these errors:

error C2664: 'sf::Window::pollEvent' : cannot convert parameter 1 from 'int' to 'sf::Event &'
error C2664: 'sf::Window::pollEvent' : cannot convert parameter 1 from 'int' to 'sf::Event &'

The code is:

int x = camera->GetPosition().x + window->pollEvent(sf::Mouse::getPosition().x);
int y = camera->GetPosition().y + window->pollEvent(sf::Mouse::getPosition().y);

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T19:50:56+00:00Added an answer on June 15, 2026 at 7:50 pm

    sf::Window::pollEvent() takes an argument of type Event& event, but you’re trying to pass sf::Mouse::getPosition().x/y. I have no clue why you’re calling window->pollEvent() at all, and from what it looks like you’re trying to do, you can just remove the function call and add sf::Mouse::getPosition().x/y directly.

    Edit: Based on your comment, it looks like you want to something more like this:

    sf::Event event;
    while (window->pollEvent(event)) // Be sure to put this in your main event loop
    {
        if (event.type == sf::Event::MouseButtonPressed)
        {
            int x = camera->GetPosition().x + event.mouseButton.x;
            // ...
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was going to use ELMAH for our ultimate automatic error logging but recently
I have an application thats going to use Active Directory for Authentication. This will
I'm going to use Codeigniter's session data for my login system, but first I
I was going to use the program called Tiled , but decided not to
I was just going to use the FileUpload.FileBytes property but looking into the respective
I am going to use forms authentication but I want to be able to
I was going to use the following line of code: [[NSSortDescriptor alloc] initWithKey:@title ascending:YES
I am going to use on of the tooltip plugins listed in this question:
I'm going to use the sample code from http://gettinggeneticsdone.blogspot.com/2009/11/split-apply-and-combine-in-r-using-plyr.html for this example. So, first,
I'm going to use the membership system in ASP.net, but need to change it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.