Jump to content
  • Advertisement
Sign in to follow this  
babayaga

OpenGL going from oldskool mcga code to opengl

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

Hi! Im pretty new with Opengl. I've setup sdl+opengl and made a fairly easy 3d engine. But my main problem is, what's the best method of displaying 2d arrays, e.g i've generated a 2d tunnel table circ and plane, they are both int circtab[800*600*24]; etc How do I do this, since there are no pointer directly to the screen anymore. I Guess it is to draw this to a texture, but om not fairly sure how todo that either. I've not done any graphical programming since 1998 and would be very pleased if someone could highlight this issue for me. I guess what im asking is, how is the best method and how todo a regular Putpixel() without too much trouble :) thanks baba.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by babayaga
I guess what im asking is, how is the best method and how todo a regular Putpixel() without too much trouble :)

Essentially, you don't do that anymore. The days of per-pixel manipulation on the CPU are pretty much over :)

On todays hardware, the usual way to manipulate image data per-pixel is through a fragment shader. You can still simulate a putpixel, but all available methods are orders of magnitude slower than what you'd achieve through the massively parallel processing structure of the GPU. Graphics programming has changed a lot since the 90's. You should really avoid writing pixel data directly, unless you're streaming video or something along that line.

But if you really want to keep your putpixel, then the best way to simulate it is by writing to a texture, as you said.

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!