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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T18:24:56+00:00 2026-06-03T18:24:56+00:00

I am trying to draw a line with OpenGL ES 2.0 GLKit. When I

  • 0

I am trying to draw a line with OpenGL ES 2.0 GLKit. When I run the following code and use OpenGL ES Analyzer I get the following errors:

“Use of Non-Existent Program”
glDrawArrays(GL_LINE_STRIP,0,4)

“GL Error: Invalid Operation”
GL_INVALID_OPERATION <- glVertexPointer(2,GL_FLOAT,0,NULL)
GL_INVALID_OPERATION <- glEnableClientState(GL_VERTEX_ARRAY)

Here’s my code:

#import "GLDrawingView.h"


const float data[] = {0.0f, 1.0f, 0.0f, 0.0f, 1.0f, -0.0f, 0.0f, 1.0f};



@interface GLDrawingView () {
    GLuint lineVBO;
}

@end

@implementation GLDrawingView

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [EAGLContext setCurrentContext:self.context];           
        glGenBuffers(1, &lineVBO);
        glBindBuffer(GL_ARRAY_BUFFER, lineVBO);
        glBufferData(GL_ARRAY_BUFFER, sizeof(data), data, GL_STATIC_DRAW);
    }
    return self;
}

- (void)drawRect:(CGRect)rect
{
    glVertexPointer(2, GL_FLOAT, 0, NULL);   
    glEnableClientState(GL_VERTEX_ARRAY);
    glDrawArrays(GL_LINE_STRIP, 0, sizeof(data) / sizeof(float) / 2);
}

@end
  • 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-06-03T18:25:02+00:00Added an answer on June 3, 2026 at 6:25 pm

    When you draw something in OpenGL ES 2.0 you must use shader program (glUseProgram) for rendering. You can not render without shaders in GLES2.

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

Sidebar

Related Questions

I am trying to write some code that that will draw the line which
I've moved on from trying to use OpenGL through Penumbra to trying to draw
i am trying to draw a line using OpenGL while the both end coordinates
When trying to draw the following quads in OpenGL using a vertex array (instead
Im trying to draw a globe in Android, I use OpenGL for this. However
In the following program i am trying to draw a simple house. The coordinates
I am trying to draw a simple line in html5 and noticed the following
Im trying to draw a line. I wrote a code like below. UIColor *currentColor
I am trying to draw a line my Code is this -(void) drawRect:(CGRect) rect
I am trying to draw a line along with mouse move on a paper.

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.