Click here to Skip to main content
15,884,836 members
Articles / Multimedia / OpenGL

DataLink Simulator

Rate me:
Please Sign up or sign in to vote.
4.88/5 (19 votes)
6 Feb 2010CPOL3 min read 94.1K   5.6K   20  
A C# simulation for DataLink layer using OpenGl
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tao.OpenGl;

namespace DataLinkSimulator
{
    class clssSqaure
    {
        float fxpos, fypos, fvec_X;
        double[] Square_Color;
        public clssSqaure(float fxpos, float fypos,float fvec_X, double[] Square_Color)
        {
            this.fxpos = fxpos;
            this.fypos = fypos;
            this.fvec_X = fvec_X;
            this.Square_Color = Square_Color;
        }
        public void Move()
        {
            Gl.glTranslatef(fxpos, fypos, 0);
            DrawSquare();
            Gl.glLoadIdentity();
        }
        public float Fxpos
        {
            get { return fxpos; }
            set { fxpos = value; }
        }
        public float Fvec_X
        {
            get { return fvec_X; }
        }
        private void DrawSquare()
        {
            Gl.glBegin(Gl.GL_QUADS);

            Gl.glColor3dv(Square_Color);
            Gl.glVertex2d(10, 10);
            Gl.glVertex2d(-10, 10);
            Gl.glVertex2d(-10, -10);
            Gl.glVertex2d(10, -10);

            Gl.glEnd();
        }

    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
Egypt Egypt
Enthusiastic programmer/researcher, passionate to learn new technologies, interested in problem solving, data structures, algorithms, AI, machine learning and nlp.

Amateur guitarist/ keyboardist, squash player.

Comments and Discussions