Solved

now what?? naive question

Posted on 2000-04-04
3
229 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

747 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now