Hi guys,
So I'm now using CodeLite to develop my SFML game, and also reading from the SFML Game Development book and have hit a little bit of a hitch in the third chapter called "World".
This is the github for the chapter:
https://github.com/SFML/SFML-Game-Development-Book/tree/master/03_WorldNow onto my error... I've copied what's both in the book and the github word for word in terms of code (I've added extra functions here and there to break the code into more understandable parts for me).
Now it all comes out error and warning free, but when I go to run the program I get a black window and the following runtime error:
An internal OpenGL call failed in RenderTarget.cpp(418).
Expression:
glViewport(viewport.left, top, viewport.width, viewport.height)
Error description:
GL_INVALID_VALUE
A numeric argument is out of range.
Now I've looked around the internet and found out that that error tends to lead to an out-of-date graphics card... But I've a very new Lenovo IdeaPad Flex 10 running Ubuntu 15.10.
Also when I do the following in the main Game class:
sf::Texture m_texture;
sf::Sprite m_sprite;
m_texture.loadFromFile("/Path/To/Texture/Resource.png");
m_sprite.setTexture(m_texture);
m_window.clear();
m_window.draw(m_sprite);
m_window.display();
The texture displays fine... I don't understand what could be going wrong... Any ideas?
Edit:-
I also placed the following into my Game::run() function to check the major version of OpenGL my graphics card can provide:
sf::ContextSettings settings = m_window.getSettings();
std::cout << settings.majorVersion << "." << settings.minorVersion << std::endl;
and it came out with a value of 3.0.