Android : Is OpenGL Faster Than Canvas / Drawable Method For Graphics?

Nov 6, 2009

Or does it merely provide more options for graphics?

Android : Is OpenGL faster than canvas / drawable method for graphics?


Android :: Method To Draw Bitmaps Faster On Droid Canvas / OpenGL?

Jun 15, 2010

I currently have a game written using the Android canvas. It is completely 2D, and I draw bitmaps as sprites on the canvas, and it technically works, but I have a few features that I need to add that will require drawing many more bitmaps on the screen, and there will be a lot more movement.

The app needs more power.

What is the best way to go from this method of drawing Bitmaps on a canvas to using OpenGL so I can draw them faster?

View 2 Replies View Related

Android :: Canvas Faster Than OpenGL?

Dec 20, 2009

I have downloaded and run the SpriteMethodTest on my Droid but compiled to 1.6 Android. I am getting the very strange behavior that drawing bitmaps to *canvas* is faster than using OpenGL. At 100 sprites, I am getting about 64 fps for Canvas. For OpenGL, its around 34 fps.

I also ran the same test on the 1.6 emulator. 100 sprites came in at 30 fps for canvas, just 6 for OpenGL!

I was so astonished that I actually checked that the radio buttons were running the right tests.

View 2 Replies View Related

Android :: Way To Persist Graphics On A Canvas (map Overlay)?

Feb 16, 2009

I've been searching around and can't seem to find a way to do this properly. I am doing some tracking where I want to draw dots on a map overlay recording previous positions. When onDraw of the overlay is called it seems the canvas is cleared so I have to redraw all of the history on every invocation. This could result in several thousands of dots being draw over time which seems to not be very efficient. Is there some flag somewhere that I have not found which tells a map overlay to be persistent? Or is there some way I can save and restore the canvas so I'm only maintaining/drawing the current point on each onDraw?

View 4 Replies View Related

Android :: Curved Graphics In OpenGL ES

Aug 18, 2009

I was disappointed to discover that OpenGL ES, the flavor of OpenGL implemented in Adroid, doesn't appear to support the usual techniques for drawing graphics involving curves. I'd be happy with either OpenGL's low-level Bezier evaluators, or the more advanced NURBS approach, but AFAICS neither is supported - only straight-line graphics are possible. Does anyone know, am I missing something basic here? Is there a way to generate curves of any sort in Android's OpenGL implementation? I am still fairly new to Android development, so that's certainly possible. Note that I'm not talking about functions related to Canvas - I know about drawOval, for example - but I specifically need 3D.

View 2 Replies View Related

Using Canvas For 2D Graphics - Switching Between Views

Feb 6, 2012

i am using canvas for 2D graphics using Views, Now i have to switch from one canvas to another Canvas.

View 1 Replies View Related

Android :: OpenGL ES 1.1 Vs 2.0 For 2D Graphics - With Rotated Sprites

Mar 14, 2010

I am having trouble finding information related to which i should choose, OpenGL ES 1.1 or 2.0 for 2D graphics.

OpenGL ES 1.1 on Android is a bit limited to my knowledge, and based purely on sprite count the only useful renderer is draw_texture() (as far as i know). However, that does not have rotation and rotation is very important to me.

Now with the NDK adding support for OpenGL ES 2.0, i am trying to figure out if there is anything that preforms as well as draw_texture(), but can handle rotation.

Anyone have any information on if 2.0?

View 2 Replies View Related

Samsung :: Captivate Graphics Processor / Which Gpu Is Faster?

Jul 16, 2010

I would like to know which gpu is faster between the iphone and the captivate. I'm leaning towards the captivate and gonna try to get it tomorrow or Saturday, but i also want a phone that could game. the iphone has some pretty cool games and i haven't seen some really fun ones on the captivate. just would like to know which has a better to gpu to game. I'm not expecting some crazy graphics cus i know there just phones, but just wanna know.

View 11 Replies View Related

Android :: Training Session / Course For Droid Graphics API - OpenGL ES?

Sep 25, 2010

Can anyone please recommend a training session/course for Android graphics API/OpenGL ES?

View 1 Replies View Related

Android :: Converting Canvas To Drawable?

Sep 5, 2009

Is it possible to convert a Canvas to Drawable?I may be really off in my solution, so if you have a better suggestion, please do tell me. This is what I'm trying to do.I'm trying to create a custom RadioButton. to set different states of the radio button, I need to use this parameter and one of the parameter to addState is Drawable. I know I can easily provide an image file and use it as a Drawable, but I want to do some image manipulation to the image before using it.There is a tutorial in ApiDemo called AlphaBitmap. It uses the onDraw method of a View to change a PNG file to full red and draw something with a gradient. So I customized it to shade an icon with gradient. So the problem now is that this is a View, and the View works perfectly fine if I add this View to the main view. But i want to convert this View to Drawable so I can use it as one of the parameter in addState. What I really want to achieve is to have different colour shades for different state of the RadioButton without providing different images to do so.

View 6 Replies View Related

Android :: Drawable Cannot Draw Into Canvas / What To Do?

May 26, 2009

I want to load an icon from resource and draw over it. But I cannot get it into a canvas. Can anyone please help me with the code below. If I uncomment c.drawColor(), I get blue color as expected. So the problem is on icon.draw(). code...

View 2 Replies View Related

Android :: OpenGL ES Canvas ?

Jun 13, 2010

I'm working on an OpenGL ES game using the NDK. My min SDK version is 1.6. I have created an OpenGL Es 1.0 renderer in Java and am calling a native JNI method in that renderloop.

The problem I'm having is that it seems that the resolution of the rendering context is limited. When using the emulator I'm getting a rendering canvas of 480x320, which is fine. Now; when I use my HTC Desire I am only getting a canvas of 533x320 while the native resolution of this phone is 800x480px.

View 2 Replies View Related

Android :: Building Drawable Images To Use On Surface Canvas

Sep 28, 2010

I have some images (.png format) that I use as drawables on the surface of canvas in my android app. The problem I have is mspaint only allows a rectangular image file, so whatever I draw on the screen always shows up in a box. Is there a (free) program or way I can edit the png files so that when they are drawn on the surface of my canvas, they are drawn to shape?

View 1 Replies View Related

Android :: Animating A Drawable On A Canvas Inside A Surfaceview

Sep 2, 2010

Is there a way to animate drawables on a canvas using the android built-in animation classes?

Ive been modeling my test application, a game, after the example apps lunarlander and jetboy. They contain a lot of reusable code, but they manually update the drawable objects in real time. It seems like using the android animation built ins would be so much easier since they provide the type of animation I need¦a simple linear movement.

Is there a way to do this, or am I better off updating my canvas in real time much like the example apps.

If there is a way, could anyone get me started with some sample code? I am currently inheriting SurfaceView in my class.

View 1 Replies View Related

Android :: Drawable Object Where I Can Store Points For Faster Paint?

Aug 21, 2010

I'm designing a custom view which is an X/Y Plot. It's a moving graph that scrolls to the left with time and new Y values are continuously coming in at 10 per second.

I've been able to make it work with an array of integers where the array index is the X value and the integer value is the Y value, but this seems horribly inefficient (Because every time it comes time to re-paint, I have to loop 800+ times to paint the graph). Then we do it all again 10 times a second. yuck.

Can anybody think of a paintable object that I can draw points to and perform some kind of scroll transformation and then just draw the new points each time, rather than the whole canvas?

Any other ideas out there?

View 1 Replies View Related

Android :: Runs Phone Game Using Canvas Porting To OpenGL

Jun 18, 2009

My game runs fairly well on my phone, but i want to increase the performance by using opengl. However currently i use the Canvas. I am a beginner in opengl. I have to port all my drawing code to opengl. However can somebody give me directions. For example how do i do the following in opengl:

c.save();c.scale(0.3f+scale, 0.3f+scale, width/2, height/2) c.drawBitmap( bMsg.bitmap, width/2 - bMsg.bitmap.getWidth()/2,dy+height/2 - bMsg.bitmap.getHeight()/2, MESSAGE_PAINT);c.restore();

And why cant i just use Canvas as an abstraction layer (facade) for opengl. An implementation of canvas could call the correct opengl methods in order to render. Why do i have to port all my code. I thought the canvas was a good abstraction interface to a drawing surface, why do i have to bother with opengl? It looks like this is possible, when is see the following contructor: "public Canvas (GL gl)" Also the this seems usefull. SURFACE_TYPE_GPU Surface type: creates a surface suited to be used with the GPU So what should i do? Re implementing the GamePainter completely and call opengl functions directly? Or is there some kind of abstraction mechanism, so that i can use OpenGL with just a few lines of code?

View 4 Replies View Related

Android :: Draw Translucent Bitmaps Using Canvas Without Having To Resort To OpenGL?

Mar 17, 2010

I have a Bitmap object and want to render it to a Canvas object with varying levels of translucency (i.e. make the whole bitmap partially see through). For example, I have sprites in a game (that are drawn over the top of a bitmap background) that I want to fade out from being opaque to being invisible. Can I do this without having to resort to OpenGL?

View 2 Replies View Related

Android :: Large Efficiency Difference Between Canvas.drawBitmap Vs OpenGL?

Mar 11, 2009

Greetings Developers,

I am just putting this question out there.

Is there a large efficiency difference between Canvas.drawBitmap or OpenGL. I am drawing using Canvas.drawBitmap and running slowing FPS, would openGL speed that up a lot you think?

View 7 Replies View Related

Android :: How To Know An Opengl Method Is Implemented - In Runtime

Sep 13, 2010

I mean in runtime. Sometimes I get "called unimplemented OpenGL ES API" error but it can not be catched. Is there a way to figure out what function is implemented or not, in runtime?

View 2 Replies View Related

Android :: Method To Capture Video From OpenGL App?

Sep 16, 2010

Does anyone knows some convinient method to capture video from OpenGL app on Android device? For example can we capture video from a view, opengl view? I just stopped on: 1) We can get frames using glReadPixels. (No video on this step?) 2) MediaRecorder can encode video, but how can we provide it our raw source, if possible? 3) Any working ports of ffmpeg(for example) or other encoding library? There are some tutorials of portng ffmpeg to use withing NDK. So, having raw frames and working port of ffmeg we can create video? Any issues on this step? Anyone managed to port any encoding library successfully?

View 3 Replies View Related

Android :: Method To Capture Video To File Or Stream From OpenGL App?

Sep 16, 2010

Does anyone knows some convinient method to capture video to file or stream from OpenGL app on Android device? For example, can we capture video from a view, opengl view?

I just found out the following:
1) We can get frames using glReadPixels. (No video on this step?)
2) MediaRecorder can encode video, but how can we provide it our raw source, if possible?
3) Any working ports of ffmpeg(for example) or other encoding libraries? There are some tutorials of portng ffmpeg to use withing NDK. So, having raw frames and working port of ffmeg we can create video? Any issues on this step? Anyone managed to port any encoding library successfully? What components do I need from ffpmeg?

View 1 Replies View Related

Games :: Best Game/graphics Demo To Show Off Android Graphics Engine

Mar 31, 2009

I want to show off how good opengl es can display on my G1. Does anyone know a game with good 3D graphics that I should install for this?

View 13 Replies View Related

Android :: Reset Canvas - Draw A New Bitmap Into The Canvas

Jul 7, 2010

My loadMap() method generate a canvas.throwIfRecycled exception when i try to load a new map.
When i start the game, the initial map loads and work fine though,
its only when i try to load a new map that i get the exception ..

How can i "reset" canvas and the bitmap i use to draw into, so i can startover fresh with them ?
here's what i use to create and draw my maps:

CODE:.........

So basicaly once i created and used picDest and canvas, i cannot figure how to reset it all for when i want to load a new map..

View 1 Replies View Related

Android :: High Density Emulator Use Drawable Mdpi Folder Instead Of Drawable Hdpi

Oct 19, 2010

I am running my application in the emulator using a high density skin (like WVGA800). However the ressources in my application are loaded from the drawable- mdpi folder instead of drawable-hdpi ... what else should I do so that android use the correct folder ?

View 4 Replies View Related

Android :: OpenGL Speed Issue - Code Contribution To Other OpenGL

Feb 25, 2009

Single Threaded OpenGL game ! (check bottom, you can download and use the helper class) Lighting disabled ! Depth Buffer disabled ! Culling enabled ! Textures disabled !

Just 176 integers (x,y values only) making 88 vertexes along with 132 index numbers making "44 triangles only"

Framerates I get is

with GL_BLENDING disabled - 145 fps approx only! enabled - 110 fps approx only!

I have the screenshot of exact code in the draw function here.. just 2 damn lines ! I have hidden only the comments.. click here to see it http://prasna991.googlepages.com/drawframe.png

variable details in the 2 lines of code =========================== ipts = 176 elements (only x and y for each vertex) totallinetriangles * 3 = 176 lineindexes = 132 elements - type "short"

Here is the screenshot of output drawing and how it will look like http://prasna991.googlepages.com/screen.png

OpenGL single threaded Initialization Helper ================================ Here is my OpenGL helper class.. makes the OpenGL initialization for newbies a cakewalk http://prasna991.googlepages.com/OpenGLHelperclass.txt

I tested by rendering on the touch event only.. frame rate drops only when u touch and drag and here I have just tested by tapping and releasing gently on the emulator and on the device

Is this the device limitations ? So graphics is actually a lot lot lot slower than on iPhone ?

View 8 Replies View Related

Android :: NDK OpenGL - Mixing Java And Native - C - Calls To OpenGL API

Jul 24, 2010

I would like to be able to use the OpenGL API from both Java and C (via NDK).

In Java, there is a GL object passed, which has all GL methods on it.

In C, you just talk to the native library.

In a single onDrawFrame callback (for which Java is passed a GL), can I use methods on the GL object, and also call NDK methods which access the openGL library?

In other words, is the GL object just a wrapper for the same instance of the native library?

View 3 Replies View Related

Android :: Method OnBackPressed() Of Type FirstGroup Must Override Superclass Method

Sep 7, 2010

I'm trying to override the onBackPressed() method of the ActivityGroup class:

public class MyClass extends ActivityGroup {

@Override
public void onBackPressed() {
// do something
return;
}

but I'm getting the error The method onBackPressed() of type MyClass must override a superclass method. I'm relatively new to Java, I've seen here that people do it and it works for them Why I'm getting this error? I'm writing an app for android 1.5, could the problem be here?

View 1 Replies View Related

Android :: Show Method Definition - Eclipse Recognizes Warning On Method

Nov 22, 2010

In Eclipse, when I mouse hover over a built-in method, it displays a method definition including stuff like what the method does, input objects, return objects etc. If I have a yellow line (warning) under the method I'm trying to use, I can't get the mouse-over to show the definition. If I try hitting F3, I get a "The Jar of this class file belongs to container "Android 1.6" How do I show the definition of the method I am using when there is a warning?

View 1 Replies View Related

Android :: Method.getAnnotation( ) Or Method.isAnnotationPresent( ) Not Working

May 12, 2010

I am trying to use annotation - method.getAnnotation( ) or method.isAnnotationPresent( ) and it is not working. I am using eclipse emulator for 2.1 OS version with JDK 1.6. Following is information about what I did..................

View 4 Replies View Related

Android :: Graphics

Feb 26, 2010

I have rectangle white box. on cliking the rectangle I will draw a toolbar beneath the box and also call relayout to accomodate the toolbar ( size+100) ( i used surfaceview and in secondary thread i draw the toolbar) on click again on rectangle box it will disappear the toolbar and also has to resize the layout to original size (ie size-100) this is where I get stuck. I can disappear the toolbar however I cant call relayout either from secondary thread (says cant call from secondary thread). So I created a while loop in onlayout( this is where i create a thread to draw the toolbar) if i call requestlayout after while loop ends it doesnt do anything it doesnt call onmeasure etc.

View 4 Replies View Related







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