Advertisement

How to program a chess: a forum based tutorial

Started by December 23, 2004 11:09 PM
276 comments, last by da_grat1 19 years, 8 months ago
How many subsystems all together?
Just 1 :) This is the power of abstraction. DevIL will load all of these file types and all you have to do is pass it the path to the image file. I've got the code done and I'm reviewing it right now...

After that its on to the subsystem you've all been waiting for; model loading :D

Pop quiz:
Why should you always make accessors and modifiers for your class's data members (even if its a straight pass)?
Answer:
So you can add one later if you want to :)

Will post later,
- llvllatrix
Advertisement
Hey guys,

You can download the new source from:

You can download a the new source code at:
http://www.eng.uwaterloo.ca/~rramraj/Gamedev/chess_tutorial/src_tree/chess_src.zip

It should be straight forward; You can find info on the DevIL (OpenIL) SDK in inc_os_dev_il.h.

Cheers,
- llvllatrix
Wow..great... I tested it.. but when i try to open image with 1024 * 640 dimension...it says "image dimension incorrect".. I can only open an image with 1280 * 1024 dimension.. :) why is it like that?..

OpenGL can only create textures that have dimentions which are of power 2. When I wrote the code, I thought that people would prefer to resize the texture themselves (so that they can approve of the result) rather than have an algorithm do it when the texture loads (which can potentially cause artifacts in the texture).

Will post later,
- llvllatrix
So are we finshed with the sound resource than and we're moving onto the graphics now??
Advertisement
Quote:
So are we finshed with the sound resource than and we're moving onto the graphics now??


Yup :) We really dont need anything too complicated for sound.

We've roughly divided the bottom layer of our pyramid into two parts; the resource library and the utility library. Components of the resource library either currently use the disk or could potentially use the disk in the future. Components of the utility library will never use the disk (timers ect).

The reason for the division is for a feature we may want to consider adding later on (as our games get more complicated). Professional resource managers are fairly large and complicated because large games have lots of assets to load. Usually the assets are packed into one file. Resources are loaded from disk as they are needed, instead of loading everything into memory at once. Music is also streamed from disk (not as hard as you think; we can actually modify our sound code to do it...managing that code would be the hard part).

Why dont we need to write a resource manager like this? The answer is simple: we can easily load all of our assets into memory. If we were to start another project after this one, upgrading the resource manager would probably be the place to start.

Will post later,
- llvllatrix
What types of sound are we using... will we be able to hear a sound when we move the chess piece..

Now we are doing the modal loading part right? is that how we place the chess pieces on the board?
This is how we load and draw the chess pieces in OpenGL. We will technically be able to place the pieces on the board but it will merely be asthetic. We wont be able to play the game yet until we define the game's logic.

Will post later,
- llvllatrix
In the model loading, the coding is used to load the milkshape format.. but can we use the same coding to load other format such as 3D max...?

This topic is closed to new replies.

Advertisement