protected override void OnLoad(EventArgs e) { // called upon app init GL.ClearColor(Color.Black); GL.Enable(EnableCap.Texture2D); GL.Disable(EnableCap.DepthTest); GL.Hint(HintTarget.PerspectiveCorrectionHint, HintMode.Nicest); ClientSize = new Size(1024, 512); rayTracer = new Raytracer(); rayTracer.screen = new Surface(Width, Height); rayTracer.Init(); Sprite.target = rayTracer.screen; screenID = rayTracer.screen.GenTexture(); }
protected override void OnLoad(EventArgs e) { // called upon app init GL.ClearColor(Color.Black); GL.Enable(EnableCap.Texture2D); GL.Disable(EnableCap.DepthTest); GL.Hint(HintTarget.PerspectiveCorrectionHint, HintMode.Nicest); ClientSize = new Size(1024, 512); raytracer = new Raytracer { scene = new Scene(), camera = new Camera(new Vector3(0, 0, 0), new Vector3(0.0f, 0, 1.0f)), screen = new Surface(screenSize, screenSize, Vector3.Zero, Vector3.Zero, Vector3.Zero), screenDebug = new Surface(screenDebugSize, screenDebugSize, Vector3.Zero, Vector3.Zero, Vector3.Zero) }; Sprite.target = raytracer.screen; screenID = raytracer.screen.GenTexture(); screenIDDebug = raytracer.screenDebug.GenTexture(); raytracer.Init(); }