Jump to content
  • Advertisement
Sign in to follow this  
malroid

OpenGL plotting pixels

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

i want to do some 2d graphics programming, and it seems like i wont be needing to get my hands dirty with win32api code if i use a combination of glut and opengl. my problem is that i cannot find the right way to set up a 2d environment, and find an easy efficent way to plot pixels on the screen using xy coordinates. i would really appreciate it if you guys could help me out with that.

Share this post


Link to post
Share on other sites
Advertisement
OpenGL is probably overkill for what you want to do. All you really need is a window, a bitmap, and a call to put the bitmap onto said window. I'd look at HBITMAP and BitBlit to get you started with the Win32 API. You can get pretty good performance out of it too.

Share this post


Link to post
Share on other sites
that is true i can.
but for this specific task i am working on, i am going to need something simple, and efficent that will not take long lines of coding.
so far glut looks most promising.
i really need to plot a few pixels on the screen, i would do it with the good ole mode 0x13, but visual studio is somewhat problematic when it comes to that.

Share this post


Link to post
Share on other sites
Quote:
Original post by malroid
my problem is that i cannot find the right way to set up a 2d environment

Try searching gluOrtho on the forums (or something like:
site:gamedev.net gluOrtho 2D OpenGL )

Share this post


Link to post
Share on other sites
Quote:
Original post by malroid
that is true i can.
but for this specific task i am working on, i am going to need something simple, and efficent that will not take long lines of coding.
so far glut looks most promising.
i really need to plot a few pixels on the screen, i would do it with the good ole mode 0x13, but visual studio is somewhat problematic when it comes to that.


For what its worth, I did exactly the process I described for use in my computer graphics class and its no more complicated than setting up something like Glut, theres maybe 100-150 lines of code to handle the window, getting the bitmap to draw to, flipping the screen, Menus and basic windows message handling. With all that in place, its actually exactly like Mode 0x13, with the exception that I've used a 32bit color depth (because I wanted true color, and because Windows does some funky stuff and doesn't leave you a full 8bit palete to work with) Heck, I could even give you basic framework for it :) The actual drawing portion of my code impliments just about every shape of primitive you can imagine as well as various bitmap blitters and textured triangles so its easy to work with as well.

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!