Solved

now what?? naive question

Posted on 2000-04-04
3
232 Views
Last Modified: 2012-05-04
I think I am being rather naive here.. I hope though that I will still get an answer...
 I have been reading C and C++ and I am in position to say that I know some things.. I finished one of my textbooks yesterday and they sth very simple occured to me..
 How could I possibly colour a single pixel on my screen??
 I don't thing my textbooks would cover sth like this... I am sure that there must be some library that will provide me with the functions to do graphics... how would this function be implemented though? Is there some kind of low level C that is not in my textbook or would such a function have to turn to assembly??

 I thank you in advance you all fine people :)

 Nick
0
Comment
Question by:anemos
  • 2
3 Comments
 
LVL 32

Accepted Solution

by:
jhance earned 50 total points
ID: 2684558
The answer depends on what system you are programming for.

Under MS Windows you have the SetPixel() function.  It, amazingly, sets the color of a pixel on the screen.

Under MSDOS you have access to the screen buffer itself but it's more complicated since you have to get the display hardware into a graphics mode.  Often the programming environment you are using has some sort of graphics lib.

Unix/Linux systems generally use X.  I'm not that familiar with X programming but I suspect that there is a capability similar to the Windows SetPixel function.
0
 
LVL 32

Expert Comment

by:jhance
ID: 2684562
One other thing.  There is NOTHING in either C or C++ language itself that deals specifically with graphics.

That doesn't mean it can't be done, it  just that there must be some extra library that provides the capabilities you are asking for.
0
 

Author Comment

by:anemos
ID: 2685255
I am sorry for not making myself clear..
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question