Followers 0

# Need a quick and dirty png loader with libpng...help?!?

## 1 post in this topic

Hi all, sorry for the super noob post...I'm just getting started but I have a very short turnaround time needed for this for my boss.
I'm modifying something in X-Plane, and drawing a really large set of quads that cover the sky...it works....here's the code:
    glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
glVertex3f( xt+150000.0f, yt, zt-150000.0f );
glVertex3f( xt+150000.0f, yt, zt+150000.0f );
glVertex3f( xt-150000.0f, yt, zt+150000.0f );
glVertex3f( xt-150000.0f, yt, zt-150000.0f );
glEnd();
glColor4f(0.8f, 0.8f, 0.8f, 0.5f);
glVertex3f( xt+150000.0f, yt+1, zt-150000.0f );
glVertex3f( xt+150000.0f, yt+1, zt+150000.0f );
glVertex3f( xt-150000.0f, yt+1, zt+150000.0f );
glVertex3f( xt-150000.0f, yt+1, zt-150000.0f );
glEnd();
glColor4f(0.5f, 0.5f, 0.5f, 0.2f);
glVertex3f( xt+150000.0f, yt+2, zt-150000.0f );
glVertex3f( xt+150000.0f, yt+2, zt+150000.0f );
glVertex3f( xt-150000.0f, yt+2, zt+150000.0f );
glVertex3f( xt-150000.0f, yt+2, zt-150000.0f );
glEnd();

I know, it's the old glBegin method, but that's how the code I have is written for X-Plane...
Anyways...I need to apply a texture to those 3 quads. And I need it to be a png texture.
I've downloaded and compiled libpng, and linked it to my project, but I need a quick and dirty way to load a png file and apply it to the quads.
Is there an easy way to do this without using any additional libraries? Or perhaps a simple header file I could drop in that someone has layign around?
Sorry again for the frantic-ness...once I get a quick and dirty png loader, I'll definitely be able to spend some time learning more about libpng, but for now, I need a quick fix.
Thanks so much to anyone that can help.
0

## Create an account

Register a new account