<commit_before>//
//  TextureMapping.hpp
//  G3MiOSSDK
//
//  Created by <NAME> on 12/07/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#ifndef G3MiOSSDK_TextureMapping_hpp
#define G3MiOSSDK_TextureMapping_hpp

//#include <vector>
#include "MutableVector2D.hpp"

class IGLTextureId;

class RenderContext;
class IFloatBuffer;

class TextureMapping {
public:
  
  virtual ~TextureMapping() {
  }
  
  virtual void bind(const RenderContext* rc) const = 0;
  
};



class SimpleTextureMapping : public TextureMapping {
private:
#ifdef C_CODE
  const IGLTextureId*  _glTextureId;
#else
  const IGLTextureId* _glTextureId;
#endif
  IFloatBuffer* _texCoords;
  const bool    _ownedTexCoords;

  MutableVector2D    _translation;
  MutableVector2D    _scale;
  
public:
  
  SimpleTextureMapping(const IGLTextureId* glTextureId,
                       IFloatBuffer* texCoords,
                       bool ownedTexCoords) :
  _glTextureId(NULL),
  _texCoords(texCoords),
  _translation(0, 0),
  _scale(1, 1),
  _ownedTexCoords(ownedTexCoords)
  {
    
  }
  
//  SimpleTextureMapping(const GLTextureId& glTextureId,
//                       std::vector<MutableVector2D> texCoords);
  
  void setTranslationAndScale(const Vector2D& translation,
                              const Vector2D& scale) {
    _translation = translation.asMutableVector2D();
    _scale       = scale.asMutableVector2D();
  }
  
  virtual ~SimpleTextureMapping();
  
  const IGLTextureId* getGLTextureId() const {
    return _glTextureId;
  }

  IFloatBuffer* getTexCoords() const { return _texCoords;}
  
  void bind(const RenderContext* rc) const;
  
};
#endif
<commit_msg>Fixing error: SimpleTextureMapping _glTextureId was set to null<commit_after>//
//  TextureMapping.hpp
//  G3MiOSSDK
//
//  Created by <NAME> on 12/07/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#ifndef G3MiOSSDK_TextureMapping_hpp
#define G3MiOSSDK_TextureMapping_hpp

//#include <vector>
#include "MutableVector2D.hpp"

class IGLTextureId;

class RenderContext;
class IFloatBuffer;

class TextureMapping {
public:
  
  virtual ~TextureMapping() {
  }
  
  virtual void bind(const RenderContext* rc) const = 0;
  
};



class SimpleTextureMapping : public TextureMapping {
private:
  const IGLTextureId* _glTextureId;
  IFloatBuffer* _texCoords;
  const bool    _ownedTexCoords;

  MutableVector2D    _translation;
  MutableVector2D    _scale;
  
public:
  
  SimpleTextureMapping(const IGLTextureId* glTextureId,
                       IFloatBuffer* texCoords,
                       bool ownedTexCoords) :
  _glTextureId(glTextureId),
  _texCoords(texCoords),
  _translation(0, 0),
  _scale(1, 1),
  _ownedTexCoords(ownedTexCoords)
  {
    
  }
  
//  SimpleTextureMapping(const GLTextureId& glTextureId,
//                       std::vector<MutableVector2D> texCoords);
  
  void setTranslationAndScale(const Vector2D& translation,
                              const Vector2D& scale) {
    _translation = translation.asMutableVector2D();
    _scale       = scale.asMutableVector2D();
  }
  
  virtual ~SimpleTextureMapping();
  
  const IGLTextureId* getGLTextureId() const {
    return _glTextureId;
  }

  IFloatBuffer* getTexCoords() const { return _texCoords;}
  
  void bind(const RenderContext* rc) const;
  
};
#endif

{'fraction_non_alphanumeric': 0.08852755194218609, 'fraction_numerical': 0.015657934357121348, 'mean_word_length': 3.1944444444444446, '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': '6951224', 'n_tokens_mistral': 1139, 'n_tokens_neox': 1076, 'n_words': 230}