本文整理汇总了C++中sf::Image::GetPixelsPtr方法的典型用法代码示例。如果您正苦于以下问题:C++ Image::GetPixelsPtr方法的具体用法?C++ Image::GetPixelsPtr怎么用?C++ Image::GetPixelsPtr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sf::Image
的用法示例。
在下文中一共展示了Image::GetPixelsPtr方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: uploadTextureGFX
GLuint Terrain::uploadTextureGFX(sf::Image img)
{
GLuint handle;
glGenTextures(1,&handle);
glBindTexture(GL_TEXTURE_2D,handle);
glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA,img.GetWidth(),img.GetHeight(),0,GL_RGBA,GL_UNSIGNED_BYTE,img.GetPixelsPtr());
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST );
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glGenerateMipmap( GL_TEXTURE_2D);
return handle;
}
示例2: makeBlendMap
//uploads the blendmaps to the GFX, getting a handle to the GFX side tex
void Terrain::makeBlendMap(GLuint& handle, sf::Image img)
{
glDeleteTextures(1,&handle);
glGenTextures(1,&handle);
glBindTexture(GL_TEXTURE_2D,handle);
glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA,img.GetWidth(),img.GetHeight(),0,GL_RGBA,GL_UNSIGNED_BYTE,img.GetPixelsPtr());
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
}
示例3: replacePartTexture
void Terrain::replacePartTexture(GLint xoffset, GLint yoffset, sf::Image img,GLuint handle)
{
glBindTexture(GL_TEXTURE_2D,handle);
glTexSubImage2D(GL_TEXTURE_2D,0,xoffset,yoffset,img.GetWidth(),img.GetHeight(),GL_RGBA,GL_UNSIGNED_BYTE,img.GetPixelsPtr());
}
示例4: GetPixels
void* SFMLTexture_c::GetPixels()
{
assert(texture.GetPixelsPtr() != NULL);
//return reinterpret_cast<void*>(texture.GetPixelsPtr());
}