Beispiel #1
0
        public WindowManager()
        {
            //Init main window shit
            window = new RenderWindow(new VideoMode(640, 480), "Super cool window title!");
            window.SetVerticalSyncEnabled(true);
            window.SetActive(true);
            window.Closed += window_Closed;

            // Open gl
            Gl.glEnable(Gl.GL_TEXTURE_2D);
            Gl.glLoadIdentity();
            Gl.glOrtho(0, 640, 480, 0, 0, 1);
            Gl.glMatrixMode(Gl.GL_MODELVIEW);

            Gl.glDisable(Gl.GL_DEPTH_TEST);

            Gl.glLoadIdentity();
            Gl.glTranslatef(0.375f, 0.375f, 0);

            particles = new CircleShape[pcount];
            for (int i = 0; i < pcount; i++)
            {
                particles[i] = new CircleShape(4f);
                particles[i].FillColor = Color.White;
                particles[i].Position = new Vector2f(0, 0);
                particles[i].Radius = 4;
            }

            circletest = new CircleShape();
            circletest.Position = new Vector2f(100, 100);
            circletest.OutlineColor = Color.Red;
            circletest.OutlineThickness = 1;
            circletest.FillColor = Color.Black;
            circletest.Radius = 100;

            circletest2 = new CircleShape();
            circletest2.Position = new Vector2f(200, 300);
            circletest2.OutlineColor = Color.Red;
            circletest2.OutlineThickness = 1;
            circletest2.FillColor = Color.Black;
            circletest2.Radius = 100;

            mytext = new Text("test", new Font("arial.ttf"), 16);
            mytext.Position = new Vector2f(4, 4);
            mytext.Color = Color.White;
            mytext.Style = Text.Styles.Bold;

            mytextShadow = new Text("test", new Font("arial.ttf"), 16);
            mytextShadow.Position = new Vector2f(6, 6);
            mytextShadow.Color = Color.Black;

            sim = new Simulation();
            sim.InitSimulation(pcount);
        }