These tutorials focus mainly on OpenGL, Win32 programming and the ODE physics engine. OpenGL has moved on to great heights and I don't cover the newest features but cover all of the basic concepts you will need with working example programs.
Working with the Win32 API is a great way to get to the heart of Windows and is just as relevant today as ever before. Whereas ODE has been marginalized as hardware accelerated physics becomes more common.
Games and graphics utilities can be made quickly and easily using game engines like Unity so this and Linux development in general will be the focus of my next tutorials.
Object Orientated Win32 Template
By Alan Baylis 24/12/2003
Download the Demo with Source Code
Before rewriting my OpenGL demos I decided to write a new Win32 template that uses an object orientated approach to the window creation. The program is still under development but should give you an idea of how it will work; and also give you the opportunity to have your say/input. There are a few different ways to wrap a window in an object but the one I chose to use was conceived by Bradley Manske and he describes the process well so I wont go into the details of patching the WndProc callback. For now I will just whet your appetite with a look at the new and improved WinMain function and I will write a full tutorial later when the template is finished.
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { MSG Msg; cWindow* MainWindow = new cWindow(hInstance, "MainWinClass", SW_SHOW); MainWindow->AddButton(SW_SHOW); MainWindow->AddButton(0, 40, 100, 40, SW_SHOW); MainWindow->AddDialog("DialogClass1", 300, 300, 200, 120, SW_SHOW); MainWindow->Dialogs[0]->AddButton(SW_SHOW); MainWindow->Dialogs[0]->AddDialog("DialogClass2", 400, 400, 200, 120, SW_SHOW); MainWindow->Dialogs[0]->Dialogs[0]->AddButton(SW_SHOW); SetDlgItemText(MainWindow->hWnd, MainWindow->Buttons[0]->idControl, "G'day"); SetDlgItemText(MainWindow->hWnd, MainWindow->Buttons[1]->idControl, "Hello"); SetDlgItemText(MainWindow->Dialogs[0]->hWnd, MainWindow->Dialogs[0]->Buttons[0]->idControl, "Hi"); SetDlgItemText(MainWindow->Dialogs[0]->Dialogs[0]->hWnd, MainWindow->Dialogs[0]->Dialogs[0]->Buttons[0]->idControl, "Aloha"); while(GetMessage(&Msg, NULL, 0, 0)) { TranslateMessage(&Msg); DispatchMessage(&Msg); if (key[VK_ESCAPE]) SendMessage(MainWindow->hWnd, WM_CLOSE, 0, 0); } return Msg.wParam; }
As you can see, it is a lot cleaner and convenient to wrap the windows, dialogs and controls in objects. The final program will modify the default settings of the windows through accessor functions and include enumerated constants to reference the controls and dialogs but this should give you the idea.