------------------------------------------------------------------------------
| 1554 | |
| 1555 | //------------------------------------------------------------------------------ |
| 1556 | bool 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 | //------------------------------------------------------------------------------ |
| 1599 | bool vtkTextureObject::Create2DFromRaw( |
no test coverage detected