<commit_before>package hu.qgears.opengl.commons;

import hu.qgears.images.NativeImage;
import hu.qgears.images.SizeInt;
import hu.qgears.opengl.commons.context.RGlContext;

import org.lwjgl.LWJGLException;
import org.lwjgl.opengl.EXTFramebufferObject;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL30;

/**
 * Render on texture functionality using 
 * using EXTFramebufferObject
 * (instead of OpenGL 3.0 - framebuffer object.)
 * 
 * TODO - leaks memory after dispose - allocate a single one and reuse!
 * 
 * @author adam, rizsi
 *
 */
public class RenderOnTextureFBO extends AbstarctRenderOnTexture implements IRenderOnTexture {
	private Texture target;	
	private boolean disposed=false;

	private boolean depthBuffer=false;
	private int rbId=-1;
	private int fbId=-1;
	private static int numberOfROT;
	private static int rotCreated;

	public static void textureCreated() {
		numberOfROT++;
		rotCreated++;
	}
	public static void textureDisposed() {
		numberOfROT--;
	}
	
	public static int getNumberOfROT() {
		return numberOfROT;
	}
	
	public static int getRotCreated() {
		return rotCreated;
	}
	
	public RenderOnTextureFBO(Texture target, boolean needDephBuffer) throws LWJGLException
	{
		this.target=target;
		this.depthBuffer=needDephBuffer;
		init(target.getSize());
		textureCreated();
	}
	private void init(SizeInt size) throws LWJGLException<commit_msg>Make increment and decrement methods private. Add since tags to public methods.<commit_after>package hu.qgears.opengl.commons;

import hu.qgears.images.NativeImage;
import hu.qgears.images.SizeInt;
import hu.qgears.opengl.commons.context.RGlContext;

import org.lwjgl.LWJGLException;
import org.lwjgl.opengl.EXTFramebufferObject;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL30;

/**
 * Render on texture functionality using 
 * using EXTFramebufferObject
 * (instead of OpenGL 3.0 - framebuffer object.)
 * 
 * TODO - leaks memory after dispose - allocate a single one and reuse!
 * 
 * @author adam, rizsi
 *
 */
public class RenderOnTextureFBO extends AbstarctRenderOnTexture implements IRenderOnTexture {
	private Texture target;	
	private boolean disposed=false;

	private boolean depthBuffer=false;
	private int rbId=-1;
	private int fbId=-1;
	private static int numberOfROT;
	private static int rotCreated;

	private static void textureCreated() {
		numberOfROT++;
		rotCreated++;
	}
	private static void textureDisposed() {
		numberOfROT--;
	}
	
	
	/**
	 * @since 6.0
	 */
	public static int getNumberOfROT() {
		return numberOfROT;
	}
	
	/**
	 * @since 6.0 
	 */
	public static int getRotCreated() {
		return rotCreated;
	}
	
	public RenderOnTextureFBO(Texture target, boolean needDephBuffer) throws LWJGLException
	{
		this.target=target;
		this.depthBuffer=needDephBuffer;
		init(target.getSize());
		textureCreated();
	}
	private void init(SizeInt size) throws LWJGLException
{'fraction_non_alphanumeric': 0.0911304347826087, 'fraction_numerical': 0.006956521739130435, 'mean_word_length': 4.584466019417476, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '380259', 'n_tokens_mistral': 1011, 'n_tokens_neox': 934, 'n_words': 240}