   C/C++ help
  Im a java programmer trying to learn c/c++ and directx.  I got a book (Programming Role Playing Games With DirectX) and it seems to be pretty good but i dont seem to be quite good enough to utilize it.  Id appreciate it if anyone could answer these questions.1)The first topic in the book is threading, a concept im familar with but the function to create the thread "HANDLE CreateThread(...)" returns a HANDLE.Whats a HANDLE?2)Another problem is the prototype for a thread function DWORD WINAPI ThreadProc(LPVOID lpParameter)I seem to not understand any of the all caps words? (DWORD,WINAPI, and LPVOID)Im sorry if this is the wrong place to post i just joined this site and help would be appreciatedAlso im new to c\c++ and directx and i would like to know are they good for game development, im not that great of a programmer and if their is an easier language or api could you let me know   
  The answer to the all caps words (DWORD, WINAPI, LPVOID, and HANDLE) is that the windows api is strange. This is my personal opinion but it is shared by many. It likes to make types (things like DWORD) and other keywords (like WINAPI) all caps and use obscure polish notation names.Many of them are easy to figure out, given the context:HANDLE is just that, a handle or accessor to some other object, in this case a thread (a system process that can fake your CPU into doing 2 things at once)DWORD or a Double WORD, as opposed to WORD, or BYTE. A BYTE represents a single byte in memory, a WORD is from the old 16-bit memory size or 2 bytes, and a DWORD is 2 words or 4 bytes.For more information (I'm not totally knowledgable) look them up in google.I hate these names, which is why I never program under the normal windows api. I'm sorry you have to, but good luck anyway!   ;  What do you use then?Im starting to not like the all caps words either   ;  See  this page for a description of Windows types. They're all typedef'ed to integral types, so you don't have to ugly-up your code with them if you don't want to.There are alternative APIs for developing games, such as SDL. There is also Managed DirectX if you feel like learning a new language. You'll have to find a different book if you want to use either of the two.Quote:Also im new to c\c++ and directx and i would like to know are they good for game development, im not that great of a programmer and if their is an easier language or api could you let me knowSun has been putting some effort into making Java a better option for game development. Check out Tribal Trouble. This article provides a summary of what's available and links to JOAL and JOGL.   ;First off, the reason all these are defined as they are (DWORD, HANDLE, etc..) is that the Windows API needs to address several platforms and in order to do so type information needs to be extensible.  For example, if you are building on a multibyte system, some of you types (mostly the char types) will need to be different.  If its unicode, it may or may not be different.  If you are building for 16 bit platforms (god forbid that people build software for windows 3.1 - but the api is dated back to those times...) many of the types end up being different.  Also, NT at one point supported some IBM/Motorola platforms which obviously have different takes on endian-ness..  therefore the headers need to be extensible.This helps you too, since you wouldn't want to change all this if you decided to extend your code to support other architectures (SSE2/AMD/64bit/etc..).  In your world of java, this was all handled for you by the framework - basically java abstracted all these ugly details and thus the multi-platform support intrinsic to the language.What may be more comfortable for you would be C# which imho takes the best things from C++ and java.  DirectX is supported there and many people are writing some impressive software with it.  I think its a little ways away from being mainstream - but its a great language now that 2.0 released.As far as what some of these specific things are:WINAPIIt is defined in windef.h, and if _MSC_VER >=800 (the compiler type) or _STDCALL_SUPORTED it is defined as __stdcall.  Otherwise it is undefined (and therefore will mean nothing).  __stdcall is a calling convention (something else you didn't have to deal with in java) that defines whose responsibility it is to clean up the stack after a function call.DWORDAlso in windef.h and most likely an unsigned longHANDLEThis is sort of difficult to explain, so its better to just hit the "I Believe" button for now and move on.  A handle is defined as:if STRICT:typedef void* HANDLE;#define DECLARE_HANDLE(name) struct name##__ {int unused;} typedef struct name##__ *nameotherwise:typdef PVOID HANDLE;#define DECLARE_HANDLE(name) typedef HANDLE name#endifSo, what this comes down to (because THIS is what I would define as weird... but cool) is a HANDLE is a (void *).  Any routines and declare a handle, will define it like this at compile time:DECLARE_HANDLE   foobar;Which will result in:struct foobar__{ int unused;};typedef struct foobar__* foobarWhy all the hoops?  When I first looked at all this I thought someone was out of their mind.  What it does though is make the misuse of handles a compile-time error since it actually is a type now.  (The ## operator is a preprocessor directive called the Token-Pasting Operator).It does take a little getting used to, but resist the urge to be yet another fickle programmer.  They are just labels, and not that big of a deal.  In fact, since they are all caps they are easy to identify and the system is consistent.  If you build a 500,000 line piece of software for multiple platforms you will end up doing the same exact thing (albeit you may select a different scheme, but the idea is the same).  If you are using Visual Studio (Express 2005 is free - for now - and I would recommend pulling it down) you can R-Click on the type in question and select definition.. it will take you right to where it is defined.Hope that helps#dth-0