How do you plot pixels in Visual C++?

Started by
5 comments, last by DunnBoy 24 years, 6 months ago
C++ itself (as a language) doesn't have any graphics capabilitys besides text. You'll have to figure out how to do graphics for your chosen platform. In Windows you'll either need to learn GDI (windows native graphics stuff) or DirectDraw. GDI is slow, but its also simple and more difficult to write buggy code with. DirectDraw is fast, but it's a bit tougher than GDI and it's easier to write bad code with it if your a newbie. Theres also OpenGL, but thats mainly for 3D Graphics.

Anyway, I recommend you buy Windows Game Programming for Dummies. It will help you a lot. Dont think about it, just go buy it! Now!

--TheGoop

Advertisement
Thanks
Never be afraid to try something new.
Remember, amateurs built the ark.
Professionals built the Titanic.
It's funny, I just dropped by Gamedev to ask about the same question.

I have some experience writing simple games that do sprite animation and page-flipping techniques, both on really old PCs and Apples which didn't involve seven layers of OS and drivers and such, and on PowerMacs, using a cool graphics library called SpriteWorld, but so far I've read about 2000 pages about Windows and MFC and Visual C++, and I'm beginning to think it'll take forever to write a program that does anything.

So to add to the above question, are Windows GDI classes and DirectDraw the only real options for doing basic 2D type games? Are there any publicly available libraries that simplify the coding, say for managing sprites for example? I'm eager to get into the actual game portion of the coding, and I'm getting sick of reading these things where you create a CWinCFHStruct, and pass it a handle to the parent CWndView, and then fill in the 24 members of a BOXWAD struct, thereby initializing the CGrphPnCxf object.... etc. etc. It's quite confusing.

Any thoughts?
jboyd99@hotmail.com

Hi Jayboyd,

Actually there is a really nice set of classes that wrap DirectX called CDX. They also supply tile, sprite, map, and input managing classes. It's really useful if you are trying to "get to game" part of game designing

Creating sprites is a easy as instatiating the CDXSprite class and tell it where to draw.

It's free and comes with the source so that you can defive from/modify it for your needs. They also have a ton of examples.

The site is at www.cdx.sk
Hope this helps.

-OberonZ

---
PAGE FAULT: Please insert "Swap File, Disk 2"
and press any key to continue.
i'm going to suggest Windows Game Programming For Dummies. Windows is a rich, feature-filled OS. Because of this, the learning curve is HUGE at the beginning. In reality, neither GDI nor DirectDraw are very complicated, but it is something that you have to get used to. (their use just assumes some knowledge that you probably dont have, which WGPFD goes into explaining, also WGPFD doesnt go into all of the crap that you DONT want to know)

Get off my lawn!

I'm making my first game and I need to know how to plot pixels on the screen in Visual C++. If you can help please reply to post.

------------------
Never be afraid to try something new.
Remember, amateurs built the ark.
Professionals built the Titanic.

Never be afraid to try something new.
Remember, amateurs built the ark.
Professionals built the Titanic.
Scratch that TAN. WGPFD was great, but now that Tricks of the Windows Game Programming Gurus is out, I'd suggest that instead. It covers everything in WGPFD, but goes a little further into depth, covers several additional topics and is a little more up to date.

This topic is closed to new replies.

Advertisement