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
http://nehe.gamedev.net/
Use this
.uMsg==WM_CREATE
invoke glClearStencil,0
invoke glEnable,GL_DEPTH_TEST
invoke glDepthFunc,GL_LEQUAL
invoke glHint,GL_PERSPECTIVE_CORRECTION_HINT,GL_NICEST
invoke glHint,GL_LINE_SMOOTH_HINT,GL_NICEST
invoke glEnable,GL_LINE_SMOOTH
invoke gluPerspective,CDBL(45.0),CDBL(1.0),CDBL(1.0),CDBL(10000.0)
.endif
glPrint proc uses esi lpText:dword,lpFltX:dword,lpFltY:dword
invoke glPushMatrix
invoke glMatrixMode,GL_MODELVIEW
invoke glLoadIdentity
invoke glPushAttrib,GL_LIST_BIT
invoke glRasterPos2f,lpFltX,lpFltY
mov eax,base
sub eax,32
invoke glListBase,eax
invoke lstrlen,lpText
mov edx,eax
invoke glCallLists,edx,GL_UNSIGNED_BYTE,lpText
invoke glPopAttrib
invoke glPopMatrix
ret
glPrint endp