Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

game in c and to avoid file access

Status
Not open for further replies.

arunpm

Programmer
May 29, 2001
6
DE
hi ,
i would like to avoid file access .i am writing a game in
C.i want to avoid file access in getting .sgi file and font file.all i want to do is take it in the form of header file and pass it on structure.
kindly pass me ideas how solution to this a or any alternate method to accomplish this task.
i am using graphics libraries
if u have any source code for game in C kindly pass me
thanks in advance
arun
mapradeep@yahoo.com
 
I dont follow exactly what you mean but what I would suggest as an alternative to accessing a file could be putting all the information into a buffer. Not sure if this is the path you are looking for though.

Matt
 
hi matt,
if i put my font info into buffer will it not be memory consuming.what i mean is if i want to display some title on video content, the font what i use should be taken from a file.instead i should avoid that and embedd into the program itself.
thanks
arun
 
I don't know what the format of the font would be, but if you don't want to store it in a file, you could put it in an array of unsigned char:

unsigned char fonts[]={0x55,0x4b,0xef};

With the elements being the hex equivalents of the values of the different fonts.

Russ
bobbitts@hotmail.com
 
Are you asking how to store files in a resource so that users cannot access them outside the program? Rob Marriott
rob@career-connections.net
 
hi rob,
my question is i dont to do file io in my program to read the contents of files .sgi and font file where i will be needing these to display on screen
suggest me a method
arun
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top