Example #1
0
        /// <summary>Load resources here.</summary>
        protected override void OnLoad(EventArgs e)
        {
            GL.ClearColor(System.Drawing.Color.Blue);
            GL.Enable(EnableCap.DepthTest);
            GL.Enable(EnableCap.Texture2D);
            GL.Hint(HintTarget.PerspectiveCorrectionHint, HintMode.Nicest);
            GL.Enable(EnableCap.CullFace);
            GL.ShadeModel(ShadingModel.Smooth);
            GL.Enable(EnableCap.Normalize);
            GL.Enable(EnableCap.ColorMaterial);

            Light.Enable();
            Light light=new Light("light");
            light.Position = new Vector3(20, 50, 0);
            light.Ambient = new Vector3(0.8f, 0.8f, 0.8f);
            Light.Add(light, 0);

            light = new Light("light2");
            light.Position = new Vector3(-40, 50, 50);
            light.Ambient = new Vector3(0.8f, 0.8f, 0.8f);
            Light.Add(light, 1);

            obj = new ObjModel("scene", "skene.obj", 20, 20, 20);
            skybox.LoadSkybox("sky/sky2_", "jpg", 100);
            tex = Texture.Load("1.png");

            cam.Position.Y = 10;

            Util.Set3DMode();
        }
Example #2
0
 public static void Add(Light light, int lightNum)
 {
     light.lightNum = lightNum;
     light.SetLight(true);
     Lights.Add(light);
 }
Example #3
0
 public static void Dispose(Light light)
 {
     Lights.Remove(light);
     Log.WriteDebugLine("Disposed: Light");
 }
Example #4
0
 public static void Remove(Light light)
 {
     light.SetLight(false);
     Lights.Remove(light);
 }