本文整理汇总了C++中ITexture::GetTextureName方法的典型用法代码示例。如果您正苦于以下问题:C++ ITexture::GetTextureName方法的具体用法?C++ ITexture::GetTextureName怎么用?C++ ITexture::GetTextureName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITexture
的用法示例。
在下文中一共展示了ITexture::GetTextureName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
INLINE void OGL14RendererDevice::UploadData(void *userData)
{
RendererPacket *packet = static_cast<RendererPacket *>(userData);
ITexture *texture = packet->pTexture;
GLuint *t = static_cast<GLuint *>(texture->GetTextureName());
GLuint tex = (GLuint)t;
sVertex *data = static_cast<sVertex *>(packet->pVertexData);
glPushMatrix();
glLoadIdentity();
this->SetBlendingOperation(packet->nBlendMode, packet->iColor.pixel);
glBindTexture(GL_TEXTURE_2D, tex);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
/*
eTextureFilter min = texture->GetFilter(Seed::TextureFilterTypeMin);
eTextureFilter mag = texture->GetFilter(Seed::TextureFilterTypeMag);
if (min == Seed::TextureFilterLinear)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
else if (min == Seed::TextureFilterNearest)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
if (mag == Seed::TextureFilterLinear)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
else if (mag == Seed::TextureFilterNearest)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
*/
//glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
glBegin(this->GetOpenGLMeshType(packet->nMeshType));
for (u32 i = 0; i < packet->iSize; i++)
{
glTexCoord2f(data[i].cCoords.x, data[i].cCoords.y);
glVertex3f(data[i].cVertex.x, data[i].cVertex.y, data[i].cVertex.z);
}
glEnd();
glPopMatrix();
}
示例2: if
INLINE void OGLES1RendererDevice::UploadData(void *userData)
{
RendererPacket *packet = static_cast<RendererPacket *>(userData);
ITexture *texture = packet->pTexture;
GLuint *t = static_cast<GLuint *>(texture->GetTextureName());
GLuint tex = (GLuint)t;
sVertex *data = static_cast<sVertex *>(packet->pVertexData);
this->SetBlendingOperation(packet->nBlendMode, packet->iColor.pixel);
sVertex v1 = data[0];
sVertex v2 = data[1];
sVertex v3 = data[2];
sVertex v4 = data[3];
glBindTexture(GL_TEXTURE_2D, tex);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
eTextureFilter min = texture->GetFilter(Seed::TextureFilterTypeMin);
eTextureFilter mag = texture->GetFilter(Seed::TextureFilterTypeMag);
if (min == Seed::TextureFilterLinear)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
else if (min == Seed::TextureFilterNearest)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
if (mag == Seed::TextureFilterLinear)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
else if (mag == Seed::TextureFilterNearest)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glVertexPointer(3, GL_FLOAT, sizeof(sVertex), &data[0].cVertex);
glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(sVertex), &data[0].iColor);
glTexCoordPointer(2, GL_FLOAT, sizeof(sVertex), &data[0].cCoords);
glDrawArrays(GL_TRIANGLE_STRIP, 0, packet->iSize);
}