Jump to content
  • Advertisement
Sign in to follow this  
besh81

OpenGL - AllegroGL DirectX

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

Can OpenGL or AllegroGL or DirectX render a memory bitmap (eg. Allegro's BITMAP) instead of screen???

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
yes, they can, I'm a noob, and even I knew that...

Share this post


Link to post
Share on other sites
Are you looking to output it to a file, or just store it in memory for later use? In OpenGL you can render to a texture, and I believe you only have to bind your texture and use the glCopyTexImag2D function:

glBindTexture(GL_TEXTURE_2D,BlurTexture);			
glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, 0, 0, 128, 128, 0);


The above is taken from this tutorial, which explains it in greater detail.

Is this what you want?

Share this post


Link to post
Share on other sites
OpenGL can render to non-visible surfaces in the following ways:

1. Using back buffers or aux buffers of a visible surface - This is the simplest method - you just render what you want rendered on the texture to the back buffer, copy it to a texture (I assume this is what you want it for), then clear the back buffer and render what you actually wanted to render, before calling swapbuffers.

2. Using the pbuffer extension - which is rather complicated to use and highly platform dependent (well, actually it is two extensions, one for X and one for Windows)
3. Using the easier, more portable, but less widely supported EXT_framebuffer_object extension. This is available on newer cards / drivers, and is more straightforward than the pbuffer approach but still allows you to render totally offscreen.

---

None of these methods renders in to CPU-accessible memory. If you wanted to get the image into CPU memory, you'd need a slow glReadPixels.

Mark

Share this post


Link to post
Share on other sites
Thanks to everybody,
I have used the method explain int NeHe Lesson 36!

There's a glReadPixel similar func in directx??


[Edited by - besh81 on November 12, 2005 4:19:31 AM]

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!