Advertisement

Some adive on creating a window class

Started by April 25, 2001 01:48 AM
0 comments, last by Livecoma 23 years, 9 months ago
I was thinking of how to go about writing a function to handdle creating my window class. Since every game has pretty much the same window class settings I would only need to pass a couple argumeants to it for my purposes, and leave the unneeded parameters hardcoded inside the function. My goal Is to reuse these functions in all my game experimeants, but are there any potential pitfalls? Now my question is would it be a good idea to handle registering the class, and window creation in this function, or is it best to do this manually? Well, here is a basic Idea of what I''m proposing... WinMain(blah, blah) { CreateWinClass(blah, blah, blah) // create and register winclass CreateWindow(blah, blah, blah) // create and show window // rest of the game code. (input, render, etc.. etc..) .... } OR WinMain(blah, blah) { // Create windows class, register, create window, and // show window. CreateShowWindow(blah, blah, blah, blah) // rest of the game code. (input, render, etc.. etc..) } Is this a good idea? Thank you for any advice, but please don''t point me to any code that already does this because I would like to do this myself.
Theres a pretty good tutorial about the subject at www.relisoft.com - they have some nice ideas, like operator overloading and such...
also they solve the problem of the WindowProcedure...

It is worth reading

And the advice you asked for...
Consider a base class. Think about the stuff required for the CTOR ...
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~I'm looking for work

This topic is closed to new replies.

Advertisement