HELP!

Started by
9 comments, last by PsYcHoPrOg 24 years, 3 months ago
I have been studying C++ and C on my own time now for about two years. I attended a summer camp, which teaches C++ and some other things last summer. After a while, I decided to get into DirectX, so I did. I have read several tutorials/books/articles on my own to learn DirectX. However, I CAN''T DO IT! I have made a huge attempt to memorize and learn this stuff, but I can’t find a way to do it! I find myself reading the same section over and over. I finally memorize it, but then the next day, I don’t remember squat! And I am applying the information, which I have been advised to do. If anyone would like to recommend something please respond! I am dying to make at least a small game before I am 16! I may be young, but I know, as a fourteen-year old, that I am capable of doing this. So please, if you can help me, respond.
D:
Advertisement
You do not have to memorize everything. Just learn the main ideas, and then do something to try it out. The exact spelling you can check from the Programmer''s Reference while writing the code.
I also recommend copy-pasteing bits of code directly from the tutorials and samples.
what''s the information you were advised to do? If you can''t figure DX out, you can always try other things then come back to it. You could give DOS a shot. You would just need DJGPP and Allegro as a start. Both are free.
Carl "trixter"[email=carl@trixoft.com]carl@trixoft.com[/email]http://www.trixoft.com
I know what you mean, I used to have the same problem. Learning the core commands and usage of DX is not very natural (at least it wasn't to me). When I first started, I tried to follow the books and make a simple game. That didn't work for me. I could make a simple 2D game by modifying someone's code, but I didn't REALLY know what was going on in there.

a) Don't try to make a game right away. Try making a screen that displays a bitmap. I don't mean modify the DDraw samples, I mean do it from scratch and learn exactly what is going on. It's hard to do when you have a vision of a game or something you want to make now, but it was totally necessary for me. From there, dig into the docs and figure out the best way to add a cursor to your bitmap. From there, add the ability to click on areas and jump to different bitmaps. Before you know it, you will have a menu system.

b) Start a library of generic helper functions and classes. For me it was too complicated to remember how to setup DX, or process keyboard or mouse input or even load a bitmap. So I began making classes and functions that handled these things in a generic way. Now I don't have to remember the correct DX calls and what order to call them in, I just need to know my function and exactly how IT works.

So basically, my tip to all the newbies is use the power of C++. If you don't know about inheritance or polymorphism yet, go find out about them and try to use them wherever you can, because it will make your life a whole lot easier!
It can also make your code much more readable.

Also, always remember that ANYTHING that is too complicated can be broken up into multiple simple problems.

Good Luck!

BigCarlito



Edited by - BigCarlito on 2/9/00 4:11:21 PM
Thank you for replying to my post. If anyone else would like to submit something, please do, I need all the help I can get!
D:
It''s not as important to memorize something as it to know that you can do that thing. If you know it''s doable you can look it up when you need to do just that thing.

I''ve been programming for a very long time and I still need to check the manual for simple things as printf or operator priorities once in a while. But since I have read it before and understood then, I only need to take a quick glance at the text and it comes right back to me.

Well, the posts above mentioned the main things I agree with ''em.
Try to make small programs that display some bitmaps, sprites, etc. Then try to make a small game with this stuff. Think about the design of your small game and the rest will come automatically.
I have a hard time remembering commands too. Even ones I use all the time.
What I do is make a "Cheat Sheet". I type up all the commands I'm likely to use that can fit on one sheet of paper along with it's syntax. I also group the commands by usage.
I then pin the paper on the wall next to my monitor. (or cubical wall in the case of my work.)

For instance, I use a language at work called "Mumps". The catagories I have commands under are:

Pattern Matching (Mumps specific)
Program Flow
I/O Stream
Variables
Variable Nodes (Mumps uses dynamic arrays)
Transactions
Debugging
Others (concatenation, Modulo, contains, etc.)

I had enough room at the end of the page to also include "Terminal excape codes" and "routines".
I've become so use to that sheet that now, when I can't remember the syntax of a command, I know exactly where on the paper to look.

E:cb woof!

Edited by - dog135 on 2/10/00 11:19:53 AM
E:cb woof!
I had the same problem. The key is to any API is understanding how to initialize it. In DirectX, breakup the initialization code, the enumeration code(device search), and the communications code into small pieces this helped me get a handle on DirectX. For instance, with DirectDraw you must call DirectDrawCreate(Ex)(), SetCooperativeLevel(), SetDisplayMode(), and CreateSurface() before you can begin drawing anything. Also any one of these methods can fail if you pass an invalid pointer or parameter.

Here are some tips:
Always make sure you understand what the various parameters of a function are for. This is by far more important than memorizing the functions. You can always look them up.

Whenever pointers are being passed, make sure they are valid (not equal to NULL).

Always check the return values for the DX functions in cross - dependent code before continuing. This affords you an opportunity to exit gracefully if a call fails, popup a messagebox explaining what failed, or to output a debug string. Plus such code can be easily removed during performance tuning.

Don''t ever assume a DX function returned successfully. Youd be surprised how often problems arise from this ''stupid'' mistake. Always check return values!!

Enumerate whenever writing mission critical code. I admit to not always enumerating during debugging/pre - alpha, but you must enumerate in commercial apps. If you don''t you will end up with software that only works on your personal development machine.

PS. If you want some code or some help post a reply to this message with your email address and I will get back to you. I have been contemplating writing an implementation-centric game/graphics programming book with special coverage of D3D, but until I do, you maybe should consider buying Inside DirectX. The material is dated (DX5), and doesn''t cover D3D, but I strongly advocate their approach to DX programming and the book is fairly thorough. The book also covers some key concepts of COM and most of the methods used in the book are still supported by DX7.
I had the same problem. The key is to any API is understanding how to initialize it. In DirectX, breakup the initialization code, the enumeration code(device search), and the communications code into small pieces this helped me get a handle on DirectX. For instance, with DirectDraw you must call DirectDrawCreate(Ex)(), SetCooperativeLevel(), SetDisplayMode(), and CreateSurface() before you can begin drawing anything. Also any one of these methods can fail if you pass an invalid pointer or parameter.

Here are some tips:
Always make sure you understand what the various parameters of a function are for. This is by far more important than memorizing the functions. You can always look them up.

Whenever pointers are being passed, make sure they are valid (not equal to NULL).

Always check the return values for the DX functions in cross - dependent code before continuing. This affords you an opportunity to exit gracefully if a call fails, popup a messagebox explaining what failed, or to output a debug string. Plus such code can be easily removed during performance tuning.

Don''t ever assume a DX function returned successfully. Youd be surprised how often problems arise from this ''stupid'' mistake. Always check return values!!

Enumerate whenever writing mission critical code. I admit to not always enumerating during debugging/pre - alpha, but you must enumerate in commercial apps. If you don''t you will end up with software that only works on your personal development machine.

PS. If you want some code or some help post a reply to this message with your email address and I will get back to you. I have been contemplating writing an implementation-centric game/graphics programming book with special coverage of D3D, but until I do, you maybe should consider buying Inside DirectX. The material is dated (DX5), and doesn''t cover D3D, but I strongly advocate their approach to DX programming and the book is fairly thorough. The book also covers some key concepts of COM and most of the methods used in the book are still supported by DX7.

--Sickened with the World,
Cauldron the Melancholy

This topic is closed to new replies.

Advertisement