dwmkerr / dwmkerr/sharpgl

GL.DrawText gives wrong characters

Open
#168 14 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
804
Forks
294
Avg merge
3d 23h
Merged PRs (30d)
1

Description

Hi Dave:
I am using GL.DrawText to display values in a SharpGL control: problem is that the text comes out garbled rather than what I send to DrawText - see the attached screenshot. Wondering what I may be doing wrong. The code is below. Thanks for any help. Claude. 15 Feb 2020

**Note:** The SharpGL control is used on a ChildWindow in a MDI environment.

Dim iR, iG, iB As Int32
Dim R, G, B As Single
Dim FontStr As String = "Arial"
Dim FontSize As Single = 10.0
Dim iX As Int32 = 0
Dim iY As Int32 = 0
Dim Gl As SharpGL.OpenGL = GLControl1.OpenGL
' ====================================

' Position where to start the Text
iX = CInt(PosX)
iY = CInt(PosY)

' Convert text color
Call GetRgbFt(Graf.IColorTxt, iR, iG, iB)
R = CSng(iR / 255)
G = CSng(iG / 255)
B = CSng(iB / 255)

' Display the text
Gl.DrawText(iX, iY, R, G, B, FontStr, FontSize, TxtStr)

![DrawText](https://user-images.githubusercontent.com/44559269/74587284-af33a780-4fbe-11ea-91cd-eb5b3de14ed7.png)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.