Example #1
0
        public void Load(List <MemoryFile> files)
        {
            foreach (MemoryFile objT in files)
            {
                string ext = get_ext(objT.FileName);
                if (ext == ".png" || ext == ".jpg" || ext == ".bmp")
                {
                    EE.Log("add texture: " + objT.FileName);
                    using (MemoryStream b = new MemoryStream(objT.Data))
                    {
                        IResource addinit = new Texture(b, objT.FileName);
                        this._tree.Add(addinit);
                    }
                    objT.IsFree = true;
                }
                if (ext == ".mtl")
                {
                    EE.Log("add text: " + objT.FileName);
                    this._tree.Add(new UnknownResource(objT.FileName, objT.Data));
                    objT.IsFree = true;
                }
            }
            foreach (MemoryFile objT in files)
            {
                string ext = get_ext(objT.FileName);
                if (ext == ".obj")
                {
                    Obj3DModel md    = new Obj3DModel();
                    string     fname = objT.FileName;
                    fname = fname.Remove(fname.LastIndexOf('.'), 4);

                    md.Parse(this, new MemoryStream(objT.Data), fname);

                    EE.Log("add 3dModel: " + objT.FileName);
                    this._tree.Add(md);
                    objT.IsFree = true;
                }
            }



            foreach (MemoryFile objT in files)
            {
                if (!objT.IsFree)
                {
                    EE.Log("add res: " + objT.FileName);
                    this._tree.Add(new UnknownResource(objT.FileName, objT.Data));
                    objT.IsFree = true;
                }
            }
        }
Example #2
0
        private static bool _setup()
        {
            _typeList = new List <Type>();

            AddType(typeof(BoxObject));
            AddType(typeof(PlatformObject));
            AddType(typeof(MiniPlatformObject));
            AddType(typeof(WoodPlank));
            AddType(typeof(WoodDoor));
            AddType(typeof(CarObjectPickUp));

            EE.Log("MapLoader::_setup OK");
            return(true);
        }
Example #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                CarObject vs = new CarObject();
                vs.Position = new JVector(0f, 4f, 0f);

                inst.AddObject(vs);
            }

            catch (Exception ex)
            {
                EE.Log(ex.ToString());
            }
        }
Example #4
0
        public void Compile(string source)
        {
            EE.Log("Shader Compiled {0}", Type);
            GL.ShaderSource(Handle, source);
            GL.CompileShader(Handle);

            int compileStatus;

            GL.GetShader(Handle, ShaderParameter.CompileStatus, out compileStatus);

            // Если произошла ошибка, выведем сообщение
            if (compileStatus == 0)
            {
                EE.Log(GL.GetShaderInfoLog(Handle));
            }
        }