Window Creation

A place for Ogre users to discuss non-Ogre subjects with friends from the community.
User avatar
strychnine213
Kobold
Posts: 30
Joined: Tue Feb 22, 2011 4:31 pm
x 1

Window Creation

Post 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.
My program doesn't have bugs, it just develops random features.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179

Re: Window Creation

Post by jacmoe »

/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
strychnine213
Kobold
Posts: 30
Joined: Tue Feb 22, 2011 4:31 pm
x 1

Re: Window Creation

Post 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?
My program doesn't have bugs, it just develops random features.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179

Re: Window Creation

Post by jacmoe »

Read the contents of OgreRoot.cpp in OgreMain. :wink:
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
strychnine213
Kobold
Posts: 30
Joined: Tue Feb 22, 2011 4:31 pm
x 1

Re: Window Creation

Post 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)?
My program doesn't have bugs, it just develops random features.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179

Re: Window Creation

Post 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. :)
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
strychnine213
Kobold
Posts: 30
Joined: Tue Feb 22, 2011 4:31 pm
x 1

Re: Window Creation

Post 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:
My program doesn't have bugs, it just develops random features.
User avatar
strychnine213
Kobold
Posts: 30
Joined: Tue Feb 22, 2011 4:31 pm
x 1

Re: Window Creation

Post 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.
My program doesn't have bugs, it just develops random features.