Is there a graphical "hello world" for C++ on IRIX?

KayBee

Active member
Feb 24, 2020
135
102
43
Hi All,

My O2 Irix 6.5.30 install has MipsPro 7.2.1. I am transitioning from Arduino graphics to messing with graphics in C++ on IRIX. I want to use standard libraries to write simple graphics demos to start with. Executing opens a window, draws 2d lines, clears window, draws new 2d lines in window, rinse, repeat.

I would appreciate if you folks could point me to an example.

Thank you.

KB
 

Northsky

Reindeer Whisperer
Feb 8, 2019
23
26
13
Running 'infosearch' command on the xterminal brings up a vast library of manuals. I have been reading those when adventuring out to the world of OpenGL / C++ on IRIX.
 

hammy

Active member
Jun 1, 2019
108
68
28
UK
My O2 Irix 6.5.30 install has MipsPro 7.2.1. I am transitioning from Arduino graphics to messing with graphics in C++ on IRIX. I want to use standard libraries to write simple graphics demos to start with. Executing opens a window, draws 2d lines, clears window, draws new 2d lines in window, rinse, repeat.
Hey KayBee,

Basically Irix has maybe three levels of "do graphics the IRIX way"

  1. Regular windowed applications with buttons, menus, lists etc - if you are using C++ the classic IRIX library for that would be ViewKit (`man ViewKit` - and check the documentation out with `infosearch` as Northsky mentions)
  2. OpenGL for accelerated 2D and 3D graphics - these can be added to ViewKit programs as widgets too, it doesn't have to be a standalone GL only style thing.
  3. A higher level graphics library like OpenInventor and Performer. These hide some of the complexity of dealing with GL to give you things like a scene graph where you add a sphere node, then add a translation node as a parent etc.
Of course IRIX has a full X11 implementation too, so like Onre mentions you can code against X11 too.

That's quite a few options - sorry there's no obvious "always use this toolkit". If you're only wanting to do full window demos and buttons/menus etc aren't your thing, then perhaps GL or X11 might get you up and running the quickest.

Be aware that the GL implementation is 1.2 or 1.3 ish (sorry don't remember exactly) - so a lot of tutorials you'll find online won't be compatible with this older version.
 
  • Like
Reactions: Elf

foetz

Member
Feb 19, 2019
93
47
18
and motif of course. that was the most popular "gui lib" across all unix versions at the time,
 

KayBee

Active member
Feb 24, 2020
135
102
43
OK smart people, Thank you. one, that's an interesting example, I will explore that first. Northsky thanks for the documentation knowledge, I didn't know that was a thing. Hammy that is the very first step I needed on this journey, a 30,000 foot view perfect. I was in the "Where the hell do I start?" mode, I will start in X11.

Cheers,

KB
 

foetz

Member
Feb 19, 2019
93
47
18
in addition to my previous post, note that sgi's viewkit is nothing else but a c++ wrapper for motif which has a certain style applied by default. but as always with wrappers, viewkit takes its performance toll. especially on older models you'll see a noticeable speed decrease compared to motif alone.
so unless you don't wanna use the viewkit exclusive widgets, it's a good idea to stick to motif and apply the irix look yourself.
 
  • Like
Reactions: Elf

KayBee

Active member
Feb 24, 2020
135
102
43
Hi IRIXians,

In an effort to learn c++ and mess with graphics, I am giving OpenGL a go. These machines were almost literally created for it.

I have installed the OpenGL samples, which have installed here:

/usr/share/src/OpenGL/teach/glut_based

and in that directory is the example I want to compile the example that draws lines: "line.c" which has the inclusion:
#include <GL/glu.h>

when I try to compile it:
cc -n32 line.c -o line -lglut -lGLU -lGL -lXmu -lX11

I get:
"The source file "GL/glut.h" is unavailable."
1 catastrophic error...
Compilation terminated.

There is a GL/glut.h located in /usr/share/src/OpenGL/toolkits/include/GL so I presume I need to set something else up such that the library can be found.

I'd appreciate some guidance.

Thank you.

KB
 

Elf

Storybook / Retired, ex-staff
Feb 4, 2019
792
252
63
Mountain West (US)
I don't have an IRIX terminal handy at the moment, but you might try adding: -I/usr/share/src/OpenGL/toolkits/include

The -I argument to the compiler adds directories to the search path for includes :)
 

KayBee

Active member
Feb 24, 2020
135
102
43
I never had heard of that, interesting and thank you. I tried that and I think there is some other factor going on. I did as you suggested, I also copied the glut.h file to the same location as the other "includes" and into the /GL directory and ensured it's permissions. I am still getting the "The source file "GL/glut.h" is unavailable." error.
 

foetz

Member
Feb 19, 2019
93
47
18
In an effort to learn c++
...
cc -n32 line.c -o line -lglut -lGLU -lGL -lXmu -lX11
no c++ there, that's the c compiler. in fact the gl_dev package examples you installed have no c++ at all.

There is a GL/glut.h located in /usr/share/src/OpenGL/toolkits/include/GL so I presume I need to set something else up such that the library can be found.
yes and no. yes, you need something else. and no, this is not the library but the header. the library would be a .so file.
header files in non-standard locations have to be explicitly added via -I as elaborated by Elf. this is not irix specific but a general, basic compiler thing which applies to pretty much all operating systems and compilers.

copied the glut.h file to the same location as the other "includes" and into the /GL directory
no, /GL would be a top-level folder. i guess you mean the GL in /usr/include but don't do that. never tinker with system folders unless you know exactly what you're doing.


in general it's a good idea to start with some basics first. unix basics as well as compiler basics. graphics programming is not the easiest domain and lacking fundamentals makes that even more diffcult.
 

KayBee

Active member
Feb 24, 2020
135
102
43
Hey Foetz,
I was just so excited to generate some pixels, thank you for that, point taken. I'll go do some homework in those things first.

KB
 

About us

  • Silicon Graphics User Group (SGUG) is a community for users, developers, and admirers of Silicon Graphics (SGI) products. We aim to be a friendly hobbyist community for discussing all aspects of SGIs, including use, software development, the IRIX Operating System, and troubleshooting, as well as facilitating hardware exchange.

User Menu