thanks for the reply..
but i dont find GL_CLAMP in my GL10 interface. is there any alternative...?
kindly help!


On Mon, Jul 20, 2009 at 8:53 PM, Streets Of Boston
<[email protected]>wrote:

>
> For no repeat:
>
> http://www.khronos.org/opengles/documentation/opengles1_0/html/glTexParameter.html
> and look at GL_CLAMP.
>
> Texture y-coordinates go from the bottom to the top when y increases.
> Bitmaps/images usually go from the top to the bottom when y increases.
> Just flip your bitmap along the y-axis.
>
>
> On Jul 20, 11:04 am, kalyan simhan <[email protected]> wrote:
> > hi all..
> > I want to load a bitmap on a GLSurfaceView..
> > I do it like this:
> > // In the SurfaceCreated function in the class that implements
> > GLSurfaceView.Renderer
> >         int[] textures = new int[1];
> >         gl.glGenTextures(1, textures, 0);
> >
> >         mTextureID = textures[0];
> >         gl.glBindTexture(GL10.GL_TEXTURE_2D, mTextureID);
> >
> >         gl.glShadeModel(GL10.GL_SMOOTH);
> >         gl.glEnable(GL10.GL_DEPTH_TEST);
> >         gl.glEnable(GL10.GL_TEXTURE_2D);
> >         gl.glTexParameterf(GL10.GL_TEXTURE_2D,
> GL10.GL_TEXTURE_MAG_FILTER,
> >                                          GL10.GL_LINEAR);
> >         gl.glTexEnvf(GL10.GL_TEXTURE_ENV, GL10.GL_TEXTURE_ENV_MODE,
> >                                          GL10.GL_REPLACE);
> >
> >         InputStream is = mContext.getResources()
> >                 .openRawResource(R.drawable.map);
> >         Bitmap bitmap = null;
> >         try {
> >             bitmap = BitmapFactory.decodeStream(is);
> >         } finally {
> >             try {
> >                 is.close();
> >             } catch (IOException e) {
> >                 // Ignore.
> >             }
> >         }
> >       GLUtils.texImage2D(GL10.GL_TEXTURE_2D,0,bitmap,0);
> >
> > But the bitmap repeats itself on the surface and is also inverted..
> > why is this.. How do i make it appear only once...kindly help!!
> > Thanks in advance.
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to