One Perl/OpenGL texture

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!


I want to do a texture on a polygon but I think I am missing something
Nowhere in the code I see a connection with my polygon but the polygon
turns flickering black and green when I do enable the texture. I have
the code below now.

Any ideas?

                glVertex3f(0, 0, 1);
                glVertex3f(0, 0.5, 1);
                glVertex3f(1, 0, 1);

        # make texture
        my $img = new Imager;
        $img->open(file=>'check.png', type=>'png');    # initializes
from file
        my $texid = glGenTextures_p(1);
        glBindTexture(GL_TEXTURE_2D, $texid);
        glTexImage2D_c(GL_TEXTURE_2D, 0, 3, 32, 32, 0, GL_RGB, GL_BYTE,

$img);  # not sure its _c
        glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER,
        glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
#       glClearColor(0, 0.3, 0.6, 1);
        #end texture


Site Timeline