2017-06-19 4 views
0

テクスチャをロードテクスチャメソッドで読み込む際に問題があります。GLKTextureLoaderは1つのテクスチャを読み込むことができます

+(Texture*) loadTexture: (NSString*) name path: (NSString*) path{ 
    CGImageRef imageReference = [[UIImage imageNamed:path] CGImage]; 

    GLKTextureInfo* textureInfo = [GLKTextureLoader textureWithCGImage:imageReference options:nil error:NULL]; 

    Texture* texture = [[Texture alloc] init:textureInfo]; 

    NSLog(@"width: %i height: %i data: %p", [texture Width], [texture Height], [texture getTextureInfo]); 

    if(!Textures) Textures = [[NSMutableDictionary alloc] init]; 

    [Textures setObject:texture forKey:name]; 
    NSLog(@"adding key %@ to dictionary with pointer %p", name, Textures); 
    NSLog(@"%@", Textures); 

    return texture; 
} 

私はtextureInfoが初期化に失敗したとのNSLogを示しテクスチャをロードするために、すべてがうまく負荷テクスチャ方法が、任意の後続の呼び出しを呼び出して初めて「幅:0高さ:0データ:0x0の」

答えて

関連する問題