Archived

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

Game_Dude_man

Everything is so easy until it comes to the graphics...

Recommended Posts

Anyone else ever find that they can make the coolest games, with multiple characters, inventories, (and all that great interaction stuff that games have in them), but when it comes to the graphics programming your dead in the water? Maybe I just need to learn how to implement graphics in C and C++, I really have no clue. Can anyone provide me with some good resources to start with? By graphics I mean 2D to start with of course...

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
i had the same feeling some years ago. It''s a phase that you have to pass, I''m afraid. 3D Graphics programming is a skill that is not easily acquired.

For programming 2D applications you must find a way to get to the memory used as the screenbuffer. This will be an array of color values. Then you could write functions to blit images or pixels to this buffer.

But i''m not going into that matter ''cos we have APIs like Directx. It can do the above for you and much more. I agree that it takes some time to get familiar with the way to use directx, but it will pay of.

Since directx8 the preferred way to do 2D is through 3D. 2D calculation is a subset of 3d calculation, because you work on a plane in space.

My advice
-download directx SDK from microsoft site
-look on this sites for directx tutorials
-get your nose into matrices and 3D-math.

good luck on your quest.

Share this post


Link to post
Share on other sites
Thanks for that.

I know how to draw pixels on the screen like you said, but that''s about it. And sadly, that doesn''t work too well for most graphics

I guess I should start trying to learn directX eh....

darn. Too lazy

Share this post


Link to post
Share on other sites
Forget Directx; use SDL or Allegro - They give you an easy to use wrapper around directx so you don''t have to mess with all the low level details. Using either of these you can dive in and actually use graphics to help learn programming in c/c++.

Share this post


Link to post
Share on other sites
i rather make my own, and thats what ive done... it allows you to fully customise the way you want your wrapper. I find that way better, takes a while to do but its more worth it i reakon.

Share this post


Link to post
Share on other sites
quote:
Original post by Game_Dude_man
Anyone else ever find that they can make the coolest games, with multiple characters, inventories, (and all that great interaction stuff that games have in them), but when it comes to the graphics programming your dead in the water?

Maybe I just need to learn how to implement graphics in C and C++, I really have no clue.

Can anyone provide me with some good resources to start with?

By graphics I mean 2D to start with of course...




Why don''t you try Ogre or some other free engine? I''m also mostly interested into the actual game logic rather than graphics programming and I find it practical to just take some other guy''s stuff instead of frustrating myself with graphics engine programming and probably never finishing the game...

Share this post


Link to post
Share on other sites
DirectDraw is also rather easy and similar to SDL. I just find DirectDraw gives a bit more control, because its not wrapping Windows and the Window''s Procedure like SDL does.

The great thing about going 2D is you spend less time on graphics manipulation and more time on your game / engine.

Share this post


Link to post
Share on other sites
I''d like to register another vote for opengl as well, it''s really easy to do 2d graphics.

My general method is basically
use glut to create my window and register the various input handling functions (this wraps the incredibly ugly winapi functions).

use gluOrtho2D ( 0, 1000, 0, 1000); to give me a nice 2d plane to work on with a large range of points (0-1000 of course), the default is a -1,-1,1 3d plane.

use DevIL (or openIL, same thing) from sourceforge to read my graphics and then just bind then to a textured quad to render it.

Of course directx and opengl are supposed to be fairly similar in use with some stylistic differences, and we don''t really need another flame war over it.

Of course you could go old skewl and learn some incredibly old dos function to give you a pointer to video mode 13h or whatever it is, but that knowledge wouldn''t be at all practical for any other use, such as scaling to nicer graphics/modes or working with graphics accelerators.

Share this post


Link to post
Share on other sites
quote:
Original post by oliii
you think rendering is hard? try physics ;p


I really have no problem with the math. It''s just learning the API''s neccessary and what every part of it does so that I can produce what I want.

I''m just lazy, that''s all.

Share this post


Link to post
Share on other sites