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

Author Topic: SFML-2.1 internal OpenGL call failed  (Read 2755 times)

0 Members and 2 Guests are viewing this topic.

botics

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
SFML-2.1 internal OpenGL call failed
« on: June 07, 2014, 04:31:08 pm »
Hello,
I recently started a new project and I got a very frustrating error.
Everything is working until I move my mouse over a specific point on the window, then the program just stop running.
The error it gives is: "An internal OpenGL call failed in Texture.cpp (95) : GL_INVALID_OPERATION, the specified operation is not allowed in the current state."
I tried to google it but I didn't find anything. Somebody can please help me?

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Re: SFML-2.1 internal OpenGL call failed
« Reply #1 on: June 07, 2014, 04:44:41 pm »
Could you show us a complete program that causes this error, and exactly where the error happened?

botics

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
Re: SFML-2.1 internal OpenGL call failed
« Reply #2 on: June 07, 2014, 04:49:07 pm »
The program is pretty big so I don't know how to show it and it happens when I move my mouse in the corner of the window.

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Re: SFML-2.1 internal OpenGL call failed
« Reply #3 on: June 07, 2014, 05:02:26 pm »
Since the error is really vague, we'll need an example program to do much about it.  Try cutting out large chunks of your code and see if the error still happens, until you have the smallest possible code that still causes the error.  If you can't do this, that's normally a sign the problem is not with SFML.

Also, I know global SFML objects tend to cause lots of weird errors, so if you have any of those see if getting rid of them helps.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
AW: SFML-2.1 internal OpenGL call failed
« Reply #4 on: June 07, 2014, 05:53:38 pm »
OpenGL has nothing on common with mouse input, as such there has to be a programming error to begin with.

My guess is that you don't handle events properly, see the tutorial on that regard.

And yes in order to figure out what it is, you'll need to cut out everything that doesn't remove the issue.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

botics

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
Re: SFML-2.1 internal OpenGL call failed
« Reply #5 on: June 07, 2014, 06:17:20 pm »
I think, I fix it the problem was that instead of this:
if (ev.type == sf::Event::KeyPressed)
{
        if (ev.key.code == sf::Keyboard::Escape)
                window.close();
}

I used just this:
if (ev.key.code == sf::Keyboard::Escape)
                window.close();
 

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: SFML-2.1 internal OpenGL call failed
« Reply #6 on: June 07, 2014, 10:40:32 pm »
My guess exactly. ;)

If you're watching Coding Made Easy tutorials, which is a well-known source of this exact mistake, then prepair yourself for more issue, because he has very little knowledge on SFML and even less on proper C++, thus a lot of his videos contain errors, are badly or not at all explained and will often confuse people more than if they had read a good C++ book, looked at official tutorials and documentations. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything