コード例 #1
0
        private void CheckError(GlInterface gl)
        {
            int err;

            while ((err = gl.GetError()) != GL_NO_ERROR)
            {
                Console.WriteLine(err);
            }
        }
コード例 #2
0
        public static void CheckError(this GlInterface gl, [CallerMemberName] string caller = "")
        {
            GlErrors err;

            while ((err = (GlErrors)gl.GetError()) != GL_NO_ERROR)
            {
                Console.WriteLine($"{caller}: {err}");
            }
        }
コード例 #3
0
        private bool CheckFramebufferStatus(GlInterface gl)
        {
            var status = gl.CheckFramebufferStatus(GL_FRAMEBUFFER);

            if (status != GL_FRAMEBUFFER_COMPLETE)
            {
                int code;
                while ((code = gl.GetError()) != 0)
                {
                    Logger.TryGet(LogEventLevel.Error, "OpenGL")?.Log("OpenGlControlBase",
                                                                      "Unable to initialize OpenGL FBO: {code}", code);
                }
                return(false);
            }

            return(true);
        }