<commit_before>#ifndef SRC_ABSTRACT_SCENE_H_

#define SRC_ABSTRACT_SCENE_H_

class QOpenGLContext;

class AbstractScene
{
 public:
  AbstractScene() : mContext(0)
  {
  }
  virtual ~AbstractScene()
  {
  }

  void setContext(QOpenGLContext *context)
  {
    mContext = context;
  }

  QOpenGLContext *context() const
  {
    return mContext;
  }

  virtual void initialize() = 0;

  virtual void update(float t) = 0;

  virtual void render() = 0;

  virtual void resize(int width, int height) = 0;

 protected:
  QOpenGLContext *mContext;
};

#endif  // SRC_ABSTRACT_SCENE_H_<commit_msg>Initialize QOpenGLFunctions in AbstractScene.<commit_after>#ifndef SRC_ABSTRACT_SCENE_H_

#define SRC_ABSTRACT_SCENE_H_

#include <QOpenGLContext>
#include <QOpenGLFunctions_4_3_Core>
#include <QtDebug>

#include "./gl_assert.h"

class AbstractScene
{
 public:
  AbstractScene() : mContext(0)
  {
  }
  virtual ~AbstractScene()
  {
  }

  void setContext(QOpenGLContext *context)
  {
    mContext = context;
    gl = context->versionFunctions<QOpenGLFunctions_4_3_Core>();
    if (!gl) {
        qWarning() << "Could not obtain required OpenGL context version";
        exit(1);
    }
    gl->initializeOpenGLFunctions();
    glCheckError();
  }

  QOpenGLContext *context() const
  {
    return mContext;
  }

  virtual void initialize() = 0;

  virtual void update(float t) = 0;

  virtual void render() = 0;

  virtual void resize(int width, int height) = 0;

 protected:
  QOpenGLContext *mContext;
  QOpenGLFunctions_4_3_Core *gl;
};

#endif  // SRC_ABSTRACT_SCENE_H_
{'fraction_non_alphanumeric': 0.10519563822963438, 'fraction_numerical': 0.010904425914047467, 'mean_word_length': 3.875, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4585509', 'n_tokens_mistral': 579, 'n_tokens_neox': 549, 'n_words': 121}