예제 #1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            instance = this;

            MouseWheel += Form1_MouseWheel;
            //string S = Application.LocalUserAppDataPath;

            GraphicsMode graphicsMode = new GraphicsMode(new ColorFormat(8, 8, 8, 8), 24, 8, 4);

            GLcontrol = new GLControl(graphicsMode, 6, 4, GraphicsContextFlags.ForwardCompatible);
            //GLcontrol = new GLControl(graphicsMode);

            GLcontrol.Dock   = DockStyle.Fill;
            WindowState      = FormWindowState.Maximized;
            GLcontrol.Parent = this;
            int w = GLcontrol.Width;
            int h = GLcontrol.Height;


            T.Interval = 10;
            T.Tick    += T_Tick;
            T.Start();
            //ShaderId = GL.CreateShader(ShaderType.ComputeShader);
            //ShaderController = new ShaderController(w,h);
            ShaderController.GenreateComputeProgram();
            ShaderController.GenerateFragProgram();
            GLcontrol.MakeCurrent();
            SetOrthographicProjection(0, 0, w, h);
            GL.Viewport(0, 0, w, h);
            Main = new Main(GLcontrol.Size);
            //Console.WriteLine();
        }
예제 #2
0
        LocationData GetDataFromWindow(ShaderController controller)
        {
            LocationData dat = new LocationData();

            dat.CameraPosition        = controller.CameraPos;
            dat.Iterations            = controller.Iterations;
            dat.Angle                 = controller.Angle;
            dat.LogarithmicZoomFactor = Math.Log(controller.Zoom);
            dat.CoefficientArray      = controller.CoefficientArray;
            return(dat);
        }
예제 #3
0
 public BuddhaShaderController(ShaderController parentController)
 {
     this.parentController = parentController;
     mWidth          = parentController.mWidth;
     mHeight         = parentController.mHeight;
     computeShaderId = SetupComputeProgram(Encoding.Default.GetString(Resources.BuddhaCompute));
     colorTexR       = GenerateIntTex("BuddhaTexR");
     colorTexG       = GenerateIntTex("BuddhaTexG");
     colorTexB       = GenerateIntTex("BuddhaTexB");
     BufferIndex     = GL.GenBuffer();
     SetCamera(new Complex(-0.0443594, -0.986749), 0.01);
     //Start();
     CurrentComputationIndex = -100;
     PermutationFactor       = GetPermutationFactor();
     PermutationCycleLength  = GetPermutationCycleLength();
 }