开发者

iPhone openGL error : ERROR: 0:1: '<' : syntax error syntax error

开发者 https://www.devze.com 2023-01-18 14:32 出处:网络
Hi Friends I am new to openGLES, trying to work with HelloArrow program using shaders from a Site but when i compiled i got the following error,

Hi Friends I am new to openGLES, trying to work with HelloArrow program using shaders from a Site

but when i compiled i got the following error,

Source code Download HelloArrow.zip


ERROR: 0:1: '<' : syntax error syntax error
ERROR: Parser found no code to compile in source strings.


//  VERTEX SHADER

const char* SimpleVertexShader = STRINGIFY( attribute vec4 Position; attribute vec4 SourceColor; varying vec4 DestinationColor; uniform mat4 Projection; uniform mat4 Modelview;

void main(void) { printf("fragment shader"); DestinationColor = SourceColor; gl_Position = Projection * Modelview * Position; } );


//  FRAGMENT SHADER

const char* SimpleFragmentShader = STRINGIFY( 
    varying lowp vec4 DestinationColor;
    void main(void)
    {
    printf("fragment shader");
        gl_FragColor = DestinationColor;`
    } 
);

I don't ha开发者_开发百科ve any idea.

Your suggestions are important to me so don't leave without a comment or answer

[Sorry for my poor English]


have a very close look at this line:

 gl_FragColor = DestinationColor;`

the character behind the ; should not be there

;-)

0

精彩评论

暂无评论...
验证码 换一张
取 消