2013-04-22 3 views
1

현재 PVR SDK를 사용하여 텍스처를로드하는 데 문제가 있습니다. 내 텍스처 모두 선형 샘플 필터를 가지고 있다는 것을 알고 있습니다. 그러나 텍스처로드가 실패하면 설정 한 내 메시지가 발생합니다. 이것은 나의 방법은 텍스처질감이 OpenGL ES 2.0 PowerVR SDK를로드하지 않습니다.

bool OGLES2Skybox2::LoadTextures(CPVRTString* const pErrorStr) 
{ 
    for(int i = 0; i < 2; ++i) 
    { 
     if(PVRTTextureLoadFromPVR(TextureFile[i], &TextureID[i]) != PVR_SUCCESS){ 
      *pErrorStr = CPVRTString("ERROR: Could not open texture file ") + TextureFile[i]; 
      return false; 
     } 

     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 
     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); 
    } 

    // Load cube maps 
    if(PVRTTextureLoadFromPVR(TextureFile[2], &TextureID[2])) 
    { 
     *pErrorStr = CPVRTString("ERROR: Could not open texture file ") + TextureFile[2]; 
     return false; 
    } 

    glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); 
    glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_LINEAR); 
    glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); 
    glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); 

    return true; 
} 

내가 내 initView 방법에 LoadTextures를 호출 한 후()

bool OGLES2Skybox2::InitView() 
    { 
     // Sets the clear colour 
     glClearColor(0.6f, 0.8f, 1.0f, 1.0f); 

     // Enables depth test using the z-buffer 
     glEnable(GL_DEPTH_TEST); 

     CPVRTString ErrorStr; 

     /* 
      Load textures 
     */ 
     if(!LoadTextures(&ErrorStr)) 
     { 
      PVRShellSet(prefExitMessage, ErrorStr.c_str()); 
      return false; 
     } 
    ... 
    } 
+1

PVR 파일의 헤더에는 새 헤더와 레거시 헤더의 두 가지 유형이 있습니다. 두 가지 방법으로 텍스처를 다시 저장할 수 있습니다. 자세한 내용은 "PVRTextool as legacy"에 대한 google을 참조하십시오. – keaukraine

답변

0
에로드 할 수 있습니다 여기에. 나는 내 텍스처를로드하는 방법

const unsigned int NoTex = 3; 


    // PVR texture files 
const char* const TextureFile[NoTex] = 
{ "n_Map1.pvr", 
    "DUDV_map.pvr", 
    "Skybox.pvr"}; 

이며,

죄송 내 잘못. 그 이유는 PVR FileWrap 도구를 사용했고 콘텐츠가 이미 응용 프로그램에 바인딩되어 있고 .cpp 파일을 자동으로 생성했기 때문에 .cpp 파일을 프로젝트에 다시 추가하는 것을 잊었 기 때문입니다.