Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

duhroach

Copying one image to another...

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

Hey all. Was wondering if anyone knew a process to copy one image to another. I''m copying the data from a scene directly into a image in opengl, and I want to be able to copy that same image to another texture. Wow, i understand that''s vauge. Here''s some code.
  
	//Draw our one pass scene

	drawScene(1);

	glBindTexture(GL_TEXTURE_2D,shadowID);
	
	glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, hwBorderColor);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);

	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER_ARB);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER_ARB);
  
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_SGIX, GL_TRUE);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_OPERATOR_SGIX, GL_TEXTURE_LEQUAL_R_SGIX);
	glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT16_SGIX, 0, 0, size, size, 0);

//Would like to copy the depth image to another texture here

  
Any ideas? ~Main == Colt "MainRoach" McAnlis Programmer www.badheat.com/sinewave

Share this post


Link to post
Share on other sites
Advertisement
Never done it.. I know glDrawPixels can draw it on the screen with raster but for a texture..

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!