Cant find the solution for this GLSurfaceView error

by satish bhoyar » Wed, 03 Feb 2010 17:04:48 GMT


Sponsored Links
 Hi all,

I have a code for GLSurfaceView which runs fine with sdk 1.5. I am trying to
use it in the sdk 2.0 I am getting following error - >
"*Application called a GL11  Pointer method with an Indirect Buffer*"

This is the line at which the error is coming,
*gl.glVertexPointer(3, GL10.GL_FLOAT, 0, slicesBuffers[i]);

*Please anybody explains me why this error comes & how to solve it?

or any other  suggestion is also good for me.

Thanks,
SaT

--



Cant find the solution for this GLSurfaceView error

by satish bhoyar » Wed, 03 Feb 2010 17:05:03 GMT


 Hi all,

I have a code for GLSurfaceView which runs fine with sdk 1.5. I am trying to
use it in the sdk 2.0 I am getting following error - >
"*Application called a GL11  Pointer method with an Indirect Buffer*"

This is the line at which the error is coming,
*gl.glVertexPointer(3, GL10.GL_FLOAT, 0, slicesBuffers[i]);

*Please anybody explains me why this error comes & how to solve it?

or any other  suggestion is also good for me.

Thanks,
SaT

--


Sponsored Links


Cant find the solution for this GLSurfaceView error

by MrChaz » Fri, 05 Feb 2010 01:24:23 GMT


 As the message suggests you're using a direct buffer to store you
vertex and or texture co-ordinates.
You need to use allocateDirect() instead.  Even though you can do it
the other way in 1.5 you shouldn't because it can cause random crashes




--



Other Threads

1. onListItemClick() does not work if I extend ArrayAdapter

Hi,

I am a bit puzzled, because it seems that if I extend ArrayAdapter
then onListItemClick will not fire.
For example:

//init 2 arrays that I will parse into my own ArrayAdapter that
  String [] Artist = {"test 1", "test 2", "test 3", "test 4", "test
5"};
  String [] Song = {"test 1", "test 2", "test 3", "test 4", "test 5"};

     MyDoubleTextViewAdapter dta = new MyDoubleTextViewAdapter(this,
R.layout.row,  Artist, Song);

setListAdapter(dta);

//This code will display the ListView pefectly. However if I want the
items in the list to be clicked then I should overide the
onListItemClick

protected void onListItemClick(ListView l, View v, int position, long
id) {
         Log.d("LOG", "FIRE !!!! " );
         super.onListItemClick(l, v, position, id);

    }


Basically the onListItemClick never fires.

If I change the code so that it does not extend ArrayAdapter and pass
through one Array object

  setListAdapter(new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, Artist));

Then the onListItemClick Works !

So what is the problem with onListItemClick and extending
ArrayAdapter ??


Thanks
--~--~---------~--~----~------------~-------~--~----~

2. Question about picking an image from sd card

Hi,

I have the following code to pick an image from sd card:

 private void pickPhotoAction() {
        Intent intent = new Intent(Intent.ACTION_GET_CONTENT, null);
        intent.setType("image/*");
        intent.putExtra("crop", "true");
        intent.putExtra("aspectX", 1);
        intent.putExtra("aspectY", 1);
  try {
            intent.putExtra("return-data", true);
            startActivityForResult(intent, PHOTO_PICKED);
 } catch (ActivityNotFoundException e) {
}
}

It did launch an activity for me to pick an image from sd card.
But my question is why the bitmap i get from the activity is limited
to 188 x 188?

Here is they code I have for getting the result:

 protected void onActivityResult(int requestCode, int resultCode, Intent data) {

        switch (requestCode) {
            case PHOTO_PICKED: {
                final Bundle extras = data.getExtras();
                if (extras != null) {
                    Bitmap photo = extras.getParcelable("data");
                   // why this is  188 x 188?
                    System.out.println ("**** PHOTO_PICKED
photo.getWidth():" + photo.getWidth() + " getHeight():" +
photo.getHeight());


                }
....
}

Thank you.

--~--~---------~--~----~------------~-------~--~----~

3. Runtime.getRuntime().exec() does not return

4. onListItemClick() does not work if I extend ArrayAdapter

5. Intents with SDK 1.5

6. Where do I start

7. A couple of questions from a beginner