CNCMaps.Engine.Rendering.VxlRenderer.Initialize C# (CSharp) Метод

Initialize() публичный Метод

public Initialize ( ) : void
Результат void
        public void Initialize()
        {
            Logger.Info("Initializing voxel renderer");
            _isInit = true;

            _surface = new DrawingSurface(400, 400, PixelFormat.Format32bppArgb);
            if (!CreateContext()) {
                Logger.Error("No graphics context could not be initialized, voxel rendering will be unavailable");
                return;
            }

            Logger.Debug("GL context created");
            try {
                Logger.Debug("GL functions loaded");

                GL.Enable(EnableCap.DepthTest);
                GL.Enable(EnableCap.ColorMaterial);

                //_vplFile = VFS.Open<VplFile>("voxels.vpl");
                _canRender = SetupFramebuffer();
            }

            catch (Exception exc) {
                Logger.Error("Voxel rendering will not be available because an exception occurred while initializing OpenGL: {0}", exc.ToString());
            }
        }