Archived

This topic is now archived and is closed to further replies.

caffeineaddict

Start Screens?

Recommended Posts

Hi I just finished my first OpenGL 3d game, with help from a friend, but I just wanted to make a start screen for it. The start screen would let you choose different options to change etc. but i''m not sure how to do this using OpenGL, i''m quite new to the API so please help me out

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Use an orthographic projection, disable the depth buffer and lighting. Now you can just use textured quads to draw whatever you want to the screen. If you use several layers of quads (and textures), then you can use blending to get different interesting effects. Just as in Gimp or Photoshop.

Eg.
1) Draw a background image (one big texture or tiled smaller ones)
2) Draw small textures for your options, use different colours or blending modes, if the option is selected. The textures can be done using Photoshop or similar, or can be created at runtime.
3) Draw the mousepointer

Share this post


Link to post
Share on other sites
Hi, thanks for the reply, but i just have one more question, how can i tell if an option was selected? do i need to make each small texture something special so when you click it, it does what you want?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
To actually test, if the option is selected, just compare your mouse coordinates with the coordinates of each texture quad, quite straightforward.

Then you can do lots of things, if the option has been selected. A possibility would be to have 2 different textures for each option, one unselected and one selected. You can use cool Photoshop filters, such as glows to get a nice looking effect.
You can also have a single texture for both and just change the colour, if it''s selected. Or the blendmode. Or the transparency, if you use alphablending. Or everything
You have to experiment a bit and try out several options, I''m sure you''ll find a cool looking effect.
Another cool effect is to alpha-blend a procedurally animated texture (like the old fire effect) over the normal texture, if the option is selected. This will make your option ''burn'', if it''s selected, very nice.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Ah this may also help you C++ though but this should be easily ported to other...

I''m guessing your using NeHe''s basecode so if your using Lesson1 at the basecode for your app. then should help you get a Start Screen.

void StartScreen()
{
Whatever you''d like to put here: textures, text, etc.
}
int InitGL(GLvoid)
{
StartScreen();
return TRUE;
}

With that you''ll get a StartScreen or you could call it a menu.

In Nehe''s new base code it''d may look like this.

void StartScreen()
{
Whatever you''d like to put here: textures, text, etc.

}
BOOL Initialize (GL_Window* window, Keys* keys)
{
StartScreen();
return TRUE;
}

My reason for putting it in the Initialization part of the code is to insure that the menu/startscreen in your case shows every time the demo is started.
BTW I like the selection and effect idea only prob. here is that you''d need a pointer of some sort, which shouldn''t be to hard to make.

Share this post


Link to post
Share on other sites
I can offer you a written class, go to www.kivilinn.tartu.ee/z
get the zip file from there. You will need only ui.h an ui.cpp from the archive...(ps this class has a few bugs...shortly(tomorrow) Ill put up a clean version...)..hope this helps...

Share this post


Link to post
Share on other sites