Opening SFML window gives memory read error

后端 未结 2 1279
温柔的废话
温柔的废话 2021-01-28 21:14

I\'m trying to open a SFML window, but every time it is launched it says \"Access violation reading location: 0xCCCCCCC0.\" The error is occuring in the init() method. Relevant

2条回答
  •  渐次进展
    2021-01-28 21:36

    Set window to a RenderWindow *window;

    and create it with

    window = new sf::RenderWindow( /*your stuff or default initialize*/ );
    

    and then call

    window->create( /*your settings*/ );
    

    if you didn't already initialize it.

    From then on just access window using '->' instead of '.'

提交回复
热议问题