Impossible to create render texture (failed to link the target texture to the framebuffer)
with debug libaries I also get this:
An internal OpenGL call failed in RenderTextureImplFBO.cpp (117)
: GL_INVALID_OPERATION, the specified operation is not allowed in the current state
Some code which triggers it for me:
#include <SFML/Graphics.hpp>
#include <vector>
#include <algorithm>
#include <iostream>
int main()
{
std::vector<unsigned int> w;
std::vector<unsigned int> h;
for(unsigned int i = 100; i < sf::Texture::getMaximumSize(); i +=500)
{
w.push_back(i);
}
h.reserve(w.size());
std::copy(w.begin(),w.end(),h.begin());
for(unsigned int i =0; i < w.size(); i++)
{
std::cout << "i: " << i << std::endl;
std::cout << "wi: " << w[i] << std::endl;
std::cout << "hi: " << h[i] << std::endl;
sf::RenderTexture rt;
if(!rt.create(w[i],h[i]))
continue;
rt.display();
}
return 0;
}
Outputs:
i: 0
wi: 100
hi: 100
An internal OpenGL call failed in RenderTextureImplFBO.cpp (117) : GL_INVALID_OPERATION, the specified operation is not allowed in the current state
Impossible to create render texture (failed to link the target texture to the frame buffer)
i: 1
wi: 600
hi: 600
i: 2
wi: 1100
hi: 1100
i: 3
wi: 1600
hi: 1600
i: 4
wi: 2100
hi: 2100
i: 5
wi: 2600
hi: 2600
i: 6
wi: 3100
hi: 3100
i: 7
wi: 3600
hi: 3600
I'm on arch linux with fully up to date sfml. This happens on the open source radeon driver and the intel driver on my laptop.Subsequent textures afer the first get created normally. I can write to them and copy them etc but the first one fails regardless of settings.
Can anyone else reproduce this? Am I doing it wrong? Is it a bug? Do you want more info?
Thanks.