QB: PSET (x,y,color) C++ (DOS): ???

Programming, for all ages and all languages.
Post Reply
Scarberry

QB: PSET (x,y,color) C++ (DOS): ???

Post by Scarberry »

in QBasic there is a command called "PSET". (it puts a pixel at a certain point x,y w/ a certain color) what is the equivlent in C++ Dos applacatins? and how do i use it?
thank you
Tim

Re:QB: PSET (x,y,color) C++ (DOS): ???

Post by Tim »

Depends on the compiler you're using. There's often a function called setpixel or putpixel.
Scarberry

Re:QB: PSET (x,y,color) C++ (DOS): ???

Post by Scarberry »

i use dev-c++ mostly but i also have VC++ and DJGPP but i prefer Dev-CPP.
Tim

Re:QB: PSET (x,y,color) C++ (DOS): ???

Post by Tim »

I don't know how DJGPP does graphics (SVGALib?).

If you're using DevC++ or VC++ then you're not actually writing DOS applications; you're writing 32-bit console mode Windows applications. If you want graphics on Windows you'll have to write a GUI application.
Scarberry

Re:QB: PSET (x,y,color) C++ (DOS): ???

Post by Scarberry »

yeah i knew i wasnt writing dos apps it was just easier to say dos then a "win32 app in a dos window" :P . so ill have to write a windows gui app. that sucks. will i have to use direct x or open gl or is there a pset like command in the windows gui? if so how? any tuts u could point me to?
Tim

Re:QB: PSET (x,y,color) C++ (DOS): ???

Post by Tim »

No, you can use GDI. The function there is SetPixel.

Did you look at the sample app I mentioned in this thread?
scarberry

Re:QB: PSET (x,y,color) C++ (DOS): ???

Post by scarberry »

yeah i did download it bu havnt looked at it yet. what is GDI?

thanks
Tim

Re:QB: PSET (x,y,color) C++ (DOS): ???

Post by Tim »

It's the set of Windows functions that let you draw stuff to the screen.
scarberry

Re:QB: PSET (x,y,color) C++ (DOS): ???

Post by scarberry »

o ok



thanks for all the help! :)
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:QB: PSET (x,y,color) C++ (DOS): ???

Post by Pype.Clicker »

Tim Robinson wrote: I don't know how DJGPP does graphics (SVGALib?).
there's a library that provide pretty powerful graphic support to DJGPP: allegro.
Post Reply