• 13
• 18
• 19
• 27
• 9

Am I just retarded or what?

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

Recommended Posts

How did you guys learn directX?

While trying to learn directX, I'm coming upon a massive wall of frustration. All the learning resources seem to be incredibly convoluted and over-explained. The code samples go on and on with error checking (I have no idea yet what returns what so that's pointless).

Seriously, why do people put error checking in code meant to teach someone the basics? The student can look through the DX docs and implement their own error checking. Who agrees?

I'm in the process of making my own documentation that simply lays out the structures needed to do certain tasks (and a brief explanation) and leaves the rest to the user. That seems like the best thing....

Share on other sites
You are not retarded, I've found the learning resources available for DirectX to be rather poor. :(

Even the only book I could find (the Luna book) was written quite poorly. Oh well, just have to muddle on...

Share on other sites
Error checking is the basics. I'd argue its vital for a beginner, who will almost certainly mess something up when they try to fit the code into their own program, and if there is no error checking they'll be left scratching their head wondering why it isn't working (at best).

The other thing to be aware of is that most of these "learning sources" are written by people who were in the learning process while writing them! These tutorials are poor because at the time of writing the author's understanding is often poor.

Share on other sites
Error checking is in many DX examples because:

1) almost all the examples where copied from a source that had them.
2) (devil's advocate) error checking is good, so a good example should use good coding practices.
3) DX's error checking mechanism is a little odd, especially to those who aren't used to that model (an inceasing portion of programmers)

but most importantly:

4) There's a lot that can go wrong setting up a context. The error checking provides you info about where things went wrong, how they went wrong so you can fix them. Otherwise you'll usually just get a black screen with no idea why it's not doing what you think it should.

Share on other sites
Quote:
 Original post by Fl4shHow did you guys learn directX?
A lot of trial and error, wasted time by jumping in at the deep end, and tinkering around with examples a lot.

Quote:
 Original post by Fl4shSeriously, why do people put error checking in code meant to teach someone the basics? The student can look through the DX docs and implement their own error checking. Who agrees?
I strongly disagree. Mainly because if you copy an example and it has no error checking in it, and it doesn't work, you'll get a crash in your code and not know why. Or, worse, if you modify the code slightly and then it crashes and you don't know why.
If you know that error checking should be there, then it's fine - but most new users don't know that a particular function needs checked for errors. "What, you mean that if CreateDevice fails and I don't notice then it crashes? I thought it'd just not render anything" and similar reasoning.

Personally, I believe it's better to have a tutorial / example with source code linked, and include stubs for the error handling in the text itself, and put the "real" error handling (cleanup and displaying the error) in the source cod. That way, someone looks at the code and sees:
hResult = m_pD3D->CreateDevice(blah, foo, etc);if(FAILED(hResult)){   // Error handling}
which isn't messy at all, and highlights that there needs to be error handling there. When they download the source code, they can see the full error handling code, and they can copy & paste as much as they want, and still keep the error handling code intact.

Share on other sites
I learned DirectX by giving up and switching to OpenGL. Which in those days, thanks to nehe I was up and running making 3d apps in under a week.

Share on other sites
Look for the sample where they create a window and render a blank screen. Then work on rendering just a triangle and take it from there. Also make sure you don't use the sample that uses the crappy helper library or you won't be able to figure out what's going on.

Share on other sites
Quote:
 Original post by Fl4shSeriously, why do people put error checking in code meant to teach someone the basics?

Because error checking is important.

We're talking about the basics of DirectX here. You need to know a fair amount about programming in general first. Learn "the basics" of making a program work before trying to get 3D graphics working.

Share on other sites
I've noticed people in this forum are quite condescending. They always assume that the person asking the questions is a dunderhead. So please can you guys stop being elitists for once, I know you guys are good at coding and stuff but that doesn't give you the rights to be ***hats. This guy mentioned a general problem and everyone just seems to be demeaning his programming skills.

@OP: I agree with you man, I am still looking for that elusive DirectX book. I actually just gave up and started reading msdn documentation on DirectX. That actually seems to be more helpful than any book I've read on DirectX. I've also extensively searched the web for DirectX tutorials and after dabbling in it by myself for quite some time I now understand the basics. After you have learn the basics, then and only then can you pick up a DirectX book.

Share on other sites
Quote:
 Original post by falconandeagleI've noticed people in this forum are quite condescending. They always assume that the person asking the questions is a dunderhead. So please can you guys stop being elitists for once, I know you guys are good at coding and stuff but that doesn't give you the rights to be ***hats. This guy mentioned a general problem and everyone just seems to be demeaning his programming skills.@OP: I agree with you man, I am still looking for that elusive DirectX book. I actually just gave up and started reading msdn documentation on DirectX. That actually seems to be more helpful than any book I've read on DirectX. I've also extensively searched the web for DirectX tutorials and after dabbling in it by myself for quite some time I now understand the basics. After you have learn the basics, then and only then can you pick up a DirectX book.

What do you expect us to say? Yup, learning DirectX sucks. It's hard. I spent tons of time on the net looking for stuff. That sucked.

And the part about error checking IS important.

I don't see elitism here. I see noobism/laziness/ignorance/helplessness but that's okay I guess...