The foie gras parable

I loved this talk from Blue Hill’s Chef Dan Barber.

I’m not convinced that what the organic/ethical/slow food movement advocates is the most sustainable way of producing food and feed the world. For example, I’m not necessarily opposed to the use of technology to produce food, as long as it’s done responsibly. It’s the use of technology by profit driven food corporations what I’m concerned about.

Anyway, the talk made me feel saudades. I have this fantasy that one day I’d go back to Spain, buy a small farm, and live in a rural home raising pigs, hens, and sheeps. I’d then spend the rest of my days working in the farm, cooking, hiking in the area, and coding in my spare time.

nvidia-widgets

I just published the immediate mode user interface (IMGUI) toolkit that we are using in our latest OpenGL SDK examples.

The purpose of the SDK examples is to show how to implement certain techniques using OpenGL. We did not want to spend too much time writing UI code, and we did not want the UI code to end up occupying more space than the code dedicated to the technique we are trying to showcase. IMGUI allowed us to accomplish these goals in an elegant way.

Here’s a simple example with two widgets:

ui.begin();
ui.beginGroup(nv::GroupFlags_GrowDownFromLeft);

static bool showButton = false;
ui.doCheckButton(none, "Show exit button", &showButton);

if (showButton) {
    if (ui.doButton(none, "Quit")) exit(0);
}

ui.endGroup();
ui.end();

And this is what the result looks like:

[missing image]

One of the nice things is that, since the UI is being rendered in immediate mode, it’s very easy to create/modify widgets dynamically. For example, this is what happens when the check box is activated:

[missing image]

You can get the whole source code at the nvidia-widgets google project, and feel free to drop by the Molly Rocket IMGUI forums to share your feedback!

Moving

My better half has been accepted to UC Davis, and we’ll be moving there in the next few days. We are pretty excited; I think Davis will be a better place to raise our son. It’s also closer to the Sierra, so I’ll have the chance to spend more time in the backcountry.