Jump to content
  • Advertisement
Sign in to follow this  
EricmBrown

OpenGL Drawing Part of a Bitmap Image

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

Is there a way to draw a part of an image using glDrawPixels()? Or any other method in OpenGL. Google searches havent shown much, I was hoping maybe someone here could help me out :). Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
You may try these two methods:
  1. Set the appropriate texture coordinates when drawing.
  2. Render to a new texture using glTexSubImage2D () then draw the object using that new texture, this method is generally not as elegant as the #1, but suitable for adding effects.

Share this post


Link to post
Share on other sites
Just to specify, i'm using orthographic mode and am drawing directly to the screen using glDrawPixels(), i'm not putting the bitmap onto a 3d object with texture mapping.

Share this post


Link to post
Share on other sites
Is there any reason you want to manually draw them that way ?.
Also note that glTexSubImage2D () returns a pointer to the internal texture data, you can read individual pixels then draw them to the screen at will.

Share this post


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

  • 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!