почему вылетает window->draw()?

#include <iostream>

#include <SFML/Graphics.hpp>

const sf::Color colorArray[3] = { sf::Color::Red, sf::Color::Blue, sf::Color::Green };
const sf::Color colorSelect = { sf::Color::Yellow };
const int Thickness = 3;
const float FPS = 30.0f;
const int QUESTFONTSIZE = 50;

//текст вопроса
class TextFrameBase {
    int size;//размер шрифта
    std::string question;
public: TextFrameBase(int size) : size(size) {}
      void setTextQuest(std::string q) { question = q; }
      sf::Text *  printQuestion();

};

sf::Text * TextFrameBase::printQuestion() {

   
sf::Font font;//шрифт
font.loadFromFile("Arial_Narrow.ttf");
sf::Text* text = new sf::Text("", font, 20);
text->setFillColor(sf::Color::Red);
//text.setStyle(sf::Text::Bold | sf::Text::Underlined);
text->setString(L"Тестовое задание:");
text->setPosition(50, 50);
return text;

}
class Frame : public TextFrameBase {
    sf::RenderWindow *window; //сам экран
    int width;  //ширина 
    int height; //высота экрана 
    int space;
    int number; //номер вопроса
public: Frame(int w, int h) : width(w), height(h), space(0), TextFrameBase(QUESTFONTSIZE) {
    window = new sf::RenderWindow(sf::VideoMode( w,h), "Game");
    //window->setFramerateLimit(FPS);

};
      void View() {
          sf::RectangleShape List(sf::Vector2f(width, height));  
          List.setPosition(0, 0);
          List.setFillColor(sf::Color::White);
          //sf::CircleShape shape(100.f);
          //shape.setFillColor(sf::Color::Green);
          sf::Text * text = printQuestion();



          while (window->isOpen()) {
              sf::Event event;
              while (window->pollEvent(event)) {
                  if (event.type == sf::Event::Closed) {
                      window->close();
                  }

              }
              window->clear();
              //window->draw(List);



              window->draw(* text);
              window->display();
          }
  

      };
      ~Frame() {}
};

class PictureFrameBase {};
class NumberFrameBase {};
//вопрос. Контейнер содержит сверху вниз объекты: текст вопроса, картинка(может быть , а может нет, работает в двух режимах - режим вопроса, режим ответа),
//текст правильного ответа(может быть , а может нет)
class QuestionBase {
    TextFrameBase txt;
    //PictureFrameBase pic;
    //NumberFrameBase Num;
};




int main(int count, char** arr) {
    Frame test(1200,500);
    test.View();
    
}

Ответы (0 шт):