rexsj
Posts: 16
Joined: Tue Dec 11, 2012 8:43 am

Opengles slideshow

Tue Dec 11, 2012 8:53 am

Hello........my doubt is......Can i update my textures on opengles??
Right now, I am displaying 3 png images.......but will it be possible to display next 3 images after some delay?
I have been trying to do this...........and i found no post related to this.
Please help.Thanks in advance

rexsj
Posts: 16
Joined: Tue Dec 11, 2012 8:43 am

Re: Opengles slideshow

Wed Dec 12, 2012 6:33 am

I dont know if my question is unclear.....
Do i have to use some add-on for running a slideshow on opengles? what are the options possible ?
i am using freeimage to load the png image and render it to the screen via opengles.
Now how do i show it in a sequence?
Any small help will be appreciated..........thanks

-rst-
Posts: 1316
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland

Re: Opengles slideshow

Wed Dec 12, 2012 11:08 am

I am definitely not an expert in OpenGL, but could it be just this simple (pseudo code, as your dev language not mentioned):

Code: Select all

main_func() {

  while more images {
    img1 = load_image()
    apply_image_to_texture1()
    img2 = load_image()
    apply_image_to_texture2()
    img2 = load_image()
    apply_image_to_texture2()

    update_display()

    sleep(x seconds)
  }

}
If you start from the hello_triangle example, could you just call the init_textures() in the beginning of the update_model() (or redraw_model()) to load the next set of images?

How does your code look like now?

Regards,

JP
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'

rexsj
Posts: 16
Joined: Tue Dec 11, 2012 8:43 am

Re: Opengles slideshow

Thu Dec 13, 2012 8:21 am

Thats exactly what i was doing........but update dint work,
it was some problem with glLoadTexture function.now its working fine.
Thanks a lot :P

rexsj
Posts: 16
Joined: Tue Dec 11, 2012 8:43 am

Re: Opengles slideshow

Thu Dec 13, 2012 9:39 am

there is some strange problem ........that the power of 2 images distort on the screen, while non of power of two images work fine with the scaling function. Pls tell me whats going wrong!!!

User avatar
PeterO
Posts: 5829
Joined: Sun Jul 22, 2012 4:14 pm

Re: Opengles slideshow

Thu Dec 13, 2012 10:31 am

rexsj wrote:there is some strange problem ........that the power of 2 images distort on the screen, while non of power of two images work fine with the scaling function. Pls tell me whats going wrong!!!
In what way are they "distorted" ?
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

rexsj
Posts: 16
Joined: Tue Dec 11, 2012 8:43 am

Re: Opengles slideshow

Thu Dec 13, 2012 12:07 pm

I have attached the image
Attachments
distorted_imgs.jpg
images distorted
distorted_imgs.jpg (21.52 KiB) Viewed 2608 times

User avatar
PeterO
Posts: 5829
Joined: Sun Jul 22, 2012 4:14 pm

Re: Opengles slideshow

Thu Dec 13, 2012 6:18 pm

The circles look circular to me so I'm not sure what you mean by "distorted".
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

rexsj
Posts: 16
Joined: Tue Dec 11, 2012 8:43 am

Re: Opengles slideshow

Fri Dec 14, 2012 5:12 am

rexsj wrote:I have attached the image

The original files attached
Attachments
agt.jpg
agt.jpg (3.88 KiB) Viewed 2554 times
Windows.jpg
Windows.jpg (14.83 KiB) Viewed 2554 times
Help.jpg
Orginal files
Help.jpg (4 KiB) Viewed 2554 times

-rst-
Posts: 1316
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland

Re: Opengles slideshow

Fri Dec 14, 2012 11:59 am

So you mean the 'backgrounds' you got in your screenshot are undesired artifacts?
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'

rexsj
Posts: 16
Joined: Tue Dec 11, 2012 8:43 am

Re: Opengles slideshow

Sat Dec 15, 2012 8:04 am

ok, so these are only background distortions. can somebody help to solve this?
i tried using freeimage_setbackgroundcolor and istransparent functions......

rexsj
Posts: 16
Joined: Tue Dec 11, 2012 8:43 am

Re: Opengles slideshow

Sat Dec 15, 2012 1:06 pm

I used the composite function and it is working fine to give the white background for images...
thanks @rst for the help :)

Return to “OpenGLES”