Results 1 to 2 of 2

Thread: Trouble porting OpenGL code to iPhone's OpenGL ES

  1. #1
    Junior Member
    Join Date
    Apr 2009
    Posts
    3

    Trouble porting OpenGL code to iPhone's OpenGL ES

    Hi friends,
    I am new to OpenGL..

    Here, is the sample code which I am using. This code is in OpenGL. I want to convert it to OpenGL ES. glArrayElement() is not supported in OpenGL ES. Instead, it was recommended to use glDrawElements(), glDrawArrays(). I am not able to convert this. Can you please help me out to convert the code.

    glTexCoordPointer(2,GL_FLOAT,sizeof(struct texcoord),tex);
    glColorPointer(4,GL_UNSIGNED_BYTE,4,col);
    glNormalPointer(GL_FLOAT,sizeof(vector),wet->n);
    glVertexPointer(2,GL_FLOAT,sizeof(struct vertexcoord),vert);
    glEnableClientState(GL_TEXTURE_COORD_ARRAY);
    glEnableClientState(GL_COLOR_ARRAY);
    glEnableClientState(GL_NORMAL_ARRAY);
    glEnableClientState(GL_VERTEX_ARRAY);
    glLockArraysEXT(0,wet->w*wet->h);
    i=0;
    for(int y=0;y<wet->h-1;y++)
    {
    glBegin(GL_TRIANGLE_STRIP);
    for(int x=0;x<wet->w;x++)
    {
    glArrayElement(i);
    glArrayElement(i+wet->w);
    i++;
    }
    glEnd();
    }
    glUnlockArraysEXT();

    And one more question is do we have any replacement for glEnable(GL_TEXTURE_RECTANGLE_EXT) in OpenGL ES.

    Thanks in advance
    Vamshi

  2. #2
    Senior Member
    Join Date
    May 2006
    Posts
    353

    Re: Trouble porting OpenGL code to iPhone's OpenGL ES

    Georg Kolling, Imagination Technologies
    Please ask questions specific to PowerVR hardware or SDKs on the PowerVR Insider Forum
    DevTech@imgtec.com | http://www.powervrinsider.com

Similar Threads

  1. Trouble porting OpenGL code to iPhone's OpenGL ES
    By vamshivakul in forum Cross API and window system integration
    Replies: 3
    Last Post: 10-26-2011, 01:27 AM
  2. Porting OpenGL sw to OpenGL-ES, help needed - take 2
    By yipton in forum OpenGL ES general technical discussions
    Replies: 1
    Last Post: 11-06-2004, 11:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •