Archived

This topic is now archived and is closed to further replies.

Shadowflare

Really simple graphics c++ question

Recommended Posts

Shadowflare    132
I know practically nothing about graphics programming in C++, so I figured it would be best to start with just drawing pixels in a window. How do I do this? I did some research and found SetPixel, but it doesn''t seem to work...If anyone can either tell me how to do this, or to direct me to a good C++ graphics tutorial, i''d greatly appreciate it!

Share this post


Link to post
Share on other sites
capn_midnight    1707
just accept for now that you won''t be able to do any easy graphics in a DOS enviroment. Trying to draw pixels to the screen in console mode without the use of an API requires some major programming voodoo. With an API it is still difficult.
Wait until you learn Windows programming. Once you start to learn that, you''ll have a much easier, and fruitful, graphics experience.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
Or you can go to www.gametutorials.com and check out all of their tutorials. Chances are something there is going to help you out.

Share this post


Link to post
Share on other sites
RPGeezus    216
Hi Shadowflare,

The first thing you need is documentation. It helps to know that the area of Windows you''ll be working with is called the GDI. If you don''t have MSDN on CD, go to Microsofts developer webpage and look at the docs for the GDI. The URL is http://msdn.microsoft.com/

Irawing isn''t so simple at first, because Windows wants you to go through a few steps before you get going.

Essentially, you''re going to need to create:

1. A window.
2. A handle to a device context for that window (HDC).
3. A bitmap to draw to.

Generally, the way this works is that you draw to the bitmap, and then tell the window to draw the bitmap.

It sounds like you already know step 1. Step 2 is easy (HDC myDC = GetDC (myWindow)

Step 3 can be really easy, or really complicated. I wrote my own Bitmap class that is compatible with windows (I did this so i can move the code to other platforms later), thus taking the really complicated approach. In any case, I don''t know the easy method off hand. You should be able to find it on the MSDN web page (see above URL).

Hope this helps,
Will

Share this post


Link to post
Share on other sites
NexusOrganicus    122
Hi ,
I am also new to this graphic-programming thing.
First off all search for some documentation !
(Books and so on )(Andree la moth " 3d game programming" only for dos !!!!!!)get books on directx or open gl !
and so on !
It depends on what you wanna do !
if you want some source code for getting into it send me a mail
(i´ll send you that code )

Share this post


Link to post
Share on other sites