<commit_before>package com.badlogic.gdx.backends.jogl;

import java.awt.image.BufferedImage;
import java.io.InputStream;

import javax.imageio.ImageIO;
import javax.media.opengl.GL;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLCanvas;
import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLEventListener;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Graphics;
import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.graphics.GL11;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.GLCommon;
import com.badlogic.gdx.graphics.Pixmap;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.Pixmap.Format;
import com.badlogic.gdx.graphics.Texture.TextureFilter;
import com.badlogic.gdx.graphics.Texture.TextureWrap;
import com.badlogic.gdx.math.WindowedMean;
import com.badlogic.gdx.utils.GdxRuntimeException;
import com.sun.opengl.util.Animator;

public abstract class JoglGraphicsBase implements Graphics, GLEventListener {
	GLCanvas canvas;
	Animator animator;	
	boolean useGL2;
	long frameStart = System.nanoTime();
	long lastFrameTime = System.nanoTime();
	float deltaTime = 0;
	WindowedMean mean = new WindowedMean(10);
	int fps;
	int frames;
	boolean paused = true;
	
	GLCommon gl;
	GL10 gl10;
	GL11 gl11;
	GL20 gl20;
	
	void initialize(String title, int width, int height, boolean useGL2) {
		GLCapabilities caps = new GLCapabilities();
		caps.setRedBits(8);
		caps.setGreenBits(8);
		caps.setBlueBits(8);
		caps.setAlphaBits(8);
		caps.setDepthBits(16);
		caps.setStencilBits(8);
		caps.setNumSamples(0);
		caps.setSampleBuffers(false);
		caps.setDoubleBuffered(true);
		
		canvas = new GLCanvas(caps);

		canvas.addGLEventListener(this);
		this.useGL2 = useGL2;
	}
	
	GLCanvas getCanvas() {
		return canvas;
	}

	void create() {		
		frameStart = System.nanoTime();
		lastFrameTime = frameStart;
		deltaTime = 0;
		mean.clear();	
		animator = new Animator(canvas);
		animator.setRunAsFastAsPossible(true);
		animator.start();
	}

	void pause() {
		synchronized (this) {
			paused = true;
		}
		animator.stop();
	}
	<commit_msg>[changed] Animator doesn't run as fast as possible anymore<commit_after>package com.badlogic.gdx.backends.jogl;

import java.awt.image.BufferedImage;
import java.io.InputStream;

import javax.imageio.ImageIO;
import javax.media.opengl.GL;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLCanvas;
import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLEventListener;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Graphics;
import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.graphics.GL11;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.GLCommon;
import com.badlogic.gdx.graphics.Pixmap;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.Pixmap.Format;
import com.badlogic.gdx.graphics.Texture.TextureFilter;
import com.badlogic.gdx.graphics.Texture.TextureWrap;
import com.badlogic.gdx.math.WindowedMean;
import com.badlogic.gdx.utils.GdxRuntimeException;
import com.sun.opengl.util.Animator;

public abstract class JoglGraphicsBase implements Graphics, GLEventListener {
	GLCanvas canvas;
	Animator animator;	
	boolean useGL2;
	long frameStart = System.nanoTime();
	long lastFrameTime = System.nanoTime();
	float deltaTime = 0;
	WindowedMean mean = new WindowedMean(10);
	int fps;
	int frames;
	boolean paused = true;
	
	GLCommon gl;
	GL10 gl10;
	GL11 gl11;
	GL20 gl20;
	
	void initialize(String title, int width, int height, boolean useGL2) {
		GLCapabilities caps = new GLCapabilities();
		caps.setRedBits(8);
		caps.setGreenBits(8);
		caps.setBlueBits(8);
		caps.setAlphaBits(8);
		caps.setDepthBits(16);
		caps.setStencilBits(8);
		caps.setNumSamples(0);
		caps.setSampleBuffers(false);
		caps.setDoubleBuffered(true);
		
		canvas = new GLCanvas(caps);

		canvas.addGLEventListener(this);
		this.useGL2 = useGL2;
	}
	
	GLCanvas getCanvas() {
		return canvas;
	}

	void create() {		
		frameStart = System.nanoTime();
		lastFrameTime = frameStart;
		deltaTime = 0;
		mean.clear();	
		animator = new Animator(canvas);
//		animator.setRunAsFastAsPossible(true);
		animator.start();
	}

	void pause() {
		synchronized (this) {
			paused = true;
		}
		animator.stop();
	}
	
{'fraction_non_alphanumeric': 0.1145524937371897, 'fraction_numerical': 0.015486221817353677, 'mean_word_length': 4.9271255060728745, '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': '3113388', 'n_tokens_mistral': 1719, 'n_tokens_neox': 1565, 'n_words': 292}