Exemple #1
0
        protected override void OnLoad()
        {
            _engine.InitializeGL();
            _fontRenderer.InitalizeGL();
            foreach (var ch in Character.Characters)
            {
                ch.Value.InitializeGL();
            }
            _freeType.Done();

            var text = Texture.LoadFromFile("./Resources/text.jpg");

            Texture.RegisterTexture("texture", text);

            var shader = new Shader("./Resources/shader.vert", "./Resources/shader.frag");

            Shader.RegisterShader("shader", shader);

            var mat = new Material();

            mat.Shader  = shader;
            mat.Texture = text;
            Material.RegisterMaterial("Mesh", mat);

            var lightshader = new Shader("./Resources/shader.vert", "./Resources/lightShader.frag");

            Shader.RegisterShader("lightShader", lightshader);

            var lightMat = new Material
            {
                Shader  = lightshader,
                Texture = text
            };

            Material.RegisterMaterial("lightMat", lightMat);

            var model = new Model("./Resources/untitled1.obj");

            Model.RegisterModel("test", model);

            Light = new Light();

            var cube = new Cube();

            _world.AddObject(cube);
            LightID = _world.AddObject(Light);

            CursorGrabbed = true;

            base.OnLoad();
        }
Exemple #2
0
        protected override void OnLoad()
        {
            _engine.InitializeGL();
            _model.InitializeGL();
            _fontRenderer.InitalizeGL();
            foreach (var ch in Character.Characters)
            {
                ch.Value.InitializeGL();
            }
            _freeType.Done();
            _texture = Texture.LoadFromFile("Resources/text.jpg");

            CursorGrabbed = true;



            base.OnLoad();
        }