Advertisement

OpenGL call failed in RenderTarget.cpp (SFML2)

Started by December 23, 2015 04:33 PM
12 comments, last by Jamie_Edwards 9 years, 2 months ago

Hmmm, looks like whatever you're passing into your glViewport call is getting trashed, stomped on, or is just plain old uninitialized. Whichever, it's definitely the cause of your error anyway. Next step is for you to find where those values are coming from. I see that you've got m_worldView(window.getDefaultView()) so window.getDefaultView() looks a good first place to check.

Well upon looking at Game::m_world(m_window); which is the initialiser for my World class, it says the following for m_worldView:


m_viewport:
    left: 4.59...
    top: 6.13...
    width: 0
    height: -nan(0x7fdfd0)

so by the looks of things, World is actually being given that value in the first place, but World is being initialised as it's supposed to be.

Where as, (and I actually got things the wrong way around) my m_window.setView(m_worldView); has the following:


m_viewport:
    left: 0
    top: -nan(0x7fffff)
    width: 0
    height: 0

Hi, any ideas?

Advertisement
Well, it looks like top does not get initialized to a sane value. Look up in your code where you initialise m_viewport.

Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>

Well, it looks like top does not get initialized to a sane value. Look up in your code where you initialise m_viewport.

Actually, I may have figured out my problem whilst doing a different problem... It could that I've not initialised everything in the right order...

Example:

I have two std::maps:


std::map<std::string, GUI> m_guiMap;
std::map<std::string,sf::Font> m_fontMap;

if I have two functions that initialise each map, and the m_guiMap needs an m_fontMap entry to initialise one of its entries, so if I do:


loadGui();
loadFont();

Because loadFont() is after loadGui(), the m_fontMap won't have been initialised when loadGui() needed it, thus throwing an error. But if I swapped them around it'll work fine.

So I think somewhere in my code I've got the initialisation order wrong and it's have a scits at me xD

This topic is closed to new replies.

Advertisement