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.


Messages - Sh3xe

Pages: [1]
1
Graphics / Re: GL_INVALID_OPERATION messages pop up when loading textures.
« on: February 23, 2020, 05:47:35 pm »
what SFML version do you use? i remember that the "glFlush()" were removed!!.

also, there is a potential bug in "loadTextures()", the sf::Texture object has tobe inside the nested for-loops. try to change it and see what gonna happen.
I am using SFML 2.5.1. I tried and It didn't worked. Also I did the same thing in another sfml program (same function and image) and it worked :/

It's probably caused when the textures get copied, which happen at the very least when you push back a texture into the vector, and also internally to the vector every time it resizes (which will get worse the bigger the vector gets). Storing a texture in a vector is also very prone to the white square problem. Consider perhaps using a vector of std::unique_ptr or maybe even some sort of resource holder such as this or this.
Ok i'll try

2
Graphics / GL_INVALID_OPERATION messages pop up when loading textures.
« on: February 23, 2020, 07:05:44 am »
Hello!

I've been working on a simple map editor, and I have this "loadTexture" function, the problem is that when I call it, I have this that pops up hundreds of times in my console:

(click to show/hide)

Here is my loadTexture function:
(click to show/hide)

and my levelEditor class:
(click to show/hide)

I tried to remove the " this->texture_vector.push_back(texture);" and when I do that, I no longer have the message. I also tried to reproduce in another sfml file the same thing:
a class with a std::vector<sf::Texture> and the same function, and everything works fine.

Thank you in advance for your answer because I really don't know what to do right now.

Pages: [1]