コード例 #1
0
ファイル: MyWindow.cs プロジェクト: masi456/OGLTest
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            GL.Enable(EnableCap.DebugOutput);
            GL.Enable(EnableCap.DebugOutputSynchronous);
            int[] arr = { };
            GL.DebugMessageControl(DebugSourceControl.DontCare, DebugTypeControl.DontCare, DebugSeverityControl.DontCare, 0, arr, true);
            GL.DebugMessageCallback(MessageHandler, IntPtr.Zero);

            GL.ClearColor(Color4.Black);

            GameState.Initialize();

            _program = new ShaderProgram();
            _program.AddShader(ShaderType.VertexShader, ReadShader("vertex.s"));
            _program.AddShader(ShaderType.FragmentShader, ReadShader("fragment.s"));
            _program.LinkProgram();

            _skyboxProgram = new ShaderProgram();
            _skyboxProgram.AddShader(ShaderType.VertexShader, ReadShader("skybox_vertex.s"));
            _skyboxProgram.AddShader(ShaderType.FragmentShader, ReadShader("skybox_fragment.s"));
            _skyboxProgram.LinkProgram();

            _debugProgram = new ShaderProgram();
            _debugProgram.AddShader(ShaderType.VertexShader, ReadShader("debug_vertex.s"));
            _debugProgram.AddShader(ShaderType.FragmentShader, ReadShader("debug_fragment.s"));
            _debugProgram.LinkProgram();

            _world = new World();
            _collisionController = new CollisionController(_world);
            _blockController     = new BlockController(_world);

            var playerCamera = new Camera(_width, _height);

            _player = new Player(playerCamera, _collisionController, _blockController);
            _skybox = new Skybox();

            GL.PatchParameter(PatchParameterInt.PatchVertices, 3);
        }
コード例 #2
0
ファイル: LightController.cs プロジェクト: masi456/OGLTest
 public LightController(CollisionController collisionController)
 {
     _collisionController = collisionController;
 }
コード例 #3
0
 public Player(Camera camera, CollisionController collisionController, BlockController blockController)
 {
     _collisionController = collisionController;
     _blockController     = blockController;
     Camera = camera;
 }