Exemplo n.º 1
0
        public static void Start(Game gameInstance)
        {
            Console.ForegroundColor = ConsoleColor.Gray;
            Logger.AddStickyInfo("voxaInfo", new LoggerMessage("V O X A - Lite 3D Engine v" + VERSION_MAJOR + "." + VERSION_MINOR, ConsoleColor.Cyan));
            Logger.Info("Starting Voxa Engine v" + VERSION_MAJOR + "." + VERSION_MINOR);
            game           = gameInstance;
            engineWindow   = new EngineWindow(gameInstance.WINDOW_WIDTH, gameInstance.WINDOW_HEIGHT);
            renderingPool  = new RenderingPool();
            uniformManager = new UniformManager();

            engineWindow.Run(gameInstance.TARGET_UPDATE_RATE, 0);
        }
Exemplo n.º 2
0
        public static void Start(Game gameInstance)
        {
            Console.ForegroundColor = ConsoleColor.Gray;
            Logger.AddStickyInfo("voxaInfo", new LoggerMessage("V O X A - Lite 3D Engine v" + VERSION_MAJOR + "." + VERSION_MINOR, ConsoleColor.Cyan));
            Logger.Info("Starting Voxa Engine v" + VERSION_MAJOR + "." + VERSION_MINOR);
            Game           = gameInstance;
            EngineWindow   = new EngineWindow(gameInstance.Config.WindowWidth, gameInstance.Config.WindowHeight, gameInstance.Config.Fullscreen, gameInstance.Config.WindowTitle, gameInstance.Config.LockMouse);
            RenderingPool  = new RenderingPool();
            UniformManager = new UniformManager();
            TaskQueue      = new TaskQueue();
            FontLibrary    = new Library();

            EngineWindow.Run(gameInstance.Config.TargetUpdateRate, 0);
        }
Exemplo n.º 3
0
        public PICACommandReader(uint[] Cmds)
        {
            Commands = new List <PICACommand>();

            VtxShader = new UniformManager();
            GeoShader = new UniformManager();

            int Index = 0;

            while (Index < Cmds.Length)
            {
                uint Parameter = Cmds[Index++];
                uint Command   = Cmds[Index++];

                uint Id          = (Command >> 0) & 0xffff;
                uint Mask        = (Command >> 16) & 0xf;
                uint ExtraParams = (Command >> 20) & 0x7ff;
                bool Consecutive = (Command >> 31) != 0;

                if (Consecutive)
                {
                    for (int i = 0; i < ExtraParams + 1; i++)
                    {
                        PICACommand Cmd = new PICACommand()
                        {
                            Register   = (PICARegister)Id++,
                            Parameters = new uint[] { Parameter },
                            Mask       = Mask
                        };

                        CheckVtxUniformsCmd(Cmd);
                        CheckGeoUniformsCmd(Cmd);

                        Commands.Add(Cmd);

                        if (i < ExtraParams)
                        {
                            Parameter = Cmds[Index++];
                        }
                    }
                }
                else
                {
                    List <uint> Parameters = new List <uint> {
                        Parameter
                    };

                    for (int i = 0; i < ExtraParams; i++)
                    {
                        Parameters.Add(Cmds[Index++]);
                    }

                    PICACommand Cmd = new PICACommand()
                    {
                        Register   = (PICARegister)Id,
                        Parameters = Parameters.ToArray(),
                        Mask       = Mask
                    };

                    CheckVtxUniformsCmd(Cmd);
                    CheckGeoUniformsCmd(Cmd);

                    Commands.Add(Cmd);
                }

                //Commands must be padded in 8 bytes blocks, so Index can't be even!
                if ((Index & 1) != 0)
                {
                    Index++;
                }
            }
        }