Click here to Skip to main content
15,886,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am making a GUI in visual c++ and using OpenGL for drawing. I want to read a word from text file and print it on openGL screen.I need to read the word to be printed from file, as well as its x & y co-ordinates also from file. Can anyone suggest how to go about?

Tim
Posted

1 solution

That is not hard to do. First you need to read about file IO. Here is a good introductory article http://www.cplusplus.com/doc/tutorial/files/[^]

Once you are learn how to do, you need to come up with your data storage format. May be this may help. I would write in each line, the x-coordinate, the y-coordinate and the text

10,10,Hello World<br />
10,20,Here I come<br />
10,30,What a Beauty....
 
Share this answer
 
Comments
Harrison H 14-Mar-11 12:54pm    
Pretty much all in there.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900