Exemple #1
0
        private RenderContext(ManaWindow window)
        {
            ID = ++_renderContextID;

            Window        = window;
            OpenGLContext = CreateOffscreenContext();

            _selfCreatedWindow = true;

            /* Initialize */

#if DEBUG
            DebugMessageHandler.Initialize();
#endif

            GLInfo.Initialize();
            VertexTypeInfo.Initialize();

            int vao = GL.GenVertexArray();
            GL.BindVertexArray(vao);

            if (GLInfo.HasDebug)
            {
                string labelName = "Unused VertexArray";
                GL.ObjectLabel(ObjectLabelIdentifier.VertexArray, vao, labelName.Length, labelName);
            }

            TextureUnits = new TextureUnit[GLInfo.MaxTextureImageUnits];

            /* */
        }
Exemple #2
0
        private RenderContext(ManaWindow window, IGraphicsContext openGLContext)
        {
            ID = ++_renderContextID;

            Window        = window;
            OpenGLContext = openGLContext;

            ThreadID = Thread.CurrentThread.ManagedThreadId;
            _threadLocalCurrent.Value = this;

            /* Initialize */

#if DEBUG
            DebugMessageHandler.Initialize();
#endif

            GLInfo.Initialize();
            VertexTypeInfo.Initialize();

            int vao = GL.GenVertexArray();
            GL.BindVertexArray(vao);

            if (GLInfo.HasDebug)
            {
                string labelName = "Unused VertexArray";
                GL.ObjectLabel(ObjectLabelIdentifier.VertexArray, vao, labelName.Length, labelName);
            }

            TextureUnits = new TextureUnit[GLInfo.MaxTextureImageUnits];

            /* */
        }
Exemple #3
0
        private void InitializeState()
        {
            DebugMessageHandler.Initialize();

            GLInfo.Initialize();

            int vao = GL.GenVertexArray();

            GL.BindVertexArray(vao);

            if (GLInfo.HasDebug)
            {
                string labelName = "Unused VertexArray";
                GL.ObjectLabel(ObjectLabelIdentifier.VertexArray, vao, labelName.Length, labelName);
            }

            DepthTest     = true;
            CullBackfaces = true;
            Blend         = true;
            SetBlendFunc(BlendingFactor.SrcAlpha, BlendingFactor.OneMinusSrcAlpha);
        }