Material() public static method

public static Material ( MaterialFace face, MaterialParameter pname, Color4 @params ) : void
face MaterialFace
pname MaterialParameter
@params Color4
return void
Ejemplo n.º 1
0
 public static void Material(MaterialFace face, MaterialParameter pname, Color4 @params)
 {
     unsafe { GL.Material(face, pname, (float *)&@params); }
 }
Ejemplo n.º 2
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            GL.ClearColor(0.0f, 0.0f, 0.0f, 0.0f);

            GL.Material(TK.MaterialFace.Front, TK.MaterialParameter.Specular, mat_specular);
            GL.Material(TK.MaterialFace.Front, TK.MaterialParameter.Shininess, mat_shininess);
            GL.Light(TK.LightName.Light0, TK.LightParameter.Position, light_position);
            GL.Light(TK.LightName.Light0, TK.LightParameter.Ambient, light_ambient);
            GL.Light(TK.LightName.Light0, TK.LightParameter.Diffuse, mat_specular);

            GL.Enable(TK.EnableCap.CullFace);
            GL.Enable(TK.EnableCap.DepthTest);
            GL.ShadeModel(TK.ShadingModel.Smooth);
            GL.Enable(TK.EnableCap.ColorMaterial);
            GL.Enable(TK.EnableCap.Blend);
            GL.BlendFunc(TK.BlendingFactorSrc.SrcAlpha, TK.BlendingFactorDest.OneMinusSrcAlpha);
            GL.PolygonMode(TK.MaterialFace.FrontAndBack, TK.PolygonMode.Fill);

            GL.Viewport(0, 0, Width, Height);
            aspect_ratio = Width / (float)Height;
            checkAspectRatio();
            width  *= wp_scale_factor;
            height *= wp_scale_factor;

            VSync  = VSyncMode.On;
            eye    = new Vector3(0, 0, height * 1.5f);
            target = new Vector3(0, 0, 0);
            up     = new Vector3(0, 1, 0);
            fov    = (int)Math.Round(height * 0.75f);

            old_mouse = OpenTK.Input.Mouse.GetState();
            old_key   = OpenTK.Input.Keyboard.GetState();

            bodies = new List <Body>();

            generateRandomBodies(number_of_bodies, true);
            calculateGridEdge();
            foreach (Body body in bodies)
            {
                body.updateBoundingSphere();
                body.getBSphere().checkForCellIntersection();
            }

            mouse        = OpenTK.Input.Mouse.GetState();
            coord_transf = Screen.PrimaryScreen.Bounds.Height / 27f;

            timeSinceStart = new Stopwatch();
            timeSinceStart.Start();
            elaspedTime = timeSinceStart.ElapsedMilliseconds;
            Program.cd.InitializePlatformPropertiesAndDevices();
            Program.cd.deviceSpecs();
            Program.cd.ReadAllSources();
            Program.cd.CreateCollisionCellArray();
            Program.t.Start();
            while (Program.ready == false)
            {
                ;
            }
        }