<commit_before>//
//  ofxSwapBuffer.h
//  emptyExample
//
//  Created by <NAME> on 13/01/12.
//  Copyright (c) 2012 <EMAIL>. All rights reserved.
//

#ifndef OFXSWAPBUFFER
#define OFXSWAPBUFFER

class ofxSwapBuffer {
public:
    virtual void allocate( int _width, int _height, int _internalformat = GL_RGBA){

        for(int i = 0; i < 2; i++){
            FBOs[i].allocate(_width,_height, _internalformat );
        }
        
        
        clear();
        
        // Set everything to 0
        flag = 0;
        swap();
        flag = 0;
    }
    
    virtual void swap(){
        src = &(FBOs[(flag)%2]);
        dst = &(FBOs[++(flag)%2]);
    }
    
    virtual void clear(int _alpha = 255){
        for(int i = 0; i < 2; i++){
            FBOs[i].begin();
            ofClear(0,_alpha);
            FBOs[i].end();
        }
    }
    
    ofFbo& operator[]( int n ){ return FBOs[n];}
    
    ofFbo   *src;       // Source       ->  Ping
    ofFbo   *dst;       // Destination  ->  Pong
    
private:
    ofFbo   FBOs[2];    // Real addresses of ping/pong FBO´s  
    int     flag;       // Integer for making a quick swap
};

#endif<commit_msg>get dst and src fbos<commit_after>//
//  ofxSwapBuffer.h
//  emptyExample
//
//  Created by <NAME> on 13/01/12.
//  Copyright (c) 2012 <EMAIL>. All rights reserved.
//

#ifndef OFXSWAPBUFFER
#define OFXSWAPBUFFER

class ofxSwapBuffer {
public:
    virtual void allocate( int _width, int _height, int _internalformat = GL_RGBA){

        for(int i = 0; i < 2; i++){
            FBOs[i].allocate(_width,_height, _internalformat );
        }
        
        
        clear();
        
        // Set everything to 0
        flag = 0;
        swap();
        flag = 0;
    }

	virtual ofFbo& getDstFbo(){ return *dst; }
	virtual ofFbo& getSrcFbo(){ return *src; }

    virtual void swap(){
        src = &(FBOs[(flag)%2]);
        dst = &(FBOs[++(flag)%2]);
    }
    
    virtual void clear(int _alpha = 255){
        for(int i = 0; i < 2; i++){
            FBOs[i].begin();
            ofClear(0,_alpha);
            FBOs[i].end();
        }
    }
    
    ofFbo& operator[]( int n ){ return FBOs[n];}
    
    ofFbo   *src;       // Source       ->  Ping
    ofFbo   *dst;       // Destination  ->  Pong
    
private:
    ofFbo   FBOs[2];    // Real addresses of ping/pong FBO´s  
    int     flag;       // Integer for making a quick swap
};

#endif
{'fraction_non_alphanumeric': 0.14119601328903655, 'fraction_numerical': 0.019933554817275746, 'mean_word_length': 1.6241830065359477, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '6917659', 'n_tokens_mistral': 882, 'n_tokens_neox': 840, 'n_words': 217}