Jump to content
  • Advertisement
Sign in to follow this  
Splinter of Chaos

[c++] Where do you start with graphics?

This topic is 3974 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi. I have simple goals. I want to make a dot move around the screen that is controlled by the player. Than I want to spawn other dots to move around the screen. Then I want to have them orbit the player. Then I want to define what happens when a dot hits the player. But my problem is this: I don't understand all this directX, openGL, and whatever crap. Google didn't find me an "I'll explain all" site, nor even a "Well I use ____ AND why." What's worse is I tried navigating the Microsoft website to get directX. If you've ever tried to navigate this website, maybe you'll agree that its ease of use is deceptive (and the layout is so goddamn cluttered!). I've finally learned about pointers, classes, arrays, and everything I believe to be background information, and I can't figure out how to get even a black screen! PS: If possible, I'd actually like to build my own graphics library (purely academic reasons) so please put that into consideration in your response. Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
Well there is this start here guide on gamdev.net^^

DirectX and OpenGL are just two different ways to talk to the graphics card. Choose the one with the better sounding name and buy a beginners book for it.
I think books are better for beginners than learning with online tutorials.
Oh, and you should learn 3D mathematics at some point.

Browse the books section of gamedev.net for tips.

Share this post


Link to post
Share on other sites
what you want to do sounds like it could be done in 2d I would look in to SDL if I were you. They have links to tutorials on how to use sdl on its website.

Share this post


Link to post
Share on other sites
Quote:
Original post by stonemetal
what you want to do sounds like it could be done in 2d I would look in to SDL if I were you. They have links to tutorials on how to use sdl on its website.

I second SDL!

Share this post


Link to post
Share on other sites
slowmike:
Not unhelpful, but I always forget to mention I'm a zero budget programmer.

tsukinokaze:
Also not unhelpful, but the gamedev articles are the first places I looked.
However, I'm glad to know that there's no real difference between OpenGL and DirectX, but part of my problem was getting them.

stonemetal:
Finally, something to google! Well, I did that and even followed a tutorial on how to put every file in its place and even made a program in it that says hello world with the help of that tutorial. Unfortunately I got more "[Linker error] undefined reference to `whatever' " errors than I've ever heard existed. But still, SDL looks pretty cool and is an alternative to Microsoft and whoever owns OpenGL.

Corrob:
That settles it. I'll get this to work and run with it!

PS: What would cause the linker errors? Might have solved the problem by the time you answer, but just in case I don't...

Thanks for the responses.

EDIT:
For the pure joy of it, Dev c++ gives me the error " [Linker error] undefined reference to `SDL_RWFromFile' ", but that's not even in the file! I've double, triple checked the files. What the hell could be happening?

[Edited by - Splinter of Chaos on December 1, 2007 7:29:48 PM]

Share this post


Link to post
Share on other sites
Drop Dev-C++, it hasn't been touched in years. Grab Code::Blocks or Visual C++ Express 2008.

As for SDL being an "alternative" to DX and OGL, that's not entirely true. SDL is entirely 2D and doesn't use graphics hardware. It's great if all you need is simple 2D graphics, but if you push it too much you'll start losing frames quickly.

In spite of this, I think SDL is a great way to start. Just getting some images onto a screen and moving around for the first time is a thrill.

Share this post


Link to post
Share on other sites
So in other words, if I'm going to do something that with punish CPUs (and I know the idea I mentioned at the top will because I've already made a version that does), I shouldn't use SDL?

Is there any way to adapt SDL to graphics hardware? An extra library? Something?


Yeah, getting something on the screen will be a thrill to me, but if it's a sooner or later thing, I'd rather learn... I guess OpenGL sooner than later.

EDIT:
I cannot believe how difficult it is to start in OpenGL, or any graphics thing, really. Tutorials expect to give me page long programs and learn what everything means in one sitting. I can't believe there's no such thing as a makeScreen(int width, int height) function.

[Edited by - Splinter of Chaos on December 2, 2007 1:20:55 AM]

Share this post


Link to post
Share on other sites
SDL is not slow at all!

It has been used in commercial games for their gnu/linux ports, and could just as well be used for the windows versions, if it weren't for political reasons.

It uses hardware acceleration for 2D graphics, and when you are ready to move to 3D, then it has built-in support for OpenGL. (You continue using the SDL functions for keyboard input, and sound etc, while using opengl functions for graphics)

SDL is highly recommended.

Another alternative is Allegro http://www.allegro.cc which is a little bit easier to get started with, since it has functions for drawing lines, drawing text, playing music, while SDL is very barebones, only allowing you to plot pixels and blit surfaces, and play raw sound PCM data

However, there are many addons for SDL that take care of these things, and also, it may be a good learning experience to write your own line drawing function :)

Good luck!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!