PDA

View Full Version : OpenGL and tic tac toe



Fuzzy
09-09-2008, 08:34 PM
Ok, I'm trying to learn opengl. I have a couple of books. I was wondering though. How would I go about making the board? I was thinking about taking 9 sqaures and going into photo shop and making a board and then dicing it up to match the squares. then making images that replace the image (orginals) on the square when a "O" or an "X" is played.

or

Can you have just 1 square instead of 9 sqaures and use some of corrdinate system to mate the images for the Xs and Os to the right spot?

I've never done anything like this and I'm not use to thinking in programing terms so I'd like some ideas.

Fuzzy
09-09-2008, 08:39 PM
I was also thinking. How hard would it be to make the board 1 piece using a simple Texture for the board lay out and then making 2 more textures for the "X" and the "O" as a png so I can have a transparent background and then make up like 9 clickable mouse spots that when clicked applied the image (X or O) with in the predefined area??? How would you setup the predefined area?

ZbuffeR
09-10-2008, 09:12 AM
All these 3 implementations are possible.

The simplest for you is probably to have 3 different textured quads : empty background, background with x, background with o. Then you can draw as many as you need, ie 9 empty at the start, etc.

Fuzzy
09-10-2008, 02:21 PM
All these 3 implementations are possible.

The simplest for you is probably to have 3 different textured quads : empty background, background with x, background with o. Then you can draw as many as you need, ie 9 empty at the start, etc.

I was thinking that might be the easiest. I plan on heading back to school for programing in the spring time. I am hoping programming II will open more doors.