How to use glTexDirectVIV interface to show a image?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to use glTexDirectVIV interface to show a image?

628 Views
huangzhong
Contributor II

I have problem in s32v234 platform, I want to  use glTexDirectVIV interface to show a image, and I do as below:

   1. init the gpu(use glClearColor interface display color ok)

   2. open a image file and read the image data to a buf

   3. give the buf address to glTexDirectVIV interface

the Implement code is:

   glEnable(GL_CULL_FACE);
   glViewport(0, 0, mWindowWidth, mWindowHeight);
   glScissor(0, 0, mWindowWidth, mWindowHeight);

   glClearColor(0.0, 0.0, 0.0, 0.0);

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);


   static int flag = 1;
   if(flag == 1)
   {
   int ret = -1;
   fd = open("/package/image0_out.yuv", O_RDWR);
   if(fd < 0)
   printf("open file failed!\n");

   ret = read(fd, image_display, 1280 * 720);
   if(ret < 0)
   printf("read file failed!\n");

   close(fd);

   flag = 0;
   printf("xixi read ok!\n");
}

glTexDirectVIV(GL_TEXTURE_2D, 1280, 720, GL_VIV_UYVY, (GLvoid**)(image_display));

But it do not work, could you give me a demo about how to user glTexDirectVIV in s32v234 platform?

Looking forward to you replay, Thank you very much!

Labels (2)
Tags (1)
0 Kudos
0 Replies