<commit_before>using UnityEngine;
using System.Collections;
using System.Runtime.InteropServices;

public class sdl2window : MonoBehaviour {	
	[DllImport ("sdl2window")]
	private static extern long  openWindow (int displayNum); 
	
	[DllImport ("sdl2window")]
	private static extern void closeWindow (long win); 
	
	[DllImport ("sdl2window")]
	private static extern int getWindowWidth (long win);
	
	[DllImport ("sdl2window")]
	private static extern int getWindowHeight (long win); 
	
	[DllImport ("sdl2window")]
	private static extern void renderWindow (long win); 
	
	[DllImport ("sdl2window")]
	private static extern void addCamera (int textureID, CamMode mode, float x, float y, float w, float h, long win);
	
	public enum CamMode {Left = 0, Right = 1, Both = 2};
	
	public int Display_Number;
	public Transform[] Cameras;
	public CamMode[] CameraModes;
	
	private long  winRef;	
	
	// Use this for initialization
	IEnumerator Start () {
		winRef = openWindow(Display_Number);
		if (Cameras.Length != CameraModes.Length) {
		 /////////////////////////  TO DO:  THROW EXCEPTION HERE
		}
		
		for (int i = 0; i < Cameras.Length; i++){
			Cameras[i].camera.targetTexture = new RenderTexture(getWidth(), getHeight(), 16, RenderTextureFormat.ARGB32);
			Cameras[i].camera.targetTexture = new RenderTexture(1024, 1024, 16, RenderTextureFormat.ARGB32);
			Cameras[i].camera.targetTexture.Create();
			addCamera (Cameras[i].camera.targetTexture.GetNativeTextureID(), CameraModes[i], 0f, 0f, 1f, 1f, winRef);
		}
		
		while (enabled){
			yield return new WaitForEndOfFrame();
			renderWindow (winRef);
		}
	}
	
	void OnApplicationQuit(){
		closeWindow (winRef);	<commit_msg>Normalized viewport now honored by sdl2window<commit_after>using UnityEngine;
using System.Collections;
using System.Runtime.InteropServices;

public class sdl2window : MonoBehaviour {	
	[DllImport ("sdl2window")]
	private static extern long  openWindow (int displayNum); 
	
	[DllImport ("sdl2window")]
	private static extern void closeWindow (long win); 
	
	[DllImport ("sdl2window")]
	private static extern int getWindowWidth (long win);
	
	[DllImport ("sdl2window")]
	private static extern int getWindowHeight (long win); 
	
	[DllImport ("sdl2window")]
	private static extern void renderWindow (long win); 
	
	[DllImport ("sdl2window")]
	private static extern void addCamera (int textureID, CamMode mode, float x, float y, float w, float h, long win);
	
	public enum CamMode {Left = 0, Right = 1, Both = 2};
	
	public int Display_Number;
	public Transform[] Cameras;
	public CamMode[] CameraModes;
	
	private long  winRef;	
	
	// Use this for initialization
	IEnumerator Start () {
		winRef = openWindow(Display_Number);
		if (Cameras.Length != CameraModes.Length) {
		 /////////////////////////  TO DO:  THROW EXCEPTION HERE
		}
		
		for (int i = 0; i < Cameras.Length; i++){
			Rect view = Cameras[i].camera.rect;
			int width =  (int) ( ((float)getWidth ()) * view.width );
			int height = (int) ( ((float)getHeight()) * view.height);
			
			Cameras[i].camera.targetTexture = new RenderTexture(width, height, 16, RenderTextureFormat.ARGB32);
			Cameras[i].camera.targetTexture.Create();
			addCamera (Cameras[i].camera.targetTexture.GetNativeTextureID(), CameraModes[i], view.x, view.y, view.width, view.height, winRef);
			
			Cameras[i].camera.rect = new Rect(0,0,1,1);
		}
		
		while (enabled){
			yield return new WaitForEndOfFrame();
			renderWindow (winRef);
		}
	}
	
	void OnApplicationQuit(){
		closeWindow (winRef);	
{'fraction_non_alphanumeric': 0.13060874535581596, 'fraction_numerical': 0.014575593026579023, 'mean_word_length': 4.177514792899408, 'pattern_counts': {'":': 0, '<': 5, '<?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': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7452393', 'n_tokens_mistral': 1242, 'n_tokens_neox': 1084, 'n_words': 321}