Jump to content

  • Log In with Google      Sign In   
  • Create Account

14 years ago on June 15th Gamedev.net was first launched! We want to thank all of you for being part of our community and hope the best years are ahead of us. Happy birthday Gamedev.net!

lehthanis

Member Since 05 Nov 2010
Offline Last Active May 28 2013 09:47 AM
-----

Topics I've Started

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

10 April 2013 - 10:55 AM

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);
    glBegin( GL_QUADS );
        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);
    glBegin( GL_QUADS );
        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);
    glBegin( GL_QUADS );
        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.

Ionware Tetris Tutorial questions/problems

04 June 2012 - 12:48 PM

Hi all,

I've been going through IonWare's Tetris tutorial over at http://openglgui.sou.../tutorials.html and I'm having some oddities.

First of all, the screen is VERY flickery when the game is running with the provided source code. It seems to respond to my move commands quite well, but the animations seem to be goign super slow, and eliminating full lines seems to be slow also.

I'm also having trouble with loading blocks. It only seems to want to give me the square block...so I can't tell if block rotation is working or anything.

I ended up commenting out all the includes for glaux.h and the sample code compiled with minimal changes (I had to add the int declaration in front of several i=0 statements in the parentheses portions of for loops). Does anyone know how to contact the author of those tutorials and whether or not he intends to finish the series?

PARTNERS