bool Landscape::Initialize() { // Load the height map PNG pngFile; m_OriginOffset = glm::vec2(512,512); if( pngFile.Load( "Media/Textures/Island.png" ) ) { if( m_HeightMap.Import( pngFile.GetData(), pngFile.GetWidth(), pngFile.GetHeight(), m_HeightScale, pngFile.GetHasAlpha() ? HeightMap::RGBA : HeightMap::RGB ) ) { m_Volstagg.Load( "Media/Textures/Island.png" ); return true; } } return false; }
GLuint OpenGLInterface::LoadTextureFromPNG( const char* fileName, unsigned int tex ) { PNG pngFile; if( pngFile.Load( fileName ) ) { tex = CreateTextureFromImageData( pngFile.GetData(), pngFile.GetWidth(), pngFile.GetHeight(), pngFile.GetHasAlpha(), tex ); } return tex; }