News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

File reading and printing in openGL

Started by gargimails, March 12, 2011, 04:44:07 PM

Previous topic - Next topic

gargimails

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

qWord

FPU in a trice: SmplMath
It's that simple!

Farabi

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

Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"