MCPcopy Create free account
hub / github.com/Kitware/VTK / AllocateProxyTexture3D

Method AllocateProxyTexture3D

Rendering/OpenGL2/vtkTextureObject.cxx:1556–1596  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1554
1555//------------------------------------------------------------------------------
1556bool vtkTextureObject::AllocateProxyTexture3D(
1557 unsigned int width, unsigned int height, unsigned int depth, int numComps, int dataType)
1558{
1559#ifndef GL_ES_VERSION_3_0
1560 assert(this->Context);
1561
1562 this->GetDataType(dataType);
1563 this->GetInternalFormat(dataType, numComps, false);
1564 this->GetFormat(dataType, numComps, false);
1565
1566 if (!this->InternalFormat || !this->Format || !this->Type)
1567 {
1568 vtkErrorMacro("Failed to determine texture parameters.");
1569 return false;
1570 }
1571
1572 this->Target = GL_TEXTURE_3D;
1573 this->Context->ActivateTexture(this);
1574 this->CreateTexture();
1575 this->Bind();
1576
1577 glTexImage3D(GL_PROXY_TEXTURE_3D, 0, this->InternalFormat, static_cast<GLsizei>(width),
1578 static_cast<GLsizei>(height), static_cast<GLsizei>(depth), 0, this->Format, this->Type,
1579 nullptr);
1580
1581 GLsizei testWidth;
1582 glGetTexLevelParameteriv(GL_PROXY_TEXTURE_3D, 0, GL_TEXTURE_WIDTH, &testWidth);
1583
1584 vtkOpenGLCheckErrorMacro("Failed after glTexImage3D with PROXY target");
1585 this->Deactivate();
1586
1587 return testWidth != 0;
1588#else
1589 (void)width;
1590 (void)height;
1591 (void)depth;
1592 (void)numComps;
1593 (void)dataType;
1594 return true;
1595#endif
1596}
1597
1598//------------------------------------------------------------------------------
1599bool vtkTextureObject::Create2DFromRaw(

Callers 1

SafeLoadTextureMethod · 0.80

Calls 8

GetDataTypeMethod · 0.95
GetInternalFormatMethod · 0.95
GetFormatMethod · 0.95
BindMethod · 0.95
DeactivateMethod · 0.95
assertFunction · 0.50
ActivateTextureMethod · 0.45
CreateTextureMethod · 0.45

Tested by

no test coverage detected