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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:24:23+00:00 2026-06-04T05:24:23+00:00

Im trying to display some points on the screen with opengl es. here is

  • 0

Im trying to display some points on the screen with opengl es.
here is the code of ondraw:

gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
gl.glLoadIdentity();
gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
gl.glColor4f(0, 255, 0, 0);     
gl.glVertexPointer(3, GL10.GL_FLOAT, 0, buffer);
gl.glDrawArrays(GL10.GL_POINTS, 0, points.length);
gl.glDisableClientState(GL10.GL_VERTEX_ARRAY);

Can someone tell me what I’m doing wrong???

EDIT: the code to generate the buffer and points

    points = new float[12288];
    int pos = 0;
    for (float y = 0; y < 64; y++) {
        for (float x = 0; x < 64; x++) {
            points[pos++] = x/100;
            points[pos++] = y/100;
            points[pos++] = 0;
        }
    }

    ByteBuffer vertexByteBuffer = ByteBuffer.allocateDirect(points.length * 4);
    vertexByteBuffer.order(ByteOrder.nativeOrder());     
    // allocates the memory from the byte buffer
    buffer = vertexByteBuffer.asFloatBuffer();   
    // fill the vertexBuffer with the vertices
    buffer.put(points);  
    // set the cursor position to the beginning of the buffer
    buffer.position(0);

and the error at logcat:

04-17 06:38:11.296: A/libc(24276): Fatal signal 11 (SIGSEGV) at 0x41719000 (code=2)

This error happens at gl.glDrawArrays

  • 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-04T05:24:25+00:00Added an answer on June 4, 2026 at 5:24 am

    I believe this is the problem:

    gl.glDrawArrays(GL10.GL_POINTS, 0, points.length);

    glDrawArrays takes the number of vertices that you want to draw. You are giving it the number of floats, which is 3x too big. Therefore opengl is actually attempting to read 12288 vertices = 36,xxx floats from your points array, which way exceeds the bounds of your array.

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

Sidebar

Related Questions

I'm trying to display some data points using google graphs, but unfortunately there is
Im trying to display some files in a web page so the user can
I'm trying to display some large images with HTML img tags. At the moment
I am trying to display some message in span. but it is not working.
I'm trying to display some data from a list sharepoint and then using jquery
Hi i am new to jsp & was trying to display some data from
I'm trying to implemet a scrollable Text view (not editable) that display some help
I'm trying to work with a YII CGridview to display some data. This is
Right now, what i'm trying to do is display some lists on a page
I've been trying to display the box characters using PDCurses but for some reason

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.