12-23-2012 02:28 PM
Hello. I tried to render on screen PNG image with alpha channel, using bbutil_load_texture function for load image and that code
glVertexPointer(2, GL_FLOAT, 0, m_vertices);
glTexCoordPointer(2, GL_FLOAT, 0, m_tex_coord);
glColor4f(m_color.r, m_color.g, m_color.b, 1.0f);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
to render it on my playbook. But its looks like that OpenGL doesn't look at alpha channel at all - my image rendering without transparency. That is image, with I want to render: ClickMe
That is a screenshot of what I got on the screen: ClickMe
12-24-2012 06:17 AM - edited 12-24-2012 06:18 AM
correct me if im wrong but shouldnt you need GL blending turned on?
glBlendFunct(__Source blending__, _Destination blending_);
//Draw stuff here
then once finished:
replace source and destination blending with the settings you want.
12-24-2012 08:35 PM
First you create native window
the set up transparency
int transparency = SCREEN_TRANSPARENCY_SOURCE_OVER;
screen_set_window_property_iv(screen_win_gles, SCREEN_PROPERTY_TRANSPARENCY, &transparency);
Then format I was talking above:
int format = SCREEN_FORMAT_RGBA8888;
screen_set_window_property_iv(screen_win_gles, SCREEN_PROPERTY_FORMAT, &format);
... some more settings here..
and finally 'attach' EGL surface to this window by calling eglCreateWindowSurface()
So what I meant was format and transparency settings are important if you want to acheive OpenGL window drawing transparency (at least if it placed on top of other native windows).