コード例 #1
0
ファイル: RenderContext.cs プロジェクト: Perksey/Mana
        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];

            /* */
        }
コード例 #2
0
ファイル: RenderContext.cs プロジェクト: Perksey/Mana
        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];

            /* */
        }