Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3243738
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:28:07+00:00 2026-05-17T18:28:07+00:00

The iPhone SDK has an example of using ES 2.0 with a set of

  • 0

The iPhone SDK has an example of using ES 2.0 with a set of (Vertex & Fragment) GLSL shaders to render a varying colored box. Is there an example out there on how to render a simple texture using this API? I basically want to take a quad, and draw a texture onto it.

The old ES 1.1 API’s don’t work at all anymore, so I’m needing a bit of help getting started. Most shader references talk mainly about advanced shading topics, but I’m really unsure about how to tell the shader to use the bound texture, and how to reference the UV’s.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T18:28:07+00:00Added an answer on May 17, 2026 at 6:28 pm

    There’s a nice tutorial on this in the web site to go with the book OpenGL ES 2 The examples from the book are all at http://www.opengles-book.com.

    Chapter 9, Simple_Texture2D does exactly what you want. It sets up a shader that samples a texture, initializes it, and shades the triangles using the texture.

    The shader program is close to:

    varying vec2 v_texCoord;
    uniform sampler2D s_texture;
    void main() {
      gl_FragColor = texture2D(s_texture, v_texCoord);
    }
    

    and you set it up thusly:

    glActiveTexture(GL_TEXTURE0);
    glBindTexture(GL_TEXTURE_2D, userData->textureId);
    // Set the sampler texture unit to 0
    glUniform1i(userData->samplerLoc, 0);
    glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, indices);
    

    But see the actual code, from the links I gave above, to really see the example.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently I am using iPhone SDK 3.1.2 for developing iPhone apps. Apple has recently
I am not sure if something has changed in the iPhone SDK 3.0 but
I've developed an iPhone app that has been running MPMoviePlayer (pre 3.2 SDK) with
I am new to iPhone SDK. I am using butting in my NIB file.Here
I'm using the Facebook Connect for iPhone SDK at http://github.com/facebook/facebook-iphone-sdk/ and am trying to
I'm looking at the aurioTouch sample application for the iPhone SDK. It has a
Running through an iPhone SDK book and one of the examples has me creating
In iPhone SDK 4.0, UIApplication has a new method, setKeepAliveTimeout: that requires a second
Upgrading to XCode 3.2.3 and iPhone 3.2/4.0 SDK has introduced a strange bug into
I'm using the iPhone SDK to build a simple application. I've created a brand

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.