migueltk's picture

Bixion2D, a pretty good graphical user interface using OpenTK

Bixion2D v11.04

I just finished adapting the project to work with OpenTK. The capture of the keys on the keyboard should be improved but overall I think it is a very useful tool. I have not tried in Linux but in theory should work fine, but you have to install freetype previously. Requires an OpenGL 3.0 context, this change in the future I hope to work with OpenGL 2.0/2.1, any help is welcome.

Enjoy it!

Miguel


Comments

Comment viewing options

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

With time and effort, nothing is impossible. Like doing things, we have, but having time is something else.

I understand that there are two ways to eliminate dependence on "freetype" in the project Bixion2D.

1 - Replace method "void DrawText (string text, float x, float y)" in class "Font" using "QuickFont."

2 - Try replacing the dependent "freetype" in method "bool CompileChar (char character)" in class "Font.FreeType." Basically, this method does is create a "Pixmap" for each character, in a "Pixmap" image data representing the character is saved as "byte [] pixels".
I think this can be achieved with "Graphics.DrawString ()" in theory is only necessary to replace or adapt the code of the method "bool CompileChar (char character)."

I understand that the second option is more practical.

P.D: Were you able to run Bixion2d on Windows?

carga's picture
migueltk wrote:

I understand that the second option is more practical.

I'll find some time to test this approach.

migueltk wrote:

P.D: Were you able to run Bixion2D on Windows?

Not yet. Win is extremely rare animal in my environment, it almost disappeared eventually. Especially the one with OpenGL 3.0.

BTW, I have posted a bug to mono with Bixion compilation error. ;-)

Have a fast code!
Anton.
http://kyta.spb.ru

PS For some strange reason I do not receive e-mail notifications about your replies, so please excuse me for possible delay with answer.

carga's picture
migueltk wrote:

2 - Try replacing the dependent "freetype" in method "bool CompileChar (char character)" in class "Font.FreeType." Basically, this method does is create a "Pixmap" for each character, in a "Pixmap" image data representing the character is saved as "byte [] pixels".
I think this can be achieved with "Graphics.DrawString ()" in theory is only necessary to replace or adapt the code of the method "bool CompileChar (char character)."

I understand that the second option is more practical.

Looking in the code (I personally don't understand what's going on around CompileChar method) I saw another font class (BitmapFont or something like this). So to cut the corner, I just updated GetFontType method to always return Bitmap font type instead of TrueType.

Is Bitmap font support complete enough to be used in Bixion demo?

After this change, I received other error:

logfile.txt	LibGui initialized.
logfile.txt	
logfile.txt	Searching for skins...
logfile.txt	Loading content...
logfile.txt	Generating GUIObjects...
logfile.txt	  done.
 
Unhandled Exception: System.ArgumentException: Can't add 'null' to FontPool!
Parameter name: newFont
  at Bixion2D.ZweiDe+TextHelper.ChangeFontPool (Int32 indexNum, Bixion2D.Font newFont) [0x00000] in <filename unknown>:0 
  at Bixion2D.Program..ctor () [0x00000] in <filename unknown>:0 
  at Bixion2D.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentException: Can't add 'null' to FontPool!
Parameter name: newFont
  at Bixion2D.ZweiDe+TextHelper.ChangeFontPool (Int32 indexNum, Bixion2D.Font newFont) [0x00000] in <filename unknown>:0 
  at Bixion2D.Program..ctor () [0x00000] in <filename unknown>:0 
  at Bixion2D.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0

PS I have to run Bixion in my Ubuntu box which has GPU with OGL v3 support, and in this environment there is no line numbers provided in stack trace. Sorry.

Have a fast code!
Anton.
http://kyta.spb.ru