Android :: Rotating Textures When Using GlDrawTexiOES

Sep 27, 2010

I created a little texture drawing class from observing the LabelMaker example in the Android SDK. One thing I can't find however is how to rotate textures drawn with glDrawTexiOES. is it possible? I've just tried glRotatef but it has no effect.

Android :: Rotating textures when using glDrawTexiOES


Android :: GL Surface View GlText Image2D GlDrawTexiOES

May 3, 2010

I'm trying to render a 640x480 RGB565 image using OpenGL ES on Android using GLSurfaceView and Native C code. Initially I had a 0x0501 error with glTexImage2D, which I was able to resolve by changing the image dimensions. But now, in the "drawFrame" call, when I do glDrawTexiOES to resnder the texture, I'm getting the following error on the Logs: drawtex.c:89: DrawTexture: No textures enabled I'm already doing glEnable(GL_TEXTURE_2D), is there anything else I should do? Is there a complete example showing GLSurfaceView with native code using textures?

View 4 Replies View Related

Android :: Difference On Emulator Versus Actual G1 Phone For Method GlDrawTexiOES

Apr 5, 2009

I have a problem drawing a background for my OpenGL app on the emulator. It all works well on an actual G1, but i'm worried that if the emulator has a problem, other android phones may have the same problem. On an actual G1 the background is drawn on the background. All other drawing is drawn in front of it. On the emulator, the background is always drawn on the foreground, obsuring any other drawing. Here are two screenshots, where i have my background only occupying half of the screen: From emulato. Code...

View 2 Replies View Related

Android :: Transparent Textures...

Feb 15, 2009

I am using opengl for drawing 3d stuff, but so far I've been unable to use transparent textures...

This is what I do...

CODE:..............

View 2 Replies View Related

Android :: OpenGL Textures

Feb 17, 2010

I'm learning OpenGL on my own atm and I have a question about texturing a surface:

I can create a simple polygon like this:

CODE:......

Then I load all of that info into the approriate buffers and draw it to the screen with a call to:

CODE:..

My question:

I'm looking for a good example of how to take an image and texture it to the surface.

View 4 Replies View Related

Android :: Transparent Textures In OpenGL ES

Jun 21, 2010

I can't seem to get GLUtils.texImage2D to use my full RGBA (A=my alpha component).

I've tried doing setEGLConfigChooser(8, 8, 8, 8, 0, 0); getHolder().setFormat(PixelFormat.RGBA_8888);

I've tried converting the source image (.png in ARGB) to RGBA.. which works ok for the ordering of data before texImage2D, but when it draws, it draws yellow where it should be "transparent white"... which suggests it's diminishing the "B"(blue) component instead of the A(alpha) component. But the same thing happens when I just use the orignal ARGB data instead ("B" diminishes instead of "A", leaving yellow).

View 5 Replies View Related

Android :: Anisotropic Filtering On Textures?

Aug 18, 2010

I'm just learning OpenGL ES on Android, and I am trying to get some kind of anisotropic filtering on textures. I want to increase the size of a sprite, with some kind of interpolation, instead of this "nearest-pixel-interpolation".

Is there anything like this in the OpenGL ES standard or do I have to make one texture for each size?

View 2 Replies View Related

Android :: OpenGL More Textures For One Rect

Nov 1, 2010

In Android OpenGL ES, I want to be able to switch textures for a given Rectangle. I have one rect and I put two textures, depending on different conditions. I just want to switch between textures.

I followed this code to create the textures: http://blog.poweredbytoast.com/loading-opengl-textures-in-android but it seems that this is only for one texture.

If I use only one texture, it renders fine, but then I don't know how to tell the rect to use another texture (same rect, different texture). Do I do something like "setTexture" with the ID that is generated in loadTextures()? Do I have to have an array with texture names (numbers) that I then change .. I just don't get it..

View 2 Replies View Related

Android :: Enlarging Textures In OpenGL ES ?

Feb 19, 2010

I need to enlarge(Zoom) Textures when I hold&drag at the corners.

I am using glOrtho() to setup ModelView.

CODE:.............

I am able to do hit-test and detect corners of the images(Textures) on the screen.

Now I need to enlarge(zoom) the image(texture). I have offset values, means how far I moved on the screen in X,Y directions.

If I need to use glScalef(), it will accept values in percentage(I think). How can I map the offset values to this percentage value.

or is there any other way to zoom(ie by enlarging the background polygon vertices, so that the mapped texture will automatically get zoomed) ? In this method, I am fixing the polygon sides at time of Surface Creation.

View 1 Replies View Related

Android :: Loading Textures In OpenGL ES App

Mar 23, 2010

Good pattern for loading textures in an Android Java & OpenGL ES app.

My first concern is determining how many texture names to allocate and how I can efficiently go about doing this prior to rendering my vertices.

My second concern is in loading the textures, I have to infer the texture to be loaded based on my game data. This means I'll be playing around with strings, which I understand is something I really shouldn't be doing in my GL thread.

Overall I understand what's happening when loading textures, I just want to get the best lifecycle out of it. Are there any other things I should be considering?

View 1 Replies View Related

Android :: PNG Textures Not Loading On HTC Desire

May 19, 2010

I'm developing a game for android using OpenGL es and have hit a problem:

My game loads fine in the emulator (windows xp and vista from eclipse), it also loads fine on a T-Mobile G2 (HTC Hero) however when I load it on my new HTC Desire none of the textures appear to load correctly (or at all). I'm suspecting the BitmapFactory.decode method although I have no evidence that that is the problem.

All of my textures are power of 2 and JPG textures seem to load (although they don't look great quality) but anything that is GIF or PNG just doesn't load at all except for a 2x2 red square which loads fine and one texture that maps to a 3d object but seems to fill each triangle of the mesh with the nearest colour).

This is my code for loading images:

CODE:...........................

View 1 Replies View Related

Android :: How To Use Rotating Progress Bar?

Aug 30, 2010

I'm using Rotating Progress Bar in my Android Music Plyer Application....I'm not able to stop it. While working with horizontal Progress bar i used handler to stop and start it. But while working with Rotating One, The progress bar goes into Infinite Loop..

View 2 Replies View Related

Android :: What Is Best Way To Implement Dynamic Textures In OpenGL ES?

Jul 2, 2009

I have a texture-mapped cube based in part on the Kube API demo and the Textured Cube example from anddev.org, It is working fine using bitmaps loaded from R.drawable.. what I need to do now is to make the texture for each face dynamic (using Bitmaps created in code). I'm having trouble understanding how to change the textures on the fly and I'm hoping someone can point me in the right direction.What would I need to change in this code to allow an existing texture to be replaced (eg. a new Bitmap would be passed in instead of loading the resource, but when I try this the texture remains unchanged).

View 5 Replies View Related

Android :: Track Memory Used By OpenGL Textures?

Jun 19, 2010

How do I track the memory used by OpenGL textures in Android? I understand the texture memory is on the Video RAM, but do they get swapped in with the RAM? If I call glGenTextures and do not call glDeleteTextures, how does it impact the memory usage of my current process?

View 1 Replies View Related

Android :: Apply Different Textures On Different Faces Of Cylinder

Apr 12, 2010

how to apply apply different textures on different faces of a cylinder?I am able to apply one texture which covers the whole cylinder.But I want one texture for each face.

View 7 Replies View Related

Android :: OpenGL Poor Performance With Textures?

Jan 30, 2010

So I'm doing some simple 2D stuff with OpenGL on Android and found the performance to be very, very poor. To give you an example, I made an app with a full screen LSurfaceView. I loaded a 512x1024 texture (containing a 480x854 image), set up an orthogonal 2D matrix, and set it to draw a 480x854 pixel quad with that texture, using vertex and texture arrays. Lighting, dither, blending, etc. is disabled.

I would expect this to run at 60fps without problem, but that simple operation already drags the frame drawing time to 19ms/frame. If I add some more small textured quads around the screen, the drawing time goes up to 22/24ms. If I enable blending it balloons to 28/30ms. This is testing on a Motorola Milestone, running 2.0.1. Is this normal? Am I doing something wrong or is it just a common problem in Android?

View 24 Replies View Related

Android :: Using GlColor To Set Textures To Half Transparency?

Nov 19, 2010

Basically I have a fully functional ogl program (2D game) in opengl es 1.1, everything works fine except for one problem: glcolor

I'm trying to set some of my texture to half transparent and I would like to do it as follows;

gl.glColor4f(1f, 1f, 1f, .5f);
obj.draw(gl);
...

gl.glColor4f(1f, 1f, 1f, 1f);

I'm using VBO for my vertice, my textures and indices. (if that is relevant)

the problem is that nothing gets set to 50% transparency...

I'm don't think relevant to post all my code (mainly because it is spread out several classes with several GL options changing (blends, scissors etc etc).

What I would like is for people to tell me what state of OGL could prevent glcolor form working like I want, what functions should I check, what state should I call.

View 1 Replies View Related

Android :: Blank Textures On Droid (OpenGL)

Dec 28, 2009

I ran into a rather strange problem with my OpenGL game. While most textures look good, five or six are not drawn on Droid, and I don't see anything special about these images/models. For example, my HUD is made of 4 elements. The upper part is drawn correctly, while the lower part appears as white rectangles. The code used for loading and drawing these models and textures is exactly the same. Textures are 32-bit TGAs in both cases, POT dimensions, in - nodpi, inScaled==false, using GLSurfaceView to rule out configuration issues. No problems on G1 and Hero (and of course on emulator). And I don't have the Droid, so I can't just try whatever comes to my mind. Asked users to send me logs - no errors, all models and images appear to load normally.

View 2 Replies View Related

Android :: OpenGL ES Loading Textures After OnSurfaceChanged

Dec 5, 2009

I'm using GLSurfaceView for one of my applications and I've encountered a problem. It seems I can only create textures when in onSurfaceChanged, after that glGenTextures only returns 0. I've tried without glGenTextures and keeping track of texture indices myself, but the textures generated just turn up white. Is it only possible to load these types of resources in onSurfaceChanged (and possible onSurfaceCreated)? Or am I missing something?

View 2 Replies View Related

Android :: OpenGL ES Multiple Textures For One Rect

Nov 1, 2010

In Android OpenGL ES, I want to be able to switch textures for a given Rectangle. I have one rect and I put two textures, depending on different conditions. I just want to switch between textures.

I followed this code to create the textures: link text

and they render fine, but then I don't know how to tell the given rect to use another texture. Do I do something like "setTexture" with the ID that is generated in loadTextures() ? Do I have to have an array with texture names (numbers) that I then change .. I just don't get it..

View 1 Replies View Related

Android :: Textures Are White On Droid - And Not Other Phones?

Feb 26, 2010

I'm using GLSurfaceView to render OpengGL 3D. It works great on my nexus one, the emulators, and at least the G1. However, on the droid, the textures are white. I've seen this problem before when textures aren't loaded, and also when they aren't powers of two dimensions (not the case here). What's weird is that this started when I converted my program to use GLSurfaceView (it used to be based on some older example where I was doing the EGL stuff myself).

Textures displayed on the screen are white, but shapes that are just colors are displayed just fine.

The person testing this for me on their droid does not have the sdk, so if anyone would like to run this with the debugger, let me know and I can get you the apk.

View 7 Replies View Related

Android :: Rotating Text On A Button

Feb 25, 2010

How can i rotate a view and keep it like that. I have tried the Animation method discuss in the following discussion thread.

http://groups.google.com/group/android-developers/browse_thread/threa...

this works fine for the animation, but it does not handle the key press events itself.my requirement is simple, I need to show a text on a button upside down. Somewhat as if the parent view is drawn landscape and button is portrait.

View 2 Replies View Related

Android :: Rotating TextView Upside Down

Jul 24, 2009

I'm trying to find a way to rotate a View, or (more conveniently) an entire layout, upside down and have it stay that way. I found the rotation and animation classes in the SDK, and these come close to what I want, but at the end of the animation I want my Layout to stay rotated; repeating the animation or just flipping back right- side-up doesn't help me with my app unfortunately.The only thing I can think of so far would be to find the source code for the rotate class, and override it such that the "...and then flip it back around to be right-side-up" code never happens. I'm not sure exactly where I'd find the original rotate code for reference if I were to do something that extensive however.I've found references online to the full android source - is that basically what I'd be looking at downloading to be able to attempt something like this? Am I missing a simple option on the rotation that would let it just stay put after I rotate it? Any help would be very much appreciated!

View 6 Replies View Related

Android :: Drawable Rotating Around Its Center ?

Sep 27, 2010

I am getting strange results with the following code:

CODE:......................

Whats the right way to specify the axis point (center of the drawable)?

View 2 Replies View Related

Android : Rotating Quad Around Its Center

Jun 18, 2010

I'm a newbie in OpenGL. :D I'm trying to rotate a quad around its center.This is my scenario: I've a quad, drawn with TRIANGLE_STRIP, at specified coordinates.Now I want to rotate of 45 degrees around its center, without move it from its position, not around the origin of the aces. I hope you are able to understand my english.How can I do that?

View 10 Replies View Related

Android :: Mapping Multiple Textures To Cube In OpenGL ES

Jun 25, 2010

I have just began opengl programming in android and i am fairly new to opengl as well. I've been using nehe's opengl tutorials as well as insanitydesign's android ports.I successfully managed to create a cube with a single texture mapped to all its 6 faces. I even mapped multiple textures to different faces of the cube.But the way I did it was to create 6 faces seperately, have 6 seperate index and texture buffers and then using glBindTexture() with the selected texture for each face and then calling glDrawElements. Isn't there an efficient way around this. Should i use a cube map texture instead of a GL_TEXTURE_2D?

View 4 Replies View Related

Android :: Mapping Multiple Textures To Cube's Faces

Jun 25, 2010

I have just began opengl programming in android and i am fairly new to opengl as well. I've been using nehe's opengl tutorials as well as insanitydesign's android ports. I successfully managed to create a cube with a single texture mapped to all its 6 faces. I even mapped multiple textures to different faces of the cube.But the way I did it was to create 6 faces seperately, have 6 seperate index and texture buffers and then using glBindTexture() with the selected texture for each face and then calling glDrawElements. Isn't there an efficient way around this. Should i use a cube map texture instead of a GL_TEXTURE_2D?

View 1 Replies View Related

Android :: OpenGL ES Render Textures Of Non Base 2 Dimensions

Sep 18, 2010

Question before I dive deeper into converting my current rendering system to openGL. I heard that textures needed to be in base2 sizes in order to be stored for rendering. Is this true?

My application is very tight on memory, but most of the bitmaps are not a perfect square. Does storing non-base 2 textures waste extra memory?

View 3 Replies View Related

Android :: OpenGL Textures Fails On Motorola Milestone

Jun 30, 2010

I have troubles with OpenGL textures on Motorola Milestone with 2.1 firmware. Each call to glGenTextures fails with error GL_INVALID_OPERATION and sets the id with random numbers. The exact same application works on G1 without any error.

View 1 Replies View Related

Android :: Text Textures With Custom Fonts OpenGL ES

Sep 10, 2010

I'm creating an opengl es application and I would like to be able to dynamically create the text of my buttons etc.

The 2 obvious reasons for that are:

-to be modular (changing the text quickly without using photoshop)

-to be able to add languages later down the line

give me the basic steps/functions to:

create textures form text load custom fonts to display text textures with the chosen custom font indicate if I can use this for loading Kanji ?

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved