void Renderbuffer::createImplementationDSA() { glCreateRenderbuffers(1, &_id); _flags |= ObjectFlag::Created; }
void Renderbuffer::createImplementationDSA() { glCreateRenderbuffers(1, &_id); _created = true; }
enum piglit_result piglit_display(void) { bool pass = true; GLchar label[11]; GLsizei length; GLuint ids[10]; GLint param; /* Throw some invalid inputs at glCreateRenderbuffers */ /* n is negative */ glCreateRenderbuffers(-1, ids); SUBTEST(GL_INVALID_VALUE, pass, "n < 0"); /* Throw some valid inputs at glCreateRenderbuffers. */ /* n is zero */ glCreateRenderbuffers(0, NULL); SUBTEST(GL_NO_ERROR, pass, "n == 0"); /* n is more than 1 */ glCreateRenderbuffers(10, ids); SUBTEST(GL_NO_ERROR, pass, "n > 1"); /* test the default state of dsa-created render buffer objects */ SUBTESTCONDITION(glIsRenderbuffer(ids[2]), pass, "IsRenderbuffer()"); glBindRenderbuffer(GL_RENDERBUFFER, ids[2]); piglit_check_gl_error(GL_NO_ERROR); glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, ¶m); piglit_check_gl_error(GL_NO_ERROR); SUBTESTCONDITION(param == 0, pass, "default width(%d) == 0", param); glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_HEIGHT, ¶m); piglit_check_gl_error(GL_NO_ERROR); SUBTESTCONDITION(param == 0, pass, "default height(%d) == 0", param); glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_INTERNAL_FORMAT, ¶m); piglit_check_gl_error(GL_NO_ERROR); SUBTESTCONDITION(param == GL_RGBA, pass, "default internal format == RGBA"); glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_RED_SIZE, ¶m); piglit_check_gl_error(GL_NO_ERROR); SUBTESTCONDITION(param == 0, pass, "default red size(%d) == 0", param); glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_GREEN_SIZE, ¶m); piglit_check_gl_error(GL_NO_ERROR); SUBTESTCONDITION(param == 0, pass, "default green size(%d) == 0", param); glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_BLUE_SIZE, ¶m); piglit_check_gl_error(GL_NO_ERROR); SUBTESTCONDITION(param == 0, pass, "default blue size(%d) == 0", param); glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_ALPHA_SIZE, ¶m); piglit_check_gl_error(GL_NO_ERROR); SUBTESTCONDITION(param == 0, pass, "default alpha size(%d) == 0", param); glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_DEPTH_SIZE, ¶m); piglit_check_gl_error(GL_NO_ERROR); SUBTESTCONDITION(param == 0, pass, "default depth size(%d) == 0", param); glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_STENCIL_SIZE, ¶m); piglit_check_gl_error(GL_NO_ERROR); SUBTESTCONDITION(param == 0, pass, "default stencil size(%d) == 0", param); glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_SAMPLES, ¶m); piglit_check_gl_error(GL_NO_ERROR); SUBTESTCONDITION(param == 0, pass, "default no. of samples(%d) == 0", param); glGetObjectLabel(GL_RENDERBUFFER, ids[2], 11, &length, label); piglit_check_gl_error(GL_NO_ERROR); SUBTESTCONDITION(length == 0, pass, "default label size(%d) == 0", length); /* clean up */ glDeleteRenderbuffers(10, ids); return pass ? PIGLIT_PASS : PIGLIT_FAIL; }