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

Author Topic: OpenGL Texture Invalid Operation Call Failed?  (Read 2658 times)

0 Members and 1 Guest are viewing this topic.

BlazeCrate

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
OpenGL Texture Invalid Operation Call Failed?
« on: May 19, 2014, 06:24:53 pm »
Hello,

I am trying to add bullets into my space ship game. I got them working and shooting the way that I want. The bullets are working fine (with a need for a bit of fine tuning).

But when I close the game the console window gives me the error attached.

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: OpenGL Texture Invalid Operation Call Failed?
« Reply #1 on: May 19, 2014, 06:29:03 pm »
Taking a wild guess here: you have some global variables/objects (includes singletons) in your code?
If I'm right, then "don't do that". If I'm wrong then just ignore me ;)

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: OpenGL Texture Invalid Operation Call Failed?
« Reply #2 on: May 19, 2014, 06:31:18 pm »
Another guess: you call draw() after closing the window. Make sure you return immediately as soon as the window is closed, so that you don't render anymore.

Next time, please ask a clear question.
« Last Edit: May 19, 2014, 06:33:17 pm by Nexus »
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

BlazeCrate

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
Re: OpenGL Texture Invalid Operation Call Failed?
« Reply #3 on: May 19, 2014, 06:32:40 pm »
Sorry forgot to link my code: https://github.com/Ancell/Tractus

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: OpenGL Texture Invalid Operation Call Failed?
« Reply #4 on: May 19, 2014, 06:34:10 pm »
Sorry forgot to link my code: https://github.com/Ancell/Tractus
No one wants to browse your whole repository, that's why there's a rule concerning minimal complete examples. Please read it carefully for future questions.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

BlazeCrate

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
Re: OpenGL Texture Invalid Operation Call Failed?
« Reply #5 on: May 19, 2014, 06:47:14 pm »
Well I solved the problem of not getting that output. I used your advice about exiting right after I close the window. I just added return EXIT_SUCCESS; right before window.close(); in my main class.

Thanks for the help!

P.s. I will read the rules of posting for future questions.

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: OpenGL Texture Invalid Operation Call Failed?
« Reply #6 on: May 19, 2014, 07:07:10 pm »
... I just added return EXIT_SUCCESS; right before window.close(); in my main class. ...
I'd say that right after would probably be closer to what you really want ;)

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: OpenGL Texture Invalid Operation Call Failed?
« Reply #7 on: May 19, 2014, 07:47:34 pm »
close() is not really necessary. If the window goes out of scope, the destructor will close it automatically.

So I'd write only a return statement.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: OpenGL Texture Invalid Operation Call Failed?
« Reply #8 on: May 19, 2014, 07:49:58 pm »
My point (that I didn't make very well) was that putting the return before close() is pointless since close() just becomes dead code.
Either close() and then return or, as you say, just return.