Skip to main content
gamedev.net
🔒 Locked

plotting pixels

Started by malroid Jul 28, 2006 at 10:09 PM 4 replies 600+ views
Original Post
malroid
malroid
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.
Ravyne
Ravyne
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.
throw table_exception("(? ???)? ? ???");
malroid
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.

malroid
malroid
btw
thank you for your quick response, Ravyne.
wyrzy
wyrzy
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 )
Ravyne
Ravyne
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.
throw table_exception("(? ???)? ? ???");

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.