示例#1
0
        protected override void Initialize()
        {
            texture = Content.Load <Texture2D> ("particles_test.png", TextureConfiguration.Nearest);

            program = Content.Load <ShaderProgram> ("particle");

            positions = new GLBuffer <Vector4> (GLBufferSettings.StaticDraw4FloatArray, pos);
            texCoords = new GLBuffer <Vector2> (GLBufferSettings.StaticDraw2FloatArray, textureCoords);
            colors    = new GLBuffer <Vector4> (GLBufferSettings.StaticDraw4FloatArray, col);

            abo = GL.GenVertexArray();
            GL.BindVertexArray(abo);
            positions.PointTo(program.Attrib("v_pos"));
            texCoords.PointTo(program.Attrib("v_tex"));
            colors.PointTo(program.Attrib("v_col"));

            camera = new Camera(60f, Resolution, 0.1f, 64f);

            camera.SetRelativePosition(new Vector3(0, 0, 5));

            base.Initialize();
        }
示例#2
0
        protected override void Initialize()
        {
            texture = Content.Load<Texture2D> ("particles_test.png", TextureConfiguration.Nearest);

            program = Content.Load<ShaderProgram> ("particle");

            positions = new GLBuffer<Vector4> (GLBufferSettings.StaticDraw4FloatArray, pos);
            texCoords = new GLBuffer<Vector2> (GLBufferSettings.StaticDraw2FloatArray, textureCoords);
            colors = new GLBuffer<Vector4> (GLBufferSettings.StaticDraw4FloatArray, col);

            abo = GL.GenVertexArray ();
            GL.BindVertexArray (abo);
            positions.PointTo (program.Attrib ("v_pos"));
            texCoords.PointTo (program.Attrib ("v_tex"));
            colors.PointTo (program.Attrib ("v_col"));

            camera = new Camera (60f, Resolution, 0.1f, 64f);

            camera.SetRelativePosition (new Vector3 (0, 0, 5));

            base.Initialize ();
        }