本文整理汇总了C++中CORRADE_SKIP函数的典型用法代码示例。如果您正苦于以下问题:C++ CORRADE_SKIP函数的具体用法?C++ CORRADE_SKIP怎么用?C++ CORRADE_SKIP使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CORRADE_SKIP函数的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: CORRADE_SKIP
void FramebufferGLTest::constructMove() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available."));
#endif
Framebuffer a({{32, 16}, {128, 256}});
const Int id = a.id();
MAGNUM_VERIFY_NO_ERROR();
CORRADE_VERIFY(id > 0);
Framebuffer b(std::move(a));
CORRADE_COMPARE(a.id(), 0);
CORRADE_COMPARE(b.id(), id);
CORRADE_COMPARE(b.viewport(), Range2Di({32, 16}, {128, 256}));
Framebuffer c({{128, 256}, {32, 16}});
const Int cId = c.id();
c = std::move(b);
MAGNUM_VERIFY_NO_ERROR();
CORRADE_VERIFY(cId > 0);
CORRADE_COMPARE(b.id(), cId);
CORRADE_COMPARE(c.id(), id);
CORRADE_COMPARE(c.viewport(), Range2Di({32, 16}, {128, 256}));
}
开发者ID:ashimidashajia,项目名称:magnum,代码行数:28,代码来源:FramebufferGLTest.cpp
示例2: CORRADE_SKIP
void BufferGLTest::map() {
#ifdef MAGNUM_TARGET_GLES
if(!Context::current().isExtensionSupported<Extensions::GL::OES::mapbuffer>())
CORRADE_SKIP(Extensions::GL::OES::mapbuffer::string() + std::string(" is not supported"));
#endif
Buffer buffer;
constexpr char data[] = {2, 7, 5, 13, 25};
buffer.setData(data, BufferUsage::StaticDraw);
#ifndef MAGNUM_TARGET_GLES
char* contents = buffer.map<char>(Buffer::MapAccess::ReadWrite);
#else
char* contents = buffer.map<char>(Buffer::MapAccess::WriteOnly);
#endif
MAGNUM_VERIFY_NO_ERROR();
CORRADE_VERIFY(contents);
#ifndef MAGNUM_TARGET_GLES2
CORRADE_COMPARE(contents[2], 5);
#endif
contents[3] = 107;
CORRADE_VERIFY(buffer.unmap());
MAGNUM_VERIFY_NO_ERROR();
/** @todo How to verify the contents in ES? */
#ifndef MAGNUM_TARGET_GLES
Containers::Array<char> changedContents = buffer.data<char>();
CORRADE_COMPARE(changedContents.size(), 5);
CORRADE_COMPARE(changedContents[3], 107);
#endif
}
开发者ID:Asuzer,项目名称:magnum,代码行数:33,代码来源:BufferGLTest.cpp
示例3: CORRADE_SKIP
void FramebufferGLTest::invalidate() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available."));
#endif
Renderbuffer color;
#ifndef MAGNUM_TARGET_GLES2
color.setStorage(RenderbufferFormat::RGBA8, Vector2i(128));
#else
color.setStorage(RenderbufferFormat::RGBA4, Vector2i(128));
#endif
Renderbuffer stencil;
stencil.setStorage(RenderbufferFormat::StencilIndex8, Vector2i(128));
Framebuffer framebuffer({{}, Vector2i(128)});
framebuffer.attachRenderbuffer(Framebuffer::ColorAttachment(0), color)
.attachRenderbuffer(Framebuffer::BufferAttachment::Stencil, stencil);
MAGNUM_VERIFY_NO_ERROR();
framebuffer.invalidate({Framebuffer::InvalidationAttachment::Depth, Framebuffer::ColorAttachment(0)});
MAGNUM_VERIFY_NO_ERROR();
}
开发者ID:dalerank,项目名称:magnum,代码行数:26,代码来源:FramebufferGLTest.cpp
示例4: CORRADE_SKIP
void AbstractQueryGLTest::constructMove() {
#ifdef MAGNUM_TARGET_GLES2
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::occlusion_query_boolean>())
CORRADE_SKIP(Extensions::GL::EXT::occlusion_query_boolean::string() + std::string(" is not supported."));
#endif
SampleQuery a;
const Int id = a.id();
MAGNUM_VERIFY_NO_ERROR();
CORRADE_VERIFY(id > 0);
SampleQuery b(std::move(a));
CORRADE_COMPARE(a.id(), 0);
CORRADE_COMPARE(b.id(), id);
SampleQuery c;
const Int cId = c.id();
c = std::move(b);
MAGNUM_VERIFY_NO_ERROR();
CORRADE_VERIFY(cId > 0);
CORRADE_COMPARE(b.id(), cId);
CORRADE_COMPARE(c.id(), id);
}
开发者ID:jakubsuchybio,项目名称:magnum,代码行数:26,代码来源:AbstractQueryGLTest.cpp
示例5: CORRADE_SKIP
void SampleQueryGLTest::wrap() {
#ifdef MAGNUM_TARGET_GLES2
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::occlusion_query_boolean>())
CORRADE_SKIP(Extensions::GL::EXT::occlusion_query_boolean::string() + std::string(" is not available."));
#endif
GLuint id;
#ifndef MAGNUM_TARGET_GLES2
glGenQueries(1, &id);
#else
glGenQueriesEXT(1, &id);
#endif
/* Releasing won't delete anything */
{
auto query = SampleQuery::wrap(id, SampleQuery::Target::AnySamplesPassed, ObjectFlag::DeleteOnDestruction);
CORRADE_COMPARE(query.release(), id);
}
/* ...so we can wrap it again */
SampleQuery::wrap(id, SampleQuery::Target::AnySamplesPassed);
#ifndef MAGNUM_TARGET_GLES2
glDeleteQueries(1, &id);
#else
glDeleteQueriesEXT(1, &id);
#endif
}
开发者ID:BrainlessLabsInc,项目名称:magnum,代码行数:27,代码来源:SampleQueryGLTest.cpp
示例6: CORRADE_SKIP
void TextureGLTest::subImageBuffer() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_rectangle>())
CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported."));
constexpr UnsignedByte zero[4*4*4] = {};
constexpr UnsignedByte subData[] = { 0x00, 0x01, 0x02, 0x03,
0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b,
0x0c, 0x0d, 0x0e, 0x0f };
RectangleTexture texture;
texture.setImage(TextureFormat::RGBA8,
ImageReference2D(ColorFormat::RGBA, ColorType::UnsignedByte, Vector2i(4), zero));
texture.setSubImage(Vector2i(1),
BufferImage2D(ColorFormat::RGBA, ColorType::UnsignedByte, Vector2i(2), subData, BufferUsage::StaticDraw));
MAGNUM_VERIFY_NO_ERROR();
BufferImage2D image(ColorFormat::RGBA, ColorType::UnsignedByte);
texture.image(image, BufferUsage::StaticRead);
const auto imageData = image.buffer().data<UnsignedByte>();
MAGNUM_VERIFY_NO_ERROR();
CORRADE_COMPARE(image.size(), Vector2i(4));
CORRADE_COMPARE_AS(std::vector<UnsignedByte>(imageData.begin(), imageData.end()), (std::vector<UnsignedByte>{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0, 0, 0, 0,
0, 0, 0, 0, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
}), TestSuite::Compare::Container);
}
开发者ID:severin-lemaignan,项目名称:magnum,代码行数:31,代码来源:RectangleTextureGLTest.cpp
示例7: defined
void Test::hierarchy() {
#if defined(CORRADE_TARGET_NACL_NEWLIB) || defined(CORRADE_TARGET_EMSCRIPTEN)
CORRADE_SKIP("Dependency hierarchy is meaningful only for dynamic plugins");
#else
PluginManager::Manager<AbstractAnimal> manager(PLUGINS_DIR);
CORRADE_COMPARE(manager.load("Chihuahua"), LoadState::Loaded);
CORRADE_COMPARE(manager.loadState("Dog"), LoadState::Loaded);
CORRADE_COMPARE(*manager.metadata("Chihuahua")->name(), "The smallest dog in the world.");
CORRADE_COMPARE(manager.metadata("Chihuahua")->depends().size(), 1);
CORRADE_COMPARE(manager.metadata("Chihuahua")->depends()[0], "Dog");
CORRADE_COMPARE(manager.metadata("Dog")->usedBy().size(), 1);
CORRADE_COMPARE(manager.metadata("Dog")->usedBy()[0], "Chihuahua");
{
std::unique_ptr<AbstractAnimal> animal = manager.instance("Chihuahua");
CORRADE_VERIFY(animal);
CORRADE_VERIFY(animal->hasTail()); // inherited from dog
CORRADE_COMPARE(animal->legCount(), 4); // this too
CORRADE_COMPARE(animal->name(), "Rodriguez");
/* Try to unload plugin when another is depending on it */
CORRADE_COMPARE(manager.unload("Dog"), LoadState::Required);
}
/* After deleting instance, unload chihuahua plugin, then try again */
CORRADE_COMPARE(manager.unload("Chihuahua"), LoadState::NotLoaded);
CORRADE_COMPARE(manager.unload("Dog"), LoadState::NotLoaded);
CORRADE_VERIFY(manager.metadata("Dog")->usedBy().empty());
#endif
}
开发者ID:piaoger,项目名称:corrade,代码行数:31,代码来源:Test.cpp
示例8: CORRADE_SKIP
void FramebufferGLTest::invalidateSub() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available."));
#endif
Renderbuffer color;
#ifndef MAGNUM_TARGET_GLES2
color.setStorage(RenderbufferFormat::RGBA8, Vector2i(128));
#else
color.setStorage(RenderbufferFormat::RGBA4, Vector2i(128));
#endif
Renderbuffer depth;
depth.setStorage(RenderbufferFormat::DepthComponent16, Vector2i(128));
Framebuffer framebuffer({{}, Vector2i(128)});
framebuffer.attachRenderbuffer(Framebuffer::ColorAttachment(0), color)
.attachRenderbuffer(Framebuffer::BufferAttachment::Depth, depth);
MAGNUM_VERIFY_NO_ERROR();
CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::ReadDraw), Framebuffer::Status::Complete);
framebuffer.invalidate({Framebuffer::InvalidationAttachment::Depth, Framebuffer::ColorAttachment(0)},
{{32, 16}, {79, 64}});
MAGNUM_VERIFY_NO_ERROR();
}
开发者ID:TUZIHULI,项目名称:magnum,代码行数:28,代码来源:FramebufferGLTest.cpp
示例9: CORRADE_SKIP
void FramebufferGLTest::multipleColorOutputs() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available."));
#elif defined(MAGNUM_TARGET_GLES2)
if(!Context::current()->isExtensionSupported<Extensions::GL::NV::draw_buffers>())
CORRADE_SKIP(Extensions::GL::NV::draw_buffers::string() + std::string(" is not available."));
#endif
Texture2D color1;
#ifndef MAGNUM_TARGET_GLES2
color1.setStorage(1, TextureFormat::RGBA8, Vector2i(128));
#else
color1.setStorage(1, TextureFormat::RGBA, Vector2i(128));
#endif
Texture2D color2;
#ifndef MAGNUM_TARGET_GLES2
color2.setStorage(1, TextureFormat::RGBA8, Vector2i(128));
#else
color2.setStorage(1, TextureFormat::RGBA, Vector2i(128));
#endif
Renderbuffer depth;
depth.setStorage(RenderbufferFormat::DepthComponent16, Vector2i(128));
Framebuffer framebuffer({{}, Vector2i(128)});
framebuffer.attachTexture(Framebuffer::ColorAttachment(0), color1, 0)
.attachTexture(Framebuffer::ColorAttachment(1), color2, 0)
.attachRenderbuffer(Framebuffer::BufferAttachment::Depth, depth)
.mapForDraw({{0, Framebuffer::ColorAttachment(1)},
{1, Framebuffer::ColorAttachment(0)}});
#ifdef MAGNUM_TARGET_GLES2
if(Context::current()->isExtensionSupported<Extensions::GL::NV::read_buffer>())
#endif
{
#ifdef MAGNUM_TARGET_GLES2
Debug() << "Using" << Extensions::GL::NV::read_buffer::string();
#endif
framebuffer.mapForRead(Framebuffer::ColorAttachment(1));
}
MAGNUM_VERIFY_NO_ERROR();
CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::ReadDraw), Framebuffer::Status::Complete);
}
开发者ID:vesper666,项目名称:magnum,代码行数:46,代码来源:FramebufferGLTest.cpp
示例10: CORRADE_SKIP
void MultisampleTextureGLTest::construct2D() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not supported."));
#else
if(!Context::current()->isVersionSupported(Version::GLES310))
CORRADE_SKIP("OpenGL ES 3.1 is not supported.");
#endif
{
MultisampleTexture2D texture;
MAGNUM_VERIFY_NO_ERROR();
CORRADE_VERIFY(texture.id() > 0);
}
MAGNUM_VERIFY_NO_ERROR();
}
开发者ID:RobertoMalatesta,项目名称:magnum,代码行数:18,代码来源:MultisampleTextureGLTest.cpp
示例11: CORRADE_VERIFY
void DirectoryTest::readNonSeekable() {
#ifdef __unix__ /* (OS X doesn't have /proc) */
/** @todo Test more thoroughly than this */
const auto data = Directory::read("/proc/loadavg");
CORRADE_VERIFY(!data.empty());
#else
CORRADE_SKIP("Not implemented on this platform.");
#endif
}
开发者ID:jkhoogland,项目名称:corrade,代码行数:9,代码来源:DirectoryTest.cpp
示例12: CORRADE_SKIP
void AbstractObjectGLTest::labelNoOp() {
if(Context::current()->isExtensionSupported<Extensions::GL::KHR::debug>())
CORRADE_SKIP(Extensions::GL::KHR::debug::string() + std::string(" is supported."));
Buffer buffer;
buffer.setLabel("MyBuffer");
CORRADE_COMPARE(buffer.label(), "");
MAGNUM_VERIFY_NO_ERROR();
}
开发者ID:NextGenIntelligence,项目名称:magnum,代码行数:9,代码来源:AbstractObjectGLTest.cpp
示例13: CORRADE_SKIP
void MultisampleTextureGLTest::storage2DArray() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not supported."));
#else
if(!Context::current().isExtensionSupported<Extensions::GL::OES::texture_storage_multisample_2d_array>())
CORRADE_SKIP(Extensions::GL::OES::texture_storage_multisample_2d_array::string() + std::string(" is not supported."));
#endif
MultisampleTexture2DArray texture;
texture.setStorage(4, TextureFormat::RGBA8, {16, 16, 5});
MAGNUM_VERIFY_NO_ERROR();
CORRADE_COMPARE(texture.imageSize(), Vector3i(16, 16, 5));
MAGNUM_VERIFY_NO_ERROR();
}
开发者ID:jkhoogland,项目名称:magnum,代码行数:18,代码来源:MultisampleTextureGLTest.cpp
示例14: CORRADE_SKIP
void ContextGLTest::isExtensionDisabled() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::APPLE::vertex_array_object>())
CORRADE_SKIP(Extensions::GL::APPLE::vertex_array_object::string() + std::string(" extension should be supported, can't test"));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::explicit_attrib_location>())
CORRADE_SKIP(Extensions::GL::ARB::explicit_attrib_location::string() + std::string(" extension should be supported, can't test"));
/* This is not disabled anywhere */
CORRADE_VERIFY(!Context::current()->isExtensionDisabled<Extensions::GL::APPLE::vertex_array_object>());
/* This is disabled in GL < 3.2 to work around GLSL compiler bugs */
CORRADE_VERIFY(Context::current()->isExtensionDisabled<Extensions::GL::ARB::explicit_attrib_location>(Version::GL310));
CORRADE_VERIFY(!Context::current()->isExtensionDisabled<Extensions::GL::ARB::explicit_attrib_location>(Version::GL320));
#else
CORRADE_SKIP("No useful extensions to test on OpenGL ES");
#endif
}
开发者ID:DYSEQTA,项目名称:magnum,代码行数:18,代码来源:ContextGLTest.cpp
示例15: CORRADE_SKIP
void DebugOutputGLTest::setCallback() {
if(!Context::current().isExtensionSupported<Extensions::GL::KHR::debug>())
CORRADE_SKIP(Extensions::GL::KHR::debug::string() + std::string(" is not supported"));
/* Need to be careful, because the test runner is using debug output too */
DebugOutput::setDefaultCallback();
MAGNUM_VERIFY_NO_ERROR();
}
开发者ID:Ali-Wassouf,项目名称:magnum,代码行数:9,代码来源:DebugOutputGLTest.cpp
示例16: CORRADE_SKIP
void CubeMapTextureGLTest::samplingMaxLevel() {
if(!Context::current()->isExtensionSupported<Extensions::GL::APPLE::texture_max_level>())
CORRADE_SKIP(Extensions::GL::APPLE::texture_max_level::string() + std::string(" is not supported."));
CubeMapTexture texture;
texture.setMaxLevel(750);
MAGNUM_VERIFY_NO_ERROR();
}
开发者ID:NextGenIntelligence,项目名称:magnum,代码行数:9,代码来源:CubeMapTextureGLTest.cpp
示例17: CORRADE_SKIP
void AnyImporterTest::ogg() {
if(_manager.loadState("VorbisAudioImporter") == PluginManager::LoadState::NotFound)
CORRADE_SKIP("VorbisAudioImporter plugin not found, cannot test");
AnyImporter importer{_manager};
CORRADE_VERIFY(importer.openFile(OGG_FILE));
/* Check only parameters, as it is good enough proof that it is working */
CORRADE_COMPARE(importer.format(), Buffer::Format::Mono16);
CORRADE_COMPARE(importer.frequency(), 96000);
}
开发者ID:Squareys,项目名称:magnum-plugins,代码行数:11,代码来源:Test.cpp
注:本文中的CORRADE_SKIP函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论