<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 G3MRenderContext;
class IFloatBuffer;
class GLGlobalState;
class GPUProgramState;
class GLState;
class TexturesHandler;

class TextureMapping {
public:
  
  virtual ~TextureMapping() {
  }
  
  virtual bool isTransparent() const = 0;
  
  virtual void modifyGLState(GLState& state) const = 0;
};



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

  MutableVector2D _translation;
  MutableVector2D _scale;

  const bool _isTransparent;

  void releaseGLTextureId();
  TexturesHandler* _texturesHandler;

public:<commit_msg>fixed opengl memory bug on SimpleTextureMapping - the texture was not release from the GPU<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 G3MRenderContext;
class IFloatBuffer;
class GLGlobalState;
class GPUProgramState;
class GLState;
class TexturesHandler;

class TextureMapping {
public:
  
  virtual ~TextureMapping() {
  }
  
  virtual bool isTransparent() const = 0;
  
  virtual void modifyGLState(GLState& state) const = 0;
};



class SimpleTextureMapping : public TextureMapping {
private:
#ifdef C_CODE
  const IGLTextureId* _glTextureId;
#endif
#ifdef JAVA_CODE
  private IGLTextureId _glTextureId;
#endif

  IFloatBuffer* _texCoords;
  const bool    _ownedTexCoords;

  MutableVector2D _translation;
  MutableVector2D _scale;

  const bool _isTransparent;

  void releaseGLTextureId();
  TexturesHandler* _texturesHandler;

public:
{'fraction_non_alphanumeric': 0.08062166100048568, 'fraction_numerical': 0.018455560951918408, 'mean_word_length': 4.674931129476584, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '6336202', 'n_tokens_mistral': 730, 'n_tokens_neox': 671, 'n_words': 177}