Page 1 of 1

Window Creation

Posted: Mon Aug 22, 2011 11:59 pm
by strychnine213
Howdy all. I wasn't quite sure were to post (I'm not even sure this is the right forum, though it's definitely the smartest place to ask :lol: ) so by default it goes here!

OK, so a friend of mine asked me to help him out with this project he has to do for his programming class at school. For the project he has to create a little Tetris clone using DirectX. I have been asked to program the renderer for the game (nothing fancy, just putting 2D to a screen; how hard could that be?). I have a few questions I was hoping someone could answer before I start: First off, which should be responsible for the creation of the window, the application, or the renderer? If the application is responsible for the creation of the window, and assuming the renderer is in a DLL how would I pass the window handle into the DLL so I can initialize the DirectDraw object? Secondly how does Ogre go about window creation? I took a shift though the source code, but due to lots of abstraction (not always a bad thing :lol: ) I can't pinpoint exactly how window creation is handled in Ogre.

Thanks,
Strych.

Re: Window Creation

Posted: Tue Aug 23, 2011 2:25 pm
by jacmoe

Re: Window Creation

Posted: Tue Aug 23, 2011 6:03 pm
by strychnine213
Thank you jacmoe, that is exactly what I was looking for. I swear when I was looking through Ogre I looked there :oops:

Just to make sure I have this right then: The renderer is in charge of the actual creation of the window. It does this with a function. The application can then call the function and pass arguments like a window title?

Re: Window Creation

Posted: Tue Aug 23, 2011 7:00 pm
by jacmoe
Read the contents of OgreRoot.cpp in OgreMain. :wink:

Re: Window Creation

Posted: Tue Aug 23, 2011 8:28 pm
by strychnine213
OK, I've made that my thing to study today; let's learn something!

P.S. Is there anything specific I should be looking for (maybe save me a few hours :D)?

Re: Window Creation

Posted: Tue Aug 23, 2011 8:46 pm
by jacmoe
Once you've learned how to create your own groovy windows - learn how to pass the handle to it to Ogre so that it can make use of it, instead of creating it's own. :)

Re: Window Creation

Posted: Tue Aug 23, 2011 8:51 pm
by strychnine213
Thank you very much bud. I really appreciate the help!

I'd give you a cookie, but sadly I ate'd them :lol:

Re: Window Creation

Posted: Fri Aug 26, 2011 4:15 am
by strychnine213
OK, so I took a day to read through and look over the code and most of it is pretty straight forward. What I'm still not 100% on is how the window passes it's handle so that the device creation can happen.