Jump to content
  • Advertisement
Sign in to follow this  
RyanA

OpenGL OpenGL Powered Retro Display

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

Howdy, I had a quick question on some advice. I'd like to code up a little demo similar to those realtime worms / liero games in OpenGL. I've been weighing the options. Basically I need a 320 x 200 screen stretched over a specified area. Two things I've thought about doing: 1) Have a 320x200 array simulating the display, every frame go through render a GL_QUAD for each 'pixel'. 2) Store the bitmap data in memory, recreate a texture every frame to stretch over one GL_QUAD centered in the screen. Which seems better of the two, speed-wise? I know both are less than ideal, but I would like to do this in OpenGL without shaders. Also, if you have any other ideas i'd appreciate them! Thanks for your time! Ryan

Share this post


Link to post
Share on other sites
Advertisement
Draw one single textured Quad. just set it to GL_POINTS in the sampling (or was it GL_NEAREST?). works great, I have used that quite some time for my raytracing code.

and, if you want, you can easily add shaders and process your image in funky ways :)

Share this post


Link to post
Share on other sites
I agree, go for option 2.

Just to make it clear: With "recreate" you mean "update" the texture not create a new texture object, right? (Creating an entirely new texture every time would be quite inefficient ;)

You might thing about glTexSubImage2D() for just updating the portions that have changed.

Share this post


Link to post
Share on other sites
Alright, so it seems the consensus is #2 is the way to go, thanks :).

Quote:

Just to make it clear: With "recreate" you mean "update" the texture not create a new texture object, right? (Creating an entirely new texture every time would be quite inefficient ;)


I never knew you could update the texture, I thought you had to call glTexImage2D and pass in the pixels again. Is there another way I am not realizing?

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!