BuGLe—OpenGL Debugging Wrapper

BuGLe is a tool for OpenGL debugging, implemented as a wrapper library that sits between your program and OpenGL. Although it's still in development, the Web site states that it already can do the following:

  • Dump a textual log of all GL calls made.
  • Take a screenshot or capture a video.
  • Call glGetError after each call to check for errors, and wrap glGetError so that this checking is transparent to your program.
  • Capture and display statistics (such as framerate).
  • Force a wireframe mode.
  • Recover a backtrace from segmentation faults inside the driver, even if the driver is compiled without symbols.

In addition, there is a debugger (gldb-gui) that lets you set breakpoints and examine backtraces. It also lets you examine OpenGL state, shaders, textures, buffers and so on, and drop into gdb to see what is going wrong.

BuGLe is a powerful wrapping tool that can perform certain actions with a program when specified OpenGL functions are called.

A debugger also can be used while a program is running alongside.

Installation

BuGLe is available only as source for the moment, so head to the Web site and grab the latest tarball. As for requirements, the Web site says you'll need the following:

  • GCC 3.2 or later (4.0 is broken, but 4.1 works).
  • FFmpeg is needed for video capture.
  • GNU readline is recommended for history editing in gldb.
  • GTK+ is required for gldb-gui.
  • GtkGLExt and GLEW are highly recommended for gldb-gui (without them, the texture display will not work).

I found I also had to grab libgtkglext1-dev as well as libreadline5-dev to access some of the features that are pretty mandatory. I couldn't get my system to recognize libavcodec, which may have caused me some problems later on.

As for compilation, the documentation says you just have to run make to begin with, but I found I had to run the configure script first, or else make would return an error. If I'm right, then you'll need to run these commands:

$ ./configure
$ make

If your distro uses sudo:

$ sudo make install

If your distro doesn't use sudo:

$ su
# make install

I'll quote the documentation directly for the next part:

Next, you need to install some files for the user that will run bugle. Create a directory $HOME/.bugle, and copy doc/examples/filters and doc/examples/statistics into it.

Usage

Okay, I have to level with you, I didn't get BuGLe to run the way I wanted it to (such as taking screenshots, video and so on). Maybe it was the configure script, maybe it was libavcodec not detecting, or perhaps I'm just dumb and missed something in the interface. I don't know. So why am I still highlighting this program? I see some great potential here, and what may be something very powerful in the future for anyone in the IT industry.

All I can really do is point you in BuGLe's direction and hope you have more luck than I did. I did get some functionality working, including some debugging, so I'll show you at least some basics that a puny mortal like myself managed to grasp.

To run BuGLe at the command line, use the following syntax:

$ LD_PRELOAD=libbugle.so your-program [plus any arguments]

To use the GUI version (much easier), use this syntax:

$ gldb-gui your-program [plus any arguments]

This last command starts BuGLe's GUI, but your program won't be running yet. Prior to running something, you can apply certain parameters, such as setting breakpoints on specified OpenGL functions. For information on this, check the Web site's documentation (although it seems to be geared more for other developers than users at this time of writing).

To actually run your program, it's as easy as clicking Run→Run. You can stop a program manually by clicking Run→Stop. The program can be continued with Run→Continue, or continued until the next OpenGL function call with Run→Step, and killed with Run→Kill. Also worth a look is the debugging console, under Run→Attach GDB, which has its own unique set of functions and commands.

And although I couldn't work out how to get these running myself, in the on-line documentation, I found the following instructions for using screenshot/video capture filter sets.

For straight screenshots:

filterset screenshot
{
    filename "screenshot.ppm"
    key_screenshot "C-A-S-S"
}

For captured video:

filterset screenshot C-V inactive
{
    video "yes"
    filename "video.avi"
    codec "mpeg4"
    bitrate "1000000"
    allframes "no"
}

I may not have had much luck with BuGLe's bigger functions, but this is software in its early stages. When this project matures, the coding and its resulting possibilities will no doubt be very powerful—whether you're a graphics developer testing the latest driver or just a journo like me looking to take a screenshot from within a program. And when that happens, someone probably will come along with a second GUI to use its functions in an alternative way, such as home users taking videos of whatever program they're running. Either way, the potential uses for this project are huge.

BuGLe—OpenGL Debugging Wrapper: www.opengl.org/sdk/tools/BuGLe

______________________

John Knight is the New Projects columnist for Linux Journal.

Comments

Comment viewing options

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

very goood shopping

lincc272's picture

The new season again come, no matter you are tide male, or beauties,
or ordinary people. Choose came in! Here are not only the fashionable
and popular men's clothing and women's dress.And with beautiful shoe
tide packets can photograph collocation. Make a new you begin from here!
Has a good news to tell everybody: Recently,every bought full 200 US dollars
in this company, then has the present to see off,Vietnam which buys delivers
are more, please do not miss this good opportunity!!!
welcome to ::[ w w w .b i z b o y s e l l .c o m ]
(b..r..a..n..d.)s.h.o.e.s.(34u.s.d),,

==J. a .m .e )) shoes

< j o r d a n> (1-24) shoes

< j o r d a n> 2010 shoes

c.l.o.t.h.i.n.g,,j.e.a.n,,h.a.n.d.b.a.g(35u.s.d),,

==c .o. a .c .h )) handbag

(f.r.e.e)s.h.i.p.p.i.n.g

[ w w w .b i z b o y s e l l . c o m ]

computer

Anonymous's picture

BuGLe—OpenGL Debugging Wrapper,a bit difficult to understand.
But also thank you!
Please give me a living space.
If you are at home when Doing the experiment computer broke down,I think I can help you.All kinds of famous brand of hardware for you to choose.
read more on Www.hpadapter.com
Www.udtek.com
hp lapyop battery

White Paper
Linux Management with Red Hat Satellite: Measuring Business Impact and ROI

Linux has become a key foundation for supporting today's rapidly growing IT environments. Linux is being used to deploy business applications and databases, trading on its reputation as a low-cost operating environment. For many IT organizations, Linux is a mainstay for deploying Web servers and has evolved from handling basic file, print, and utility workloads to running mission-critical applications and databases, physically, virtually, and in the cloud. As Linux grows in importance in terms of value to the business, managing Linux environments to high standards of service quality — availability, security, and performance — becomes an essential requirement for business success.

Learn More

Sponsored by Red Hat

White Paper
Private PaaS for the Agile Enterprise

If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.

Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.

Learn More

Sponsored by ActiveState