コード例 #1
0
ファイル: MainWindow.cs プロジェクト: Alan-Baylis/VoxelGame
        public MainWindow() : base(1280, 720, GraphicsMode.Default, "Voxel Game")
        {
            Logger.Debug("Start...");

            Shader vshader = new Shader(ShaderType.VertexShader, "Content/Shaders/default.vs");
            Shader fshader = new Shader(ShaderType.FragmentShader, "Content/Shaders/default.fs");

            shader = new ShaderProgram(vshader, fshader);

            textureArray = new TextureArray2D(16, 16, 4);
            textureArray.SetTexture(0, new TextureData("Content/Textures/stone.png"));
            textureArray.SetTexture(1, new TextureData("Content/Textures/dirt.png"));
            textureArray.SetTexture(2, new TextureData("Content/Textures/grass.png"));
            textureArray.SetTexture(3, new TextureData("Content/Textures/topGrass.png"));
            textureArray.GenMinmaps();

            camera           = new Camera();
            mouseSensitivity = 0.005f;

            world = new World();
            world.LoadChunk(new Vector3i(0, 0, 0));
        }