Jump to content
  • Advertisement
Sign in to follow this  
aeltani

SOIL, putting texture on rectangle

This topic is 3442 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I want to insert an image on a rectangular quad using SOIL. It's my first time using SOIL and I have no clue how to use it. That's my code. //---------------------------------------------------------------------- GLuint tex_2d = SOIL_load_OGL_texture ( "img.png", SOIL_LOAD_AUTO, SOIL_CREATE_NEW_ID, SOIL_FLAG_MIPMAPS | SOIL_FLAG_INVERT_Y | SOIL_FLAG_NTSC_SAFE_RGB | SOIL_FLAG_COMPRESS_TO_DXT ); /* check for an error during the load process */ if( 0 == tex_2d ) { printf( "SOIL loading error: '%s'\n", SOIL_last_result() ); } glBegin(GL_POLYGON); glVertex2f(50,50); glVertex2f(50,200); glVertex2f(200,200); glVertex2f(200,50); glEnd(); //----------------------------------------------------------------------- It loads an image into an array. Then I draw a rectangle using GL_QUADS. But how do i put the image on the quad? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!