Two Simple? OpenGL Questions

Started by
0 comments, last by Andy999 22 years, 3 months ago
G''day all, I''m a little bit stumped at the moment, I would like to have my OpenGL window appear as a part of a dialog, can anyone help me with an example of this. Secondly, in the example of the rotating cube (texture example), I would like to change the cube to have a different image on each side, am I restricted to Textures or is there a way I can load in a bigger bitmap? Any assistance would be greatly appreciated. Best regards Andrew
andrewl@ozemail.com.au
Advertisement
Yea, that pretty simple.

You can use:

    HWND GetDlgItem(                HWND hDlg,       // handle of dialog box                int nIDDlgItem   // identifier of control);    


to get the handle to the dialog control. Then, you just setup the pixel format like you would a regular window.

Now for the cube, you can load textures larger than 256x256. I'm not sure what limits OpenGl puts on the size of texture, except for due to available memory and that the texture must be a power of 2. You can use 'gluBuild2DMipmaps(...)' though, to convert an image that has dimentions that arn't a power of 2.
I don't know what you are trying to do, but if you are just wanting to texture the cube with a different image on each side, you could combine six texture into one large one and then just map the cube side with the respected region of the texutre.

Take care,

Nyko


Edited by - Nyko on January 16, 2002 9:41:49 AM

This topic is closed to new replies.

Advertisement