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 6029223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:51:16+00:00 2026-05-23T04:51:16+00:00

I am currently working on an OPENGL ES 2.0 project. I am making a

  • 0

I am currently working on an OPENGL ES 2.0 project. I am making a bar graph application. I have achieved success in making the graph. I am trying to insert text on the graph. I found out that there is no direct solution to achieve the same.

I came across a OPENGL ES 1.1 code, which has the following lines in it.

File: In GLViewController.m (from the drawView function)

Texture2D *textTex = [[Texture2D alloc] initWithString:@"Text" 

                                            dimensions:CGSizeMake(100., 40.0) 

                                             alignment:UITextAlignmentCenter 

                                                  font:[UIFont boldSystemFontOfSize:10.0]];

[textTex drawAtPoint:CGPointMake(160.0, 100.0) depth:-1];

In the Texture2D.m file,

- (void) drawAtPoint:(CGPoint)point depth:(CGFloat)depth

{

GLfloat coordinates[] = {

0, _maxT,

_maxS, _maxT,

0, 0,

_maxS, 0

};

GLfloat width = (GLfloat)_width * _maxS,

height = (GLfloat)_height * _maxT;

GLfloat vertices[] = {

-width / 2 + point.x, -height / 2 + point.y, depth,

width / 2 + point.x, -height / 2 + point.y, depth,

-width / 2 + point.x, height / 2 + point.y, depth,

width / 2 + point.x, height / 2 + point.y, depth

};

glBindTexture(GL_TEXTURE_2D, texture.name);

glVertexPointer(3, GL_FLOAT, 0, vertices);          //1

glTexCoordPointer(2, GL_FLOAT, 0, coordinates);      //2

glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);

}

When I tried to convert this code into OPENGL ES 2.0 code, I am not able to find a suitable conversion for lines marked 1 and 2. Can someone please help me convert this code to OPENGL ES 2.0 code?

Or if an anyone is aware of an easier method to write text on screen, please let me know.

  • 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-23T04:51:17+00:00Added an answer on May 23, 2026 at 4:51 am

    OpenGL ES 1.x and 2.x share a lot of concepts when it comes to geometry. You specify vertices, then you join them with geometry, which is turned into pixels. The difference is that you specify custom code in two places: to take the input geometry and figure out where it goes on screen and what stuff it passes on through the pipeline, and to figure out what colour an individual fragment is based on the information coming along the pipeline.

    Because ES 1.x wasn’t programmable in that sense, it had fixed functionality at both places. Which meant fixed data structures, and hence why you supply data via glVertexPointer, glTexCoordPointer, etc. You’re supplying values for the fixed, predetermined fields that OpenGL has written into stone as describing a vertex.

    Because ES 2.x is fully programmable and minimalist, it makes no assumptions about what fields describe a vertex and accordingly has no special case data provision methods, such as one to supply locations (glVertexPointer), another to supply texture coordinates (glTexCoordPointer), etc.

    In ES 2.x you use glVertexAttribPointer to replace all of the fixed meaning ES 1.x calls. The first parameter identifies which attribute you’re specifying by index, that index having been forced by yourself via glBindAttribLocation or left to figure themselves out and requested back via glGetAttribLocation.

    You’ll also need to write a suitable fragment and pixel shader, essentially just to pass the texture coordinates you nominate on, and to sample the texture per pixel, then pass that on. Should be just one or two lines in the body of each.

    Probably you have some sort of framework in place for dealing with this stuff in your graphing. Because ES 2.x is so generic about attributes, it should be possible to reuse much the same stuff.

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

Sidebar

Related Questions

I'm currently working on a game/engine that uses OpenGL for rendering, and recently have
I am developing a CAD application using Delphi2010 and OpenGL. Currently, i am working
I have been trying to get Glew and opengl 3.2 working with code blocks(minGW)
I'm currently working on some opengl 2D stuff. I have a spot light which
I'm currently working on an OpenGL ES 1.1 app for the iPad its running
Currently working with NSURLConnection. Found a great website showing important delegate methods coming with
Am currently working on an application that requires users to submit posts and comments
I'm currently working with OpenGL ES 1.1 and using the DrawElements convention along with
I'm currently working on an OpenGL game, and recently began refactoring it to support
I am currently working on some OSGi application and I wanted to use the

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.