How to display some graphics?

Started by
14 comments, last by Le0 21 years, 5 months ago
A nice place to begin with DX in my opinion is CDX. It''s an open source 2D class wrapper for DirectX 7. Also a good support structure for beginners.

Always remember, you''''re unique. Just like everyone else.
Always remember, you''re unique. Just like everyone else.Greven
Advertisement
Go to this link and follow the tutorials:

nehe.gamedev.net
www.gametutorials.com

Both have excellent learning tutorials for C/C++ and OpenGL =]
Hmmm I think those people recommending OpenGL / DirectX are going for overkill. An othello game doesn''t really need hardware acceleration. A simple lib would do.

For simplicity I''d recommend SDL (http://www.libsdl.org), but the Win32 GDI works great too, but for a beginner I think SDL is more intuitive.

And if it''s a DOS program, GDI isn''t an option... not sure if SDL does DOS, but allegro''s a great option, someone else mentioned it.
But I would recommend you''d ditch DOS anyway, it''s dead.
quote:Original post by justin_speers
Hmmm I think those people recommending OpenGL / DirectX are going for overkill. An othello game doesn''t really need hardware acceleration. A simple lib would do.


Who said anything about hardware accelleration... Personally i just think DX (or OpenGL...) is easier than GDI. But then again, i''ve never had good luck with GDI

For simplicity I''d recommend SDL (http://www.libsdl.org), but the Win32 GDI works great too, but for a beginner I think SDL is more intuitive.

If memory serves me correctly, SDL will use DX/OpenGL/GDI depending on what you tell it to do and what dll''s to load for it...

Always remember, you''''re unique. Just like everyone else.
Always remember, you''re unique. Just like everyone else.Greven
quote:
Who said anything about hardware accelleration... Personally i just think DX (or OpenGL...) is easier than GDI. But then again, i've never had good luck with GDI


Hmm, well I guess that's just a difference of opinion there then. For a quick little simple thing that just puts a few bitmaps on the screen I think GDI is simpler. But others may see things differently...

quote:If memory serves me correctly, SDL will use DX/OpenGL/GDI depending on what you tell it to do and what dll's to load for it...


Yeah, SDL does use GDI or DirectX, I just think it simplifies things, and as an added bonus it's cross-platform. I think the API is cleaner. And OpenGL I would think would be difficult for a beginner to pick up for a simple othello game, there's easier ways to get an image on the screen. I love OpenGL, but for a program like this, for someone who's a beginner, I think it's out of the question.

So to sum it up, everyone is entitled to their opinions, but I recommend SDL!

[edited by - justin_speers on October 24, 2002 2:40:26 PM]
Personally, I''d suggest DirectX. DirectDraw is a very easy to learn interface and allows you to do some pretty nifty stuff. But it has a couple of more advanced concepts to it.

The Win32 GDI is pretty simple if you know how to code Windows programs. If you can get a window up and running, using GetDC(HWND HandleToWindow) will get you a sort of pointer to a section of memory you can write to to draw in the window (well, loosely, that''s what it is; the hDC). You can then write pixels using SetPixel(HDC HandleToDeviceContext, int XPos, int YPos, int Color) and read using GetPixel(HDC HandleToDeviceContext, int Xpos, int YPos).

Though while SetPixel and GetPixel are really fine GDI functions, they''re slow. You probably wouldn''t want to write sprites pixel by pixel, much less backgrounds or the likes. There''s a function that allows you to directly copy graphics, BitBlt(HDC DestinationDC, int X, int Y, int Width, int Height, HDC SourceDC, int SourceWidth, int SourceHeight, int CopyMethod).

The Win32 GDI is slow, but gets the job done. You might want to have a look at it before DirectDraw.

This topic is closed to new replies.

Advertisement