• Advertisement
Sign in to follow this  

Wish to use Texture Mapping

This topic is 3407 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

Hello guys... I am new to this Forum ... I am AHmed ... I am creating a game using OpenGl "glut.h" ... the game is about shooting target... and i wished to load pics in to my project. so the targets appear will be from a pic file loaded from my hard disk... can some one tell me a simple code to do this.. bec. all the codes i found are hard to understand... This is my sample code that i am using in my project. not any thing else " void main (int argc, char** argv) { srand(time(0)); glutInit(&argc,argv); glutInitWindowSize(W,H); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB); glutCreateWindow("Shooting Targets"); init(); glutDisplayFunc(display); glutMainLoop(); } //************************************************************************* // Functions Definition //************************************************************************* void init (void) { glClearColor(1.0, 1.0 , 1.0, 1.0); glColor3f(1.0, 0.0, 0.0); glPointSize(5.0); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluOrtho2D (0, W, 0, H); } //////////////////////////////////////////////////////////////////////////// void display(void) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Want to load and draw a picture in this function :)) .. glFlush(); glutSwapBuffers(); } " Thanks you all for ur time ...

Share this post


Link to post
Share on other sites
Advertisement
heey guys ...where are you ? :S

Am i asking for a something hard.. :S :S

i just want to draw a picture in to my project and can change it's position

Thanks

Share this post


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

  • Advertisement