问题
I was just wondering if it is possible to render the OpenTK gamewindow in a Linux Console (Raspberry Pi Raspbian) without any X11 Desktop?
If it possible, how do you do it?
回答1:
Yes, it's experimental since 1.1 or 1.2. Adjust OpenTK.dll.config
if some dll could not be found, and maybe you'll have to find correct libinput version (libinput-0.2.0
is working on my debian) to match api binding in opentk. I'm not fully sure, but I think that it's only working with modern GL (>3.0).
Ensure you have libdrm
, libgbm
and correct libinput
on your system and latest mesa
.
OpenTK will automaticaly detect linux console environment if program is launched from a console. If you face trouble finding missing dll's, enable full debug messages in Otk.
回答2:
I have this working but it took a bit of work. First I created a c library to call through to the native libraries for controlling the gl chipset on the PI and exposed these so that I could call them from C#.
Secondly I had to recompile the opentk with the switch to not use dynamic bindings. In the end I stripped out most of the game window logic and just used the bindings and the maths code from opentk.
More details and code here:
http://www.opentk.com/node/4024
Basically this is enough to get you clearing / swapping the screen etc and you can then add the binding code through to the GL ES 2.0 spec which you can generate in the opentk project / solution tools.
来源:https://stackoverflow.com/questions/30270432/c-sharp-opentk-linux-console-without-x11