小编djw*_*612的帖子

OpenGL ES 2.0纹理映射,但显示为黑色

我试图让我的纹理显示在一个基本的OpenGL视图(UIView的子类)中,但无论我使用哪种纹理,它都显示为黑色.我的观点代码如下:

@implementation SymGLView

typedef struct {
    float Position[3];
    float Color[4];
    float TexCoord[2];
} Vertex;

const Vertex Vertices[] = {
    {{1, -1, 0}, {1, 0, 0, 1}, {0, 0}},
    {{1, 1, 0}, {0, 1, 0, 1}, {0, 1}},
    {{-1, 1, 0}, {0, 0, 1, 1}, {1, 1}},
    {{-1, -1, 0}, {0, 0, 0, 1}, {1, 0}}
};

const GLubyte Indices[] = {
    0, 1, 2,
    2, 3, 0
};

+ (Class)layerClass {
    return [CAEAGLLayer class];
}

- (void)setupLayer {
    _eaglLayer = …
Run Code Online (Sandbox Code Playgroud)

objective-c ios opengl-es-2.0

3
推荐指数
1
解决办法
1872
查看次数

标签 统计

ios ×1

objective-c ×1

opengl-es-2.0 ×1