JibberJabber

Through this be madness...”

Native Mac OS X and iPhone back-ends for SDL_image

sdl_logoThis holiday break was much like revisiting my roots. I did OpenGL, OpenAL, and now SDL.

I finally got around to finishing one of the zillion things in my queue. With SDL getting closer to its 1.3 release, I felt compelled to get this one done. I have implemented and submitted a new native Mac OS X and also iPhone backend for SDL_image.

SDL_image currently depends on libgif, libjpeg, libpng, and libtiff to load these formats. For the official Mac OS X framework distribution, we have been statically linking these libraries into the framework. This has been a pain to build and maintain, particularly since none of these libraries have Universal Binary friendly build systems.

This submission utilizes native OS X frameworks to load the images…

Defective Core Audio (Mac OS X) ALC_ENUMERATION_EXT implementation / My fixed implementation and letter to the community

openal_c_png

(The following is an open letter I posted to the OpenAL community asking for support to convince Apple this problem is indeed a bug in their implementation and to accept my patch.)



The Bug:

There is a bug in the current Mac OS X implementation concerning the ALC_ENUMERATION_EXT.

The current implementation fails to do two things:

1) It fails to return a list of devices as intended by the ALC_ENUMERATION_EXT, even though the implementation claims to support the extension.

2) It fails to support opening of specific devices that would be named in this list.


As my Xmas gift to the community, I have implemented these deficiencies and made my changes publicly available. My wish is that these will be included into the main Mac OS X distribution as I…

OpenGL Vertex Buffer Objects (VBOs): A Simple Tutorial

OpenGLVBOCubeSmallRecently, I have been getting a lot of similar questions about how to draw geometry in OpenGL without the use of glBegin()/glEnd(). This is mostly due to the interest in iPhone development which uses OpenGL ES 1.1, though I have received a few desktop performance questions as well. Since I've gotten multiple questions, I thought I would post a very simple tutorial for VBOs.

When most people first learn OpenGL, they are taught using glBegin() and glEnd(). But to shock of many people, these functions have been excluded from OpenGL ES, and there is pressure to remove these functions from future versions of OpenGL proper. The two main reasons for removing these functions are performance and simplicity.

In performance, the glBegin()/glEnd()…

Balanced Fund Update & Market Thoughts

Balanced Funds YTD (Oct 8, 2008) against Total Stock Market Index & Total International Stock Index


This is a follow up to the article I wrote on Aggressive Savings Techniques using Balanced Funds (for intermediate term). I am not going to do a quantitative analysis right now. I want to wait for the year to end to see where things end up.

But yikes! When I wrote the article, I didn't believe we would enter into the worst economic crisis since the Great Depression. (Don't interpret that line as this crisis is just as bad as the Great Depression. Some people I've talked to make that allusion when they hear this and that is plain wrong. While the current crisis is very bad, it is nowhere as bad as the Great Depression. Perhaps the phrase, 'Only the Great Depression has been worse in the past 80 years' would be more clear.)

So here are…

QuickTime 7.5 Core Animation Improvements

QTMovieReflectionQCSnapShotLarge


Every time a new Apple software update comes out, people always wonder what's really changed. Apple's release notes are usually not very detailed. QuickTime 7.5 which was released the week of WWDC 2008 happened to be a fairly significant update in terms of bug fixes and enhancements.

I was trying to implement a "reflection" of a movie layer using QTKit and Core Animation. I wanted a single movie source and either two movie layers to share the the source, or a way to capture the current displayed image of one layer and transfer it to another. It turns out neither was possible prior to QuickTime 7.5. (You might be able to use to Core Video and OpenGL, but the QuickTime/Core Video API interface still hasn't been updated to support 64-bit…

Mercurial Forests: A Real World Example (LuaDoc with CMake)

logo-droplets-50_textmedium170px-cmake_logo_textmediumlang-128_textmedium


In my last entry, we created a Git Superproject for LuaDoc and its dependencies. For comparison, let's repeat the example using the Mercurial Forest Extension.

Because the Forest is still an unofficial extension, you may need to configure/install things for your Mercurial installation. My example below assumes you have a working Forest extension installed. The following link contains instructions and a tutorial I based this example on.

http://www.selenic.com/mercurial/wiki/index.cgi/ForestExtension


The first step is to create the regular individual Mercurial repositories for each subproject. They can be found here:


Mercurial Repositories


Lua:


http://www.assembla.com/spaces/lua/trac_mercurial_tool








Git Superproject and Submodules: A Real World Example (LuaDoc with CMake)

git-logo_textmedium170px-cmake_logo_textmediumlang-128_textmedium


In my previous entry on Git Superprojects and Mercurial Forests, I didn't have any examples. I meant to do that, but didn't finish that. Having a horrible memory for these things, I regret that very much because it meant I didn't have a good reference to go back to.

Not wanting to repeat that mistake again, I have implemented a Git Superproject and Submodules for a real world project that I needed to get fixed. Furthermore, the project is relatively lightweight and potentially cross-platform, so I have designed the example so you can participate too by accessing a public repository.

The project is LuaDoc. It is a documentation generator that is similar to Doxygen, except that it is designed explicitly for Lua. (Doxygen currently lacks Lua…

LuaObjCBridge & LuaCore Updates

IinTextMediumImage've been working with the LuaObjCBridge (by Tom McClean) and LuaCore (by Gus Mueller). I've encountered some bugs, limitations, and things that needed improvement. As I'm already forgetting what changes I've made, I decided I better document them and push them back out for the public to test and improve. Because my changes may potentially break compatibility (not necessarily a bad thing though because some things just didn't work correctly in the original code base), I've pushed my changes into a separate repository.

Meanwhile, I've been using a lot of these changes to test ideas for the next generation LuaObjCBridge which will use BridgeSupport and likely libffi. If you are interested in contributing, please don't hesitate to contact me.


Somebody Found My Blog! (Update: Zeroconf Printer Advertising)

42px-Avahi-logo.svgIf anybody has been tracking my blog prior to this point, I apologize. I did not expect anybody to find it. (Google is too efficient at crawling.) Prior to this point, this blog was an experimental test for me and I wasn't yet announcing it publicly.

You might notice that there were a bunch of articles with dates starting from January pushed just today. That's because I started writing those articles back then, but had not finished writing/editing/revising them until today. I figured it was no big deal since nobody has seen my blog. Oops.

Today, I discovered that somebody has indeed been reading my blog (outside my private circle) because somebody left a comment, and a great one too! (More on that in a moment.)

I checked Google Analytics,…

Contacting Southwest Airlines

imageSouthwest Airlines has a little application called Ding! which offers special limited time (hours) fares. I have relatives that love this program. But, maybe predictably, this blog entry has nothing to do with the concept of the application itself.

It turns out that the application has an annoying bug where the programmers left in code that prints debugging statements (via NSLog?) to the system log on Mac OS X (Leopard).

The big problem is that the application prints a huge number of messages. Coupled with the fact that users run this application non-stop to get the most benefit from it, this floods the system log and forces quicker log rotation, removing the chances to find important events in the system log.

While dealing with Apple on…

An Aggressive Intermediate Term Savings Strategy (Analysis on Balanced Funds)

140px-Assorted_United_States_coinsIn honor of the upcoming Tax Day, I'm going to gripe. The tax code is unfair and broken. (There, I did it. I don't feel any better.) While there are volumes of reasons to complain (literally), I'm going to focus in on a specific aspect: savings.

A case in point of the unfairness is savings (plain old, non-retirement accounts). The tax code is structured so there is a huge disincentive to save money, particularly for the short term or intermediate term.

You might be trying to save money for an emergency fund, save for a big purchase item such as a car or house, save for a big event such as a wedding, or just trying to plan for the future. But if you try saving for these types of things and your time span is less than the long term (say…

Git Superprojects & Mercurial Forests

git-logologo-droplets-50I know most of the world is still trying to grok distributed SCM while it is something that I have simply come to expect. I probably should write up something about Git and Mercurial to help bridge the gap between my mindset and where most people probably (currently) are, as this writing will show my complete acceptance of the distributed model. But that article will have to wait as I am actually trying to grok how to use these tools in more advanced ways.

So today, I've decided I need to string together separate, generally unrelated projects as dependencies of a project I'm working on. As an example of what I'm talking about, I have a project that depends on the Sparkle Update Framework for Mac OS X and also Lua. It would be nice to…

Sandvox vs iWeb 2

sandvox_bucketSo anybody who knows anything about iWeb 2 probably realizes that this template I'm currently using doesn't exist in iWeb. I'm now trying Sandvox by Karelia instead.

Sandvox is a web site building tool much like iWeb. In fact, it actually launched a little before iWeb was announced so the folks at Karelia had the misfortune of seeing their innovative product suddenly have a direct competitor from Apple almost overnight. Apparently this type of bad luck has happened to them before with a search product called Watson in which Apple soon introduced Sherlock.

Like iWeb, it uses prebuilt templates to do things, and you basically just substitute your own content. From my naive viewpoint, both programs look very similar from a feature set…

Upgrading to Debian Etch

openlogo-100Well, it's official. It's time to upgrade my Debian box.

My Debian Sarge box has been relatively untouched doing a few specific duties and has fallen into a dilapidated state. The last time I did a security update that involved a kernel update, I got into trouble because I was using the proprietary Nvidia driver for X and I was unable to get it working again with the kernel update so I ended up living dangerously and used the older kernel.

Things have been working fine for awhile, but recently, I've noticed the network completely crashes on the box and requires a reboot to get it back. I've never seen anything like it. I finally discovered that the crashes seemed correlated to me starting iChat on Leopard on a different machine on the…

CMake Lua

170px-cmake_logo_textmediumlang-128_textmedium

For anybody who accidentally stumbles on this, we're trying to organize a continuation of a CMake/Lua experiment. Dr. Ken Martin of Kitware recently decided to try embedding

Lua in CMake.

For those who don't know, CMake is a 'build system generator' or

'meta-build system'. You provide a build description in a simple script like language and CMake generates a (native) project that you request. Among the project types CMake can generate are Visual Studio, GNU Makefiles, Xcode, KDevelop, and more. This allows developers to have one single unified build description, but yet allow people to use their favorite IDEs and build systems. For anybody who is serious about cross-platform development, CMake is a must-look-at.

While CMake's build…

Quick Thoughts and Benchmarks on Moving to Gigabit Ethernet

Netgear GS108 8-port gigabit switchSo gigabit ethernet is finally ubiquitous enough that I (unintentionally) have two machines that both have it. My existing ethernet switch still works, but don't have enough ports on it so I sometimes end up having to unplug stuff and switch cables which is inconvenient.

I've been hesitant to invest in a new switch. My existing switch which is a 10/100 Netgear blue box switch originally gave me problems. About a year after my original purchase, the switch started malfunctioning and then stopped working. It was still under warranty, so Netgear replaced it, but I remember they were very slow about it (3 weeks?). Meanwhile, I was without a switch and ended up buying a temporary switch (a Linksys) to hold me over while waiting for Netgear to…

WaveInterference (OpenGL Shaders at CocoaHeads)

cocoaheads_textmedium

RainbowWave (WaveInterference)So as I try to think of things to fill in my blog, this is one of the significant ones because this is one of the reasons behind me leaving my anonymity behind.

At CocoaHeads in Silicon Valley some number of months ago, I gave a short demo on using OpenGL shaders to offload processing onto the graphics card. This had been prompted a month earlier by a student who gave a presentation on a Wave Interference program he made for science class. I noticed that the performance suggested it was using fixed pipeline drawing on the video card to render the Wave Interference patterns. I suggested at the time that shaders may make the thing stupidly fast (at the cost of complexity).

Anyway, just to prove to myself that I wasn't full of it, I decided…

Making Comments and Trackbacks harder than they should be

I’ve been investigating how to add commenting support to this blog. The easy way would be to sign up for .Mac (since I’m using iWeb at the moment). But I have a very hard time parting with money. Some features of .Mac I already have available to me, and some others I don’t care about, which means the cost per-feature list of remaining features that are useful to me seem pretty steep with the $100/yr price tag of .Mac.

Enough people on the discussion forums at Apple seem to share the same sentiment, and have posted several alternatives. The most popular solution is HaloScan, which seems to be an online service that allows you to embed Javascript that points to their systems so people can add comments to their web site. They also support…

On Time Machine Errors and Data Integrity...

timemachine_icon20071016

Today I got my first serious error with Time Machine. An automated hourly backup was running when all of a sudden an alert panel popped up saying there was some error and Time Machine failed to backup. (Not very helpful.)


I immediately tried to run a manual backup, and the same error occurred. So I checked the system logs and found some nonsense like:

/System/Library/CoreServices/backupd[457]: Error: (-50) Creating directory
/System/Library/CoreServices/backupd[457]: Failed to make snapshot.
/System/Library/CoreServices/backupd[457]: Backup failed with error: 2

So I opened up Disk Utility, and I thought I would try running a Verify Disk/Repair Disk and maybe a Repair Permissions just in case.

Well, Repair Disk was unable to run…

Advertising a legacy network printer with Bonjour (with a little help from launchd)

logo_bonjour



Rendezvous is truly revolutionary. It's one of the things that is going to have the largest impact on application design over the next couple of years. All the UIs, and all the security models, are going to have to be rethought once all applications are rendezvous-enabled. And that is going to happen.... We're just at the beginning of the second internet revolution, and Rendezvous is a big part of it.     -- Tim O’Reilly, May. 2003




One of my favorite technologies from Apple is Bonjour/Zeroconf. Bonjour (formerly Rendezvous) for those who don’t know is Apple’s implementation of Zeroconf. Zeroconf is a technology developed at Apple (being pushed as an open standard) that in layman terms brings plug & play or “zero configuration” to IP…
Copyright © Eric Wing