> But when I try to compile the bishop piece I get this error
> FATAL : Out of Memory in function set.
Just so that we're all clear on this, this happens when you're compiling the code right?
Or does it mean the code has compiled OK, and this is what you get when you run the code.
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
The most likely cause is that your source file is too big. This is either because you only have one source file, and it contains all the code, or you have many source files, but they're all #include 'ed in a since file which is then compiled.
The solution is to split the code up into separately compiled modules.
The next most likely cause is that you're using some ancient 16-bit fossil compiler, and you're using the wrong memory model . If your code (or data) exceeds 64K, and you've chosen the wrong memory model, then the program will no longer fit in memory.
The solution is to use the correct memory model for your project (see your compiler manual pages for details of how to do that).
A better solution is to use a modern 32-bit compiler and join the rest of the real world.
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
Yes, drop the idea graphics.h as being the only thing which can do graphics.
For example, dev-c++ easily integrates with http://www.libsdl.org/
> Do you mean into different header files. Like some functions into different header files?
Yes, like you have
board.c - the implementation of a chess board
board.h - the interface to the chess board
pieces.c -
pieces.h
main.c - brings everything together.
The project file would contain 3 source files and two header files.
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
libsdl is a better choice than BGI since it has a host of functions and has better tutorials and support on the internet than BGI. Considering that you have one entire month for making the game, you can easily switch to libsdl and finish off the project.
~s.o.s~
Failure as a human
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 734
But how much of libsdl were you planning to use?
I mean, some squares for the board, and some polygons for all the pieces, plus some simple I/O would seem to be all that you need (it's all BGI was going to give you anyway).
Sooner or later, you have to realise that there isn't necessarily a tutorial for everything out there, and it's up to you to read basic manual page type information and figure the rest out for yourself.
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
The solution is to use the correct memory model for your project (see your compiler manual pages for details of how to do that).
A better solution is to use a modern 32-bit compiler and join the rest of the real world.
And the best solution is to do both :)libsdl is a better choice than BGI since it has a host of functions and has better tutorials and support on the internet than BGI.
Whatever it is, it's a better choice if it supports 32 bit environments as BGI is 16 bit only :)
The basic game engine should not contain any display related code.
Write everything without a display system and then write a display system you can plug that code into.
Make both independent of the other and have some interface between them.
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
> Maybe I could use that feature instead of drawing the pieces myself.
Maybe you could, but I would leave that until the end when you know you've got time to do it, and you have the backup of having something working already.
Don't waste the next 3 weeks fiddling with alternative graphical presentation styles. Pick something basic for the moment until the core game logic is working to your satisfaction.
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953