32-Bit for .NET Binding
« on: 06 December 2018, 20:34:41 »
Hi,
I'm wondering if there are any plans for a 32-bit version of the .NET binding of TGUI?
Thanks :)

Re: 32-Bit for .NET Binding
« Reply #1 on: 06 December 2018, 20:37:05 »
I just saw that you wrote this in another post. Is this why there isn't 32-bit?
Quote
TGUI.Net doesn't have all the features that exist in TGUI because the C interface used to communicate to TGUI can't do everything. There are some things that are possible but which I just decided not to spend time on them until someone requests them though. But the things you request seems to have technical limitations.

*

texus

  • *****
  • 1280
    • View Profile
    • Texus's Blog
Re: 32-Bit for .NET Binding
« Reply #2 on: 06 December 2018, 22:38:52 »
Although that quote was about the C# code itself, it is indeed because I never took the effort to support it and nobody asked for it until now.

Is there a reason why you need to use 32-bit? I guess there are still too many people with old computers out there who are using it, but I would think almost anyone who would be interested in running new software would have a 64-bit pc.

Although there is no technical limitation for 32-bit, you will have to change a few files to get it working because I hardcoded the x64 value to keep things simple.
You will have to start by checking out the TGUI.Net project with git (i.e. "git clone https://github.com/texus/TGUI.Net").
Open extlibs/build.bat and change the 3 occurrences of "vcvars64.bat" to "vcvars32.bat". There are also 3 occurrences of "x64" in that file, leave the "...Tools.x86.x64" on top alone, but change the ones in the cmake and msbuild lines to "x86".
Go back to the root folder and open build/TGUI.Net.sln with a text editor. Replace all occurrences of "x64" with "x86".

That should be enough to get 32-bit working. If you update the submodules and run the build.bat file in the build directory as described in the readme then it should build 32-bit libraries (this will take several minutes). Let me know if it works or not. If it works then I'll try to come up with a way to let you choose 32 or 64 bit without having to change the scripts manually.

Re: 32-Bit for .NET Binding
« Reply #3 on: 07 December 2018, 06:11:57 »
Thanks very much for your help! :)

Re: 32-Bit for .NET Binding
« Reply #4 on: 07 December 2018, 12:11:28 »
Hmm.. I can't seem to be able to update the submodules I just get this error with git.
Code: [Select]
D:\TGUI.Net 32\TGUI.Net-master>git submodule update --init --recursive
fatal: not a git repository (or any of the parent directories): .git

*

texus

  • *****
  • 1280
    • View Profile
    • Texus's Blog
Re: 32-Bit for .NET Binding
« Reply #5 on: 07 December 2018, 18:21:06 »
You have to clone the project with git, not just download the source code from github.
« Last Edit: 07 December 2018, 18:36:51 by texus »

Re: 32-Bit for .NET Binding
« Reply #6 on: 07 December 2018, 18:59:35 »
Oh okay thanks :) I'm not that experienced with github

*

texus

  • *****
  • 1280
    • View Profile
    • Texus's Blog
Re: 32-Bit for .NET Binding
« Reply #7 on: Today at 11:11:52 »
I have updated the scripts to be able to build 32-bit libraries, it involved a bit more changes than I originally though.

The steps to download and compile them are as follows:
git clone https://github.com/texus/TGUI.Net
git submodule update --init --recursive
cd build
build.bat x86

I haven't actually been able to test the 32-bit libraries though as I don't know how to get an x86 dotnet program working on my 64-bit windows (I know very little about dotnet). So you are on your own for that part.