1

So I bought a Raspberry Pi 3 Model B that I run Raspbian on. I found this tutorial and I've managed to connect to my RPi from Visual Studio and run the example program that was included in the extension. But the library that that program uses is WiringPi which only seems to include functionality for very basic stuff, like digitalWrite and that...

I want to open an OpenGL window on Raspbian and be able to control the OS and not just the Pi itself. I've googled a lot and I just can't find anything, or I just don't know what the right thing to google is... Can some experienced Raspberry Pi geek out there help me?

1

How I "solved" it

I haven't solved the Visual Studio problem. But I thought I'd share how I have things set up now instead.

  1. Samba is running on the Pi. It makes it possible to reach files on the Pi from Windows - through the network.
  2. The source files are located on the Pi. Thanks to Samba, I can write the code on my Windows machine but the files are stored on the RPi.
  3. The Pi itself compiles the code. Via PuTTY and SSH, I tell it to compile the code with g++.
  4. I edit the code in Sublime. I won't get any help with code completion or documentation this way, but I think it's worth it. Both compilation and linking is done on the Pi.
  5. I can easily download libraries using apt-get. For example, I downloaded GTK+ to the Pi with the command apt-get install libgtk-3-dev. Then, it just works. Just add an #include <gtk/gtk.h> to your source file and you can start using GTK+.
0

what the right thing to google is

Not anything including "raspbian" or "raspberry pi". Raspbian is just a tweaked version of Debian, which is a standard GNU/Linux distro. If you search for things like this in a Pi specific way, you will tend to get pi specific answers (e.g., your tutorial involving the GPIOs) or stuff that is a regurgitation of existing linux oriented documentation. Commonly this is of lower quality than the original.

The GUI stack on linux, in contrast to MS Windows (or OSX), is heterogenous, meaning, it is not homogeneous, monolithic, or uniform across systems. The default stack used on Raspbian is not unique to it or Debian. OpenGL is cross-platform, so it is not even unique to linux. However, with regard to creating GUI windows, you want to work with a widget toolkit; the predominant (but not only) ones are Gtk+ and Qt. These are both cross-platform as well, although the former might be considered closest to a "native" GNU/Linux GUI API. The C++ version is gtkmm. I believe both these things should have some OGL integration although it has been a long time since I looked at them; in any case they both have extensive primary documentation.

I recommend you avoid anything which refers to GLUT as it exploits depreciated aspects of the OGL API. Once upon-a-time SDL was widely used to structure OGL applications but you may want to stick with something more minimal, again via the widget library if possible.

You can read more about what I mean by "heterogeneous stack" here. In relation to that, the default desktop environment used on Raspbian is a slightly customized LXDE, which uses openbox as the window manager. However, this is tangential or irrelevant with regard to developing GUI applications, which are creating using a widget library as mentioned above. DE's tend to use one or another for their own integrated applications (such as the file browser); LXDE is Gtk+ based, however, this does not mean you can only run Gtk based apps.

0

Maybe you should try cross-compiler like VisualGDB ? It provides nice GUI integrated with VS. There are sample tutorials for that plugin as well as community on their forum. You have to pay license after 30-day trial, but for me it's worth it if you are familiar Visual Studio and plan to program your Pi remotely.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.