Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - INeedMySpace

Pages: [1]
1
Support / Re: Input text field
« on: January 28, 2011, 02:32:29 pm »
General info about RelativeLayout - http://developer.android.com/resources/tutorials/views/hello-relativelayout.html.
So you need to add GLSurfaceView in your layout - small modification of example from link

Code: [Select]
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <android.opengl.GLSurfaceView
         android:id="@+id/iglsurfaceview"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
    />
    <TextView
        android:id="@+id/label"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Type here:"/>
    <EditText
        android:id="@+id/entry"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@android:drawable/editbox_background"
        android:layout_below="@id/label"/>
    <Button
        android:id="@+id/ok"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/entry"
        android:layout_alignParentRight="true"
        android:layout_marginLeft="10dip"
        android:text="OK" />
</RelativeLayout>

2
News / Re: Wiki page seems to be broken!!! Action needed.
« on: January 28, 2011, 02:23:03 pm »
Thanks for your support m8!

3
News / Wiki page seems to be broken!!! Action needed.
« on: January 27, 2011, 04:03:54 pm »
Alarm!!! I tried to open wiki page from main site - http://www.jpct.net/wiki and found that someone broke it, intentionally i think  >:(. Check it please.

4
Support / Re: Input text field
« on: January 27, 2011, 03:12:48 pm »
Hi, I think one way is to separate 3D in GLSurfaceView and Android Widgets like EditText in the other layer.
In RelativeLayout for example.
I have tested it and it works.
Also you can change background for EditText from Android standart - android:background="@android:drawable/editbox_background" to something suits your needs. (I haven't tested it yet, but i thinks there should not be any problem).

5
Bugs / Re: Maybe a bug? Blank screen after Home button pressed
« on: January 11, 2011, 02:54:16 am »
I found following solution to resolve same situation. If my JPCT-AE application will be game, I don't really need several instances of my application running (read activities). Thus I made my gl renderer and its data (3d objects, textures etc) static and add check for initialization of data. That helps then it comes to activity start/stop, pause/resume and also to device orientation change (since android restarts activity on orientation change). Hope such approach can help you.

6
Support / Re: Transparent background for HelloWorld demo
« on: January 10, 2011, 03:42:34 am »
Very interesting - I assembled example with both glsurfaceview and surfaceview for camera as was described in dl.zerocool thread and it works :) Something i still can't understand from android reference FrameLayout
Quote
Children are drawn in a stack, with the most recently added child on top.
But it works well only with this layout - glsurfaceview first and surfaceview second. If you change order only camera preview will be seen.  As I understand order should be changed according to docs - grrr google.
Code: [Select]
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">

<android.opengl.GLSurfaceView
android:id="@+id/GLSURFACEVIEW"
android:layout_width="match_parent"
android:layout_height="match_parent"/>

<SurfaceView
android:id="@+id/CAMERAVIEW"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:keepScreenOn="true"/>
</FrameLayout>

But still I want to reproduce simple demo with JPCT-AE like TranslucentGLSurfaceActivity from google api demos.

7
Support / Re: Transparent background for HelloWorld demo
« on: January 10, 2011, 01:58:10 am »

Quote
I create a new camera and I give a render to my glSurfaceView
and of course set the Translucent window  (8888) pixel format and depth buffer to it.
(Without that your glSurfaceView will not support alpha channel and you will not see the camera layer.)

Yeah, I were trying to simplify example with glsurface and camera - something like Android API Demos http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/TranslucentGLSurfaceViewActivity.html but with JPCT-AE.
In my example it seems I don't forget all important steps:
- getWindow().setFormat(PixelFormat.TRANSLUCENT);
- mGLView.setEGLConfigChooser(8, 8, 8, 8, 16, 0);
- mGLView.getHolder().setFormat(PixelFormat.TRANSLUCENT);
- private RGBColor back = new RGBColor(0, 0, 0, 0); // color with alpha 0 (should be transparent as I understand)

8
Support / Re: Transparent background for HelloWorld demo
« on: January 09, 2011, 08:34:24 pm »
Try to use a color with an alpha value instead.
Egon, sorry, but I`m still confused. As I see in javadocs RGBColor:
public RGBColor(int r, int g, int b, int a) - Creates a new color with alpha.

Parameters:
r - red value between 0 and 255
g - green value between 0 and 255
b - blue value between 0 and 255
a - alpha value between 0 and 255

So private RGBColor back = new RGBColor(0, 0, 0, 0); will give me color with alpha 0 (fully transparent color). I used it in my example already. Clearing FrameBuffer with this color - fb.clear(back);
Do you mean something else?

9
Support / Transparent background for HelloWorld demo
« on: January 09, 2011, 05:05:31 am »
Hello guys.
I`m bit curious about JPCT-AE capabilities and started from small modification of HelloWorld example.
My goal was to setup transparent background for this demo. I tried some ways I found on this forum but still can`t reach my goal. I still have no transparent background.
Need you help. Here is some code modifications:
Code: [Select]
// in onCreate
super.onCreate(savedInstanceState);

getWindow().setFormat(PixelFormat.TRANSLUCENT);

mGLView = new GLSurfaceView(getApplication());

// mGLView.setEGLConfigChooser(new GLSurfaceView.EGLConfigChooser() {
// public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display) {
// // Ensure that we get a 16bit framebuffer. Otherwise, we'll fall
// // back to Pixelflinger on some device (read: Samsung I7500)
// int[] attributes = new int[] { EGL10.EGL_DEPTH_SIZE, 16, EGL10.EGL_NONE };
// EGLConfig[] configs = new EGLConfig[1];
// int[] result = new int[1];
// egl.eglChooseConfig(display, attributes, configs, 1, result);
// return configs[0];
// }
// });
mGLView.setEGLConfigChooser(8, 8, 8, 8, 16, 0);
renderer = new MyRenderer();
mGLView.setRenderer(renderer);
mGLView.getHolder().setFormat(PixelFormat.TRANSLUCENT);
setContentView(mGLView);
and also I have changed back color
Code: [Select]
//private RGBColor back = new RGBColor(50, 50, 100);
private RGBColor back = new RGBColor(0, 0, 0, 0);
Background is black and nothing is seen under. Have I missed some important point?
Thanks in advance for any hints.

Pages: [1]