First entry

Published February 13, 2007
Advertisement
Well, this is my first journal entry. I have been fooling around with programming for a while, and I took a few C and C++ classes in college. I use MATLAB at work so I have some programming background (not much).

I currently work as a mechanical engineer designing homeland security barriers (big cables and chunks of concrete to stop vehicle bombs). I am also preparing to take the Patent Bar Exam to expand my career options (and my wallet). I have always made games for my own enjoyment (and my friends), so far these have been of the board, card, and PnP RPG variety. I have always been interested in video games.

This marks the start of my serious attempt at learning how to program. Everything I have done up till this point has been in a console box (or high level interpreted stuff like MATLAB). One of my first larger goals is to learn how to interact with Windows. This will give me some immediate gratification (useful to keep me going) and some understanding of how Windows works (chances are there is not much career future in DOS games).

Since I have a basic knowledge of C and C++ I will be using these languages to learn with. I will be using the Dev-C++ compiler because I am somewhat (but not very) comforatable with it. I downloaded Visual Studio Express the other day
but could not get some things I already knew how to do working on it. Also I could not seem to make it find . This is a hassle I don't need while I am starting.

I have purchased a whole bunch of game programming books over the years. I would start on one, then school would get in the way, and I would be put it aside. I have a good enough library from this (and picking things up when they didn't sell at the major retailers and hit the $10 rack) to start with. I spent last night looking through them for one that seems to have a good overview of starting out in Windows programming (getting a window to open would be nice). I selected OPENGL Game Programming by Hawkins and Astle, I liked the look of its Windows section the best. I will base (but not limit) the first part of my study on this book. I also have at my disposal a print out of the NeHe tutorials, and a book OpenGL Programming Guide 5th ed. that is available at work.

After reading through the first few sections my first attempt will be to make the Hello World pop-up box.

//Hello World in Windows#define WIN32_LEAN_AND_MEAN                 //trim down the libraries#include                         //main windows headersint WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd){    //message box with Hello World    MessageBox(NULL,"Hello World", "First",NULL);    return 0;}


As I read through the function description for WinMain I notice that lpCmdLine is a string that holds any command line parameters. Time for an experiment:

//Hello World in Windows#define WIN32_LEAN_AND_MEAN                 //trim down the libraries#include                         //main windows headersint WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd){    //message box with command line string    MessageBox(NULL,lpCmdLine, "First",NULL);    return 0;}


Good, by running my executable from the command line I can dicatate the message box contents via command line parameters. It is always nice when stuff works like you expect it to.
0 likes 5 comments

Comments

walle
Welcome to journal land [smile]
February 13, 2007 09:38 AM
benryves
Welcome to the journals!

VC++EE doesn't come with everything you need for native Win32 apps, only for C++/CLI apps. You will need to download and install the Windows Platform SDK (as mentioned on the VC++EE download page). There are a number of sites, such as this one, with guides on configuring the PSDK and VC++EE to work together.

Dev-C++ is only an IDE, I believe the compiler is MinGW. I always found VS much more fun to work with. [smile]
February 13, 2007 09:51 AM
rmckee78
Quote:Original post by benryves
Welcome to the journals!

VC++EE doesn't come with everything you need for native Win32 apps, only for C++/CLI apps. You will need to download and install the Windows Platform SDK (as mentioned on the VC++EE download page). There are a number of sites, such as this one, with guides on configuring the PSDK and VC++EE to work together.

Dev-C++ is only an IDE, I believe the compiler is MinGW. I always found VS much more fun to work with. [smile]


Ah, I downloaded the SDK but didn't realise I had to set it up. I'll have to take a look at this later.

I was unaware that Dev-C++ was not itself the compiler. I suppose this means that I need to look up the compiler name itself if I am having problems?
February 13, 2007 10:05 AM
Tesseract
Welcome to the journals. Now get back to work!
February 13, 2007 10:28 AM
benryves
Quote:Original post by rmckee78
I was unaware that Dev-C++ was not itself the compiler. I suppose this means that I need to look up the compiler name itself if I am having problems?
After looking it up, it does appear to be MinGW. Code::Blocks is another freeware IDE geared towards C/C++ development, which can also use MinGW (I think it's a little more up-to-date than Dev-Cpp).

At the end of the day, just use what's the most comfortable to you. I just thought I'd mention the PSDK, as it seems to be a common complaint about VC++EE.
February 13, 2007 10:39 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement