jjgl's picture

Namespace conflict when using TextPrinter

Project:OpenTK.Text
Component:Miscellaneous
Category:support request
Priority:normal
Assigned:Unassigned
Status:open
Description

Since TextPrinter class is in OpenTK.Compatibility.dll in OpenTK 1.0, and if add OpenTK.Compatibility.dll to reference in a project, it will cause namespace conflict problem, what is solution to overcame the compiling problem? I have been struggling to print text on a viewport, any help will be greately appreciated.


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Hortus Longus's picture

#1

Quote:

Since TextPrinter class is in OpenTK.Compatibility.dll in OpenTK 1.0, and if add OpenTK.Compatibility.dll to reference in a project, it will cause namespace conflict problem, what is solution to overcame the compiling problem?

TheFiddler wrote: OpenTK.Compatibility is there to support projects using the Tao framework or older OpenTK versions. It's not really meant to be used outside of those circumstances (namespaces clashes will arise if you try to include namespaces from both OpenTK and OpenTK.Compatilibity in the same source file).

Quote:

I have been struggling to print text on a viewport, any help will be greately appreciated.

Look in the gallery for examples.

the Fiddler's picture

#2

The simplest solution is to avoid adding both using OpenTK.Graphics and using OpenTK.Graphics.OpenGL directives when using OpenTK.Compatibility. Pick one of the two and use full namespace paths for the other.

jjgl's picture

#3

Thanks, it works. However, there is a warning when compiles. The message is as following:
"OpenTK.Graphics.TextPrinter' is obsolete".
What that means? Thanks again!!