Android : OpenGL App - Created Rendering Class Which Implements GLSurfaceView.Renderer
Jul 16, 2009
I've created a simple OpenGL app and created a rendering class which implements GLSurfaceView.Renderer. All it does is draw 100 triangles (NUM_OBJECTS = 100) on the screen and move them about, bouncing off the edges. The projection is glOrtho2D and there is no z-buffer. I'm running this on a G1 with continuous redraw enabled.
Here is the onDrawFrame method:
CODE:....................
View 23 Replies
Oct 8, 2010
Once again I'm trying to get into openGL, but as usual I choke when passing around vertices/vertixes/whatever and every little detail can lead to disaster (wrong format, initialization not properly set up, where memory are saved, etc.).
My main goal is to use openGL for 2D graphics to speed up performance compared to regular cpu drawing.
Anyways, my openGL Renderer looks like this code...
With an IndexOutOfBoundsException, but I'm sure there are more problems with the code.
View 1 Replies
View Related
Sep 11, 2012
I develop live wallpapers using Opengl ES 2.0 engine. My wallapapers run smooth on 2.x Android Devices , but in 4.03 i see some strange things. when app runs for first time everything goes fine.
But when screen orientation changes , or screen goes off and back on (that causes the renderer to call create surface again) renderer gives the glerror 1285. this error is Out of memory. Screen is flickering and draws objects as they ara doublicated in different locations.
View 1 Replies
View Related
Apr 27, 2009
I'm trying to compare the difference in speed between software and hardware graphics rendering. I have 2 apps right now - one written with only java/android 2D APIs, and one written with openGL calls...
View 6 Replies
View Related
May 7, 2014
I've been going over the android sdk for the past year to find out if there is a way to change the network type(2g/3g/4g), in phones with root access.However I couldn't find any way to do this.Asking around,someone told me that I could do this using reflection,by calling a method on a phone instance.Looking through the source code,I did find a setPrefferedNetworkType(); method in the Phone Interface,inside the internal telephony package.Is there anyway I can use this to solve my problem.I can't seem to find a way to get an instance of a class that implements the interface.Or is there any other way to do it entirely?
View 3 Replies
View Related
Oct 27, 2009
From the adb log of my G1's boot time, it shows "requestGPU returned -1", among other stuff. Does this mean that my OpenGL app is being rendered using software? BTW, I see the same messages on Hero as well.
------------------------------------------ log begin ------------------------------------------
I/SurfaceFlinger( 81): SurfaceFlinger is starting I/SurfaceFlinger( 81): SurfaceFlinger's main thread ready to run. Initializing graphics H/W... D/SurfaceFlinger( 81): pid 81 requesting gpu core (owner = -1) W/SurfaceFlinger( 81): couldn't grant gpu core to pid 81 D/EGL ( 81): requestGPU returned -1 E/libEGL ( 81): h/w accelerated eglGetDisplay() failed (EGL_SUCCESS) I/SurfaceFlinger( 81): EGL informations: I/SurfaceFlinger( 81): # of configs : 6 I/SurfaceFlinger( 81): vendor : Android I/SurfaceFlinger( 81): version : 1.31 Android META-EGL I/SurfaceFlinger( 81): extensions: I/SurfaceFlinger( 81): Client API: OpenGL ES I/EGLDisplaySurface( 81): using (fd=19) I/EGLDisplaySurface( 81): .......
View 2 Replies
View Related
Aug 30, 2009
I would like to write OpenGL classes and test them in java outside of an Android device or emulator, and then use these in the Android.
Has anybody done this?: If so, are there JOGL implementations that are directly compatible?
I tried doing this on Windows using JOGL and writing wrappers, etc, but it turned out to be a real mess. I finally gave up when I didn't know how to get a GLU instance for a frustrum call.
View 4 Replies
View Related
May 2, 2010
I would like to be able to use OpenGL in the Android to render into a bitmap (or any other sort of buffer I can turn into one), without actually displaying a GLSurfaceView.
The purpose is to dynamically create very complex images using OpenGL, and then drawing those images on the canvas of a MapView.
I have tried overlaying a translucent GLSurfaceView over a MapView, my preferred approach, but it has some problems:
1) I have complex menus I need to display from either the MapView or the GLSurfaceView. I have been doing this using a ListView with its own activity. Unfortunately, that activity pushes the MapView down the stack. The result is a bit of flickering when the ListView activity finishes, popping the MapView back to the top. Even worse, if I use the ListView to overlay the GLSurfaceView (giving it the same complex menu capabilities), when it finishes, the GLSurfaceView reappears but the MapView doesn't display.
2)As soon as the GLSurfaceView is created, the MapView stops fetching and rendering tiles. There seems to be no way to know when the MapView is complete, so I have to delay an arbitrary interval before creating the surfaceview.
3) When the GLSurfaceView is present, the MapView's built-in user interface functions are obscured.
Anyone know if there is a way around any of these problems?
View 4 Replies
View Related
Aug 19, 2009
I've noticed that OpenGLContext is removed from 1.5. Everybody says that GLSurfaceView should be used instead. Does this mean that there is no way to render OpenGL graphics into a regular View?
View 4 Replies
View Related
Nov 1, 2010
I created a method called insertTable in a class called Table but i can't use it in my onClick method in the main class :
CODE:.......
I want to do a income.insertTable in the onClick method but eclipse say that i need to create a local variable.
View 3 Replies
View Related
Feb 18, 2009
All the textures I create from my resource files are fine, but when I create a texture in the following way... <code> mOverlay = Bitmap.createBitmap((int)mWidth, (int)mHeight, Bitmap.Config.ARGB_4444); mOverlay.eraseColor(0); mOverlayCanvas = new Canvas(mOverlay);
...
Canvas c = mOverlayCanvas; c.drawColor(Color.argb(0, 0, 0, 0)); Paint p = new Paint(); p.setColor(Color.RED); c.drawCircle(160, 240, 10, p);
....................
View 4 Replies
View Related
Nov 19, 2010
I am working through a facebook-sdk example and trying to utilize the collection of classes as provided as a .JAR. I am relatively new to java and eclipse so I expect I am making some obvious blunder.
The issue is that everything seems to compile fine, but when I run the project (using the android emulator) dalvik vm is unable to find the first class I reference from this facebook sdk. ( com/facebook/android/Facebook.class )
As an aside, if I copy the source directly into my project as an additional package everything works fine.
Step 1: I exported the com_facebook_android project as a .JAR file. ( right click project, export, java / jar file ) I choose c:datajagjar as my location to save facebooksdk.jar.
Step 2: I hit properties on the project HelloGoogleMaps, Selected Java Build Path, Libraries, Add External JARS... I the directly selected the c:datajagjarfacebooksdk.jar file.
At this point my project seems to be building just fine ( no errors ).
Step 3: Debug the project and receive the error:
CODE:.................
View 3 Replies
View Related
Sep 12, 2010
I have code which has one activity which passes information to a second activity.
I can use this information to pass to a third activity with additional information from the result of the second activity.
I want to use gestures as a method of going back to a previous activity, but if I go back from the third to the second activity I need the information initially passed from the first to the second activity to still be present.
i.e.
First Acticity
what is Y?
answer y = 5
Second activity
User said Y = 5
what is X?
Third Activity
User said Y = 5
X = 6
Go back to Second activity but maintain the input of
User said Y = 5.
To do this I have used a bundle to pass the information between activities, but I can only access the info in the bundle from within a method within the class started by the intent.
The gesture controls are within another class, so I cannot access the bundle information from within this class as the getIntent command produces a not defined error.
What I need to do is to be able to pass the information from the bundle from the first activity to the gesture class so that I can pass it back when I go back using the gestures.
View 1 Replies
View Related
Oct 7, 2010
When using this class I get this strange exception. It is used to print out a nice timer display for my game, and is created when my main GameView class is created. The error gets thrown at line 26: super(s*1000,1000);
package tommedley.android.game;
import android.content.Context;
import android.graphics.Canvas;...
public static int MODE_COUNTING = 0;
public static int MODE_PAUSED = 1;
public static int MODE_FINISHED = 2;...
View 49 Replies
View Related
Nov 12, 2010
I have a game that relies on OpenGL ES 1.0 and I (finally) have it to the point that the amount of bugs and ANR's being reported through the Market is nearing zero. So, what better time to make a major revision that ruins all that, correct? What I would like to do is the following:
- Update to OpenGL ES 2.0 using android.opengl.GLES20 class: At the moment, my app actually imports a JSR-239 jar stub so I am compatible with non-Android devices. Since non-Android devices cannot match the pace of Android adoption, I think it is work the effort to make a branch that imports GLES20 and utilizes more features, specifically: - FBOs/VBOs - Floating-point calls (everything is still in fixed-point) - Shaders, etc. - Upgrade the application (2.x branch) without creating a new application in the market but still have users on older devices still see the 1.x branch....
View 3 Replies
View Related
Dec 21, 2009
I've been trying to figure out how to get to the current EGLContext from the GLSurfaceView. I looked at the APIs and looked at the code but it doesn't seem like there is any path to it. I could have just missed it - please correct me if I have, but it wasn't obvious. Now, I can totally understand the designer thinking that we should protect people from the context because they can cause bad things to happen but actually it would be nice to have access to swapbuffers so that we can do some effects. Fair enough, though.
The one thing I wanted was to see the current EGLConfig so that I could find out what config attributes I'm getting on weirdly-behaving devices like the Galaxy. It seemed easy enough - it's passed in to Renderer in the onSurfaceCreated method:
public void onSurfaceCreated(GL10 gl, EGLConfig config);
Great! Except wait, you can't query an EGLConfig without an EGLDisplay and that's locked up in the GLSurfaceView. So why is it passed in to the surface created method? Isn't it useless? Accord to GLES spec, an instance of EGLConfig is only good if you have the display/context instances that it was created from.
I didn't try querying it with the default context because it's supposedly invalid but perhaps someone could shed some light on this? I'd love if it were something dumb and obvious that I don't know about.
View 4 Replies
View Related
Dec 17, 2009
Maybe this group is not the right one to ask this question.
I am studying RIL and noticed RIL.java inplements CommandInterface twice( extend BaseCommand implement CommandInterface). What is it for? Any design pattern here?
View 2 Replies
View Related
Mar 30, 2012
Is there a rom for Android that implements windows 7?
View 1 Replies
View Related
Jul 21, 2010
Referring http://code.google.com/events/io/2010/sessions/developing-RESTful-android-apps.html. Can any body provide source/links which implements such a design?
View 2 Replies
View Related
Oct 9, 2009
I was using for sometime now OpenGL initialization code from Api demos and it was quite hard to exchange events between View and Renderer. So, I read pieces of documentation from GLES, EGL from jsr239 and finally made the single threaded GL initialization code which is much simpler than in ApiDemos. Here it is:
import javax.microedition.khronos.egl.EGL10; import javax.microedition.khronos.egl.EGLConfig; import javax.microedition.khronos.egl.EGLContext; import javax.microedition.khronos.egl.EGLDisplay; import javax.microedition.khronos.egl.EGLSurface; import javax.microedition.khronos.opengles.GL10;
import android.app.Activity; import android.os.Bundle; import android.os.Handler; import.................
View 2 Replies
View Related
Aug 27, 2010
Just curious to know android Graphical components (View) have their own specific renderer or they are using something like AWT, Swing or?
View 1 Replies
View Related
Mar 13, 2010
NSData means what? how to implements its characteristics in Java?
View 1 Replies
View Related
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
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
Jul 7, 2010
I'm creating a new class, using eclipse "New Java Class" dialog box. I can write the superclass I want (I can't find using "browse" button), but I can't write or select an interface to implement. I click "add" but ther is nothing to select. What I'm doing wrong?
View 4 Replies
View Related
Nov 10, 2010
I wrote a program in Android for setting different kinds of images as my background image, but it is not working with svg files. I am not getting any errors, it is not displaying any image and I'm getting a blank screen in my emulator when using svg files. Can any one suggest how to read and display svg files in Android with some code? Or should I convert xml code?
View 1 Replies
View Related
Sep 10, 2010
There's a decent amount of information out there on the Activity lifecycle. But I'm surprised how difficult it is to find a comprehensive description of the rendering lifecycle. By that I mean the order and rules by which a tree of nested activities, views, and drawables get to be sized and drawn to the screen, and the points at which a developer can modify rendering behavior.
View 1 Replies
View Related
Jul 14, 2010
I'm just getting into Android development, and I have a question about communicating between a receiver class and an activity class. I'm very new to JAVA and Android so I hope I don't sound too stupid. I'm developing an application where I intercept an SMS message and then based on various elements of that SMS I might delete it once it's been saved to the inbox. I have a receiver class that intercepts the txt message, and I am also able to delete messages from my inbox with code in the activity class using a button at the moment. The problem I have is communicating between the receiver class and the activity class where the code to delete a message resides. I tried putting that code directly into the receiver class but as I'm sure most of you already know the BroadcastReceiver class doesn't seem to support what I need to delete messages. I've been searching for an answer to this for a while, but haven't been able to find anything. Honestly I'm not sure I know enough about JAVA and Android to even recognize a solution if I saw it.
View 2 Replies
View Related
Jun 27, 2010
What I want to do, is be able to access the object neoApi inside the Neoseeker class, from its inner class RunningTimer. Now, in my code, you can see what I would think to work, but when I run my application, nothing pops up. Nothing inside my TextView, no Toast, nothing at all. How can I remedy this?
package com.neoseeker.android.app;
import java.util.Timer;
import java.util.TimerTask;
import org.json.JSONObject;
import android.app.Activity;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;.......................
View 1 Replies
View Related
Sep 8, 2010
I'm new to Java and android development. In my application I need data which is accessible for a few activities. I've read that a good solution is to use Application class for this. So I use it like this:
public class MyApplication extends Application {
private String str;
public String getStr(){
return str;
}
public void setStr(String s){
str = s;
}
}
and I can access this variable from activity like this:........................................
View 2 Replies
View Related