can i draw framebuffer ?

i have  RGBA5551 data ( GLushort pdata[512*512]) ,the data <SPAN id=result_ =“short_text”>Similar <SPAN id=result_ =“short_text”>Video,away <SPAN id=result_ =“short_text”>Update.

 

now my code:

===================

init

{

  glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 512,512, 0, GL_RGBA,GL_UNSIGNED_SHORT_5_5_5_1,pdata);
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER, GL_NEAREST);
 glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER, GL_NEAREST);
 

}

 

Render

{

   update pdata[] data;

  (i use memset ,so Ignore calculation Expend time)

 

   glTexSubImage2D( ...512,512...);

    ....

   glDrawArrays(GL_TRIANGLE_STRIP,0,4);

}

==========================

Expend 50 ms per frame.(20 FPS)

 

(use RGB888 ,Expend 70 ms per frame)

 

i need to Faster .

 

can i Direct draw framebuffer ?

Which functions?

 

or other Suggest.

 

tks.
gbaup2010-08-26 03:06:29

i read  OPENGL PBO for streaming textures.

 

====================


glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, pboBufferID);

====================
#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC
 

i don't kown OPENGLES1.X

 

glBindBuffer(WHAT?, pboBufferID);

 


 

Unfortunately, PBO’s are unavailable in OpenGL ES (A list of all possible extensions for OpenGL ES 1.x & 2.0 is available here)





If you have access to the IMG texture streaming extension (which I assume is a possibility, after you started this topic) then you may be able to create a texture stream to write your decoded images to, which will allow you to use your video frames as textures within your application. This will remove the bottle neck of regularly copying images into your application and uploading them through GL calls.Joe2010-08-27 09:51:49

 yes.i have access to the  IMG texture streaming extension .

 

i kown "how to extension " ,but i don't kown "how to use the Function"

 

but ,

 

glTexBindStreamIMG(WHAT?, WHAT?);
glGetTexStreamDeviceAttributeivIMG(GLint device, GLenum pname, GLint *params);
GLubyte * GL_APIENTRY glGetTexStreamDeviceNameIMG(GLint device);


======================

the device....what is?

GLint *params ....i don't kown "how to bulid".

 

i just have  pdata[] (decoded done)

 

i using TI3530 ,POWERVR SGX530.
gbaup2010-08-27 01:38:56

If you look through the code in the link you sent in the other topic you started, there is an example of glTexBindStreamIMG being used.





The first parameter passed to glTexBindStreamIMG() is the ID of the texture stream (an integer value that either can be retrieved through a driver developer specific texture stream creation/management module (such as the TI bc-cat kernel module), or the driver supplier should be able to tell you this value if it is hidden).


The second parameter is an integer ID for the particular buffer within the stream that you want to bind (between 0 and the maximum number of buffers available in the texture stream).





Personally, my approach is the following (where I have assumed you already know the texture stream ID you should be using and have assigned the value to i32TexStreamId):





Code:

/* Query buffer device details through GL extensions */
          myglGetTexStreamDeviceAttributeivIMG(i32TexStreamId, GL_TEXTURE_STREAM_DEVICE_NUM_BUFFERS_IMG, &i32BufferCount);
          myglGetTexStreamDeviceAttributeivIMG(i32TexStreamId, GL_TEXTURE_STREAM_DEVICE_WIDTH_IMG, &i32Width);
          myglGetTexStreamDeviceAttributeivIMG(i32TexStreamId, GL_TEXTURE_STREAM_DEVICE_HEIGHT_IMG, &i32Height);
          myglGetTexStreamDeviceAttributeivIMG(i32TexStreamId, GL_TEXTURE_STREAM_DEVICE_FORMAT_IMG, &i32Format);



After this, the i32TexStreamId value can be used to allocate texture handles and bind them to each buffer within the texture stream:



Code:

/* Allocate the required number of texture handles */
     puiTexture = new GLuint[i32BufferCount];

          /* Bind a texture to each buffer in the buffer device */
          glGenTextures(i32BufferCount, puiTexture);

          glActiveTexture(GL_TEXTURESTREAM);
          for(j = 0; j < i32BufferCount ; ++j)
          {
              glBindTexture(GL_TEXTURE_STREAM_IMG, puiTexture[j]);

             glTexParameterf(GL_TEXTURE_STREAM_IMG, GL_TEXTURE_MIN_FILTER, TEXTURE_STREAM_FILTER);
             glTexParameterf(GL_TEXTURE_STREAM_IMG, GL_TEXTURE_MAG_FILTER, TEXTURE_STREAM_FILTER);

              myglTexBindStreamIMG(i32TexStreamId, j);
          }



Once this has been done, the texture stream buffers can be used in a similar way as 2D textures:



Code:

/* Bind texture */
glActiveTexture(GL_TEXTURESTREAM);
     glBindTexture(GL_TEXTURE_STREAM_IMG, puiTexture[uiCurrentBuffId]);



Let me know if this helps :)Joe2010-08-31 09:58:26

thank you very much.