本文整理汇总了C++中GLTexture::get方法的典型用法代码示例。如果您正苦于以下问题:C++ GLTexture::get方法的具体用法?C++ GLTexture::get怎么用?C++ GLTexture::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GLTexture
的用法示例。
在下文中一共展示了GLTexture::get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
// Read framebuffer to 'pixelsOut' via glCopyTexImage2D and GL_TEXTURE_2D.
void TestCopyTexImage2D(int x, int y, int, PixelRect *pixelsOut)
{
// Init texture with given pixels.
GLTexture destTexture;
pixelsOut->toTexture2D(GL_TEXTURE_2D, destTexture.get());
// Read framebuffer -> texture -> 'pixelsOut'
glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, x, y, kReadWidth, kReadHeight, 0);
readTexture2D(GL_TEXTURE_2D, destTexture.get(), kReadWidth, kReadHeight, pixelsOut);
}
示例2: TestCopyTexSubImageCube
// Read framebuffer to 'pixelsOut' via glCopyTexSubImage2D and cube map.
void TestCopyTexSubImageCube(int x, int y, int, PixelRect *pixelsOut)
{
// Init texture with given pixels.
GLTexture destTexture;
pixelsOut->toTexture2D(GL_TEXTURE_CUBE_MAP, destTexture.get());
// Read framebuffer -> texture -> 'pixelsOut'
glCopyTexSubImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X, 0, 0, 0, x, y, kReadWidth, kReadHeight);
readTexture2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X, destTexture.get(), kReadWidth, kReadHeight,
pixelsOut);
}
示例3: glDeleteProgram
EXPECT_GL_NO_ERROR();
glDeleteProgram(program);
}
class DrawBuffersTestES3 : public DrawBuffersTest
{};
// Test that binding multiple layers of a 3D texture works correctly
TEST_P(DrawBuffersTestES3, 3DTextures)
{
ANGLE_SKIP_TEST_IF(!setupTest());
GLTexture texture;
glBindTexture(GL_TEXTURE_3D, texture.get());
glTexImage3D(GL_TEXTURE_3D, 0, GL_RGBA, getWindowWidth(), getWindowHeight(), getWindowWidth(),
0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
glFramebufferTextureLayer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, texture.get(), 0, 0);
glFramebufferTextureLayer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1, texture.get(), 0, 1);
glFramebufferTextureLayer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT2, texture.get(), 0, 2);
glFramebufferTextureLayer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT3, texture.get(), 0, 3);
bool flags[8] = {true, true, true, true, false};
GLuint program;
setupMRTProgram(flags, &program);
const GLenum bufs[] = {
GL_COLOR_ATTACHMENT0,