Jump to content
  • Advertisement
Sign in to follow this  

glPrint without using glScaled

This topic is 4906 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, i am new to OpenGL, now is editing a piece of code that is handled down. :D However i notice that in the tutorial provided in this website, there is no need to use glScale in order for the text to appear, however the code that i am working on will have no text appear if i did not use the glScaled, What am i doing wrongly.? Thanks and Best Regards. Below is my Code in the function BuildFont base = glGenLists(256) ' storage for 256 characters hFont = CreateFont(20, 0, 0, 0, FW_BOLD, False, False, False, _ ANSI_CHARSET, OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS, _ ANTIALIASED_QUALITY, FF_DONTCARE Or DEFAULT_PITCH, "Verdana") SelectObject ghDC, hFont wglUseFontOutlines ghDC, 0, 255, base, 0, 0, _ WGL_FONT_POLYGONS, gmf(0) 'WGL_FONT_LINES Below is the glPrint F(x) If strlen > 0 Then ' only if the pass a string ReDim b(strlen) ' array of bytes to hold the string For i = 0 To strlen - 1 ' for each character b(i) = Asc(Mid$(s, i + 1, 1)) ' convert from unicode to ascii Width = Width + gmf(b(i + 1)).gmfCellIncX If gmf(b(i + 1)).gmfBlackBoxY > Height Then Height = gmf(b(i + 1)).gmfBlackBoxY End If Next b(strlen) = 0 ' null terminated ' translate to right position and rotate to the right angle Select Case Opt Case 0 ' chart title Translate_ChartTitle X, Y, fScale Case 1 ' x title Translate_xTitle X, Y, fScale Case 2 ' y title Translate_yTitle X, Y, fScale Case 3 ' x label Translate_xLabel X, Y, fScale Case 4 ' y label Translate_yLabel X, Y, fScale End Select 'glScaled fScale, fScale, fScale glPushAttrib amListBit ' Pushes the display list bits glListBase base ' sets the base character to 0 glCallLists Len(s), GL_UNSIGNED_BYTE, b(0) ' draws the display list text glPopAttrib ' pops the display list bits End If

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!