Okay here's a minimum example of the trouble I am having.
#include <SFML/Graphics.hpp>
#include "include/MyObject.h"
int main()
{
sf::RenderWindow MyRenderWindow(sf::VideoMode(640, 320, 32), "Title");
MyObject MyObjectInstance;
MyObjectInstance.CreateRenderImage();
while (MyRenderWindow.IsOpened())
{
sf::Event Event;
while (MyRenderWindow.PollEvent(Event))
{
if (Event.Type == sf::Event::Closed)
MyRenderWindow.Close();
}
MyRenderWindow.Clear();
MyRenderWindow.Display();
}
return EXIT_SUCCESS;
}
MyObject.cpp
#include "MyObject.h"
MyObject::MyObject()
{
}
MyObject::~MyObject()
{
}
void MyObject::CreateRenderImage(void)
{
sf::RenderImage MyRenderImage;
MyRenderImage.Create(30, 30); // MyRenderWindow stops drawing. Code after this would execute though.
}