Building GTK on Win32

hacking Comments Off

So I sat down and invested some time into building GTK 2.10 on Windows today, with help from Tor. I think Tor usually builds it on Windows using MSYS or Cygwin or something, but I managed to cross-compile from Linux and it seemed to sort of work.

There isn’t really any good and up-to-date documentation online for how to build GTK on Win32, so I made a log of every step of my process so that this can (hopefully) be reproduced by others. We’re never going to get any of the Win32-related bugs fixed if nobody can build it. :) So my next step is to start over from scratch in a different target directory and turn my log into something more concise (there are a lot of trial and error steps in my log where something didn’t work and I had to go back and try something else). And there are a few steps where I had to hack configure scripts directly, and I’d like to be able to figure out real solutions to those steps.


hacking Comments Off

I’ve been getting back into Gnome related technologies recently, for variousreasons. I started looking into Gnome’s accessibility project, like ATK and atk-spi. It’s pretty cool, I think. I had long ago started to work on a speech recognition interface for Gnome using CMU Sphinx and a Bonobo interface. It never got further than occasionally being able to recognize when I say “hello” and display a popup “Hello, world!” dialog. But it was cool.

GPU hacking

hacking Comments Off

Also, as I mentioned before, I was doing some GObjectification stuff for Øyvind Kolås on Horizon, and I think I mentioned my GPGPU framework that I started. I didn’t put too much time into that before because I was preparing for auditions mostly, but since the Dallas Symphony audition is over (and I didn’t win!) I have more hacking time. I am planning to take the Kansas City Symphony audition, but I don’t feel stressed about that in the way I did for the last three auditions. I think the Dallas audition really helped me chill out with audition preparation.

So I am inspired to get back to work on the GPU framework. I’m making a lot of changes in the design, although none of them are really all that major in how the framework will be used. Mostly this is abstraction stuff so that different backends could be plugged in (e.g., I’m working on a default OpenGL backend.. but you might make an OpenGL|ES backend, or even a DirectX backend if you were so inclined).

Since Øyvind is getting so far with the new canvas model for GEGL and is getting ready to work on integrating with BABL, I feel like I need to step up my work on this now and get at least some basic unit tests running. Hopefully I’ll have something ready to upload into the Subversion repo soon (Gnome is about to migrate from CVS to svn, and should be finished with that migration by the time this is ready to upload).

Gtk# in Windows

hacking Comments Off

I’m hacking on my Gtk# app in Windows right now, because Visual Studio is amazing. I
couldn’t seem to get pixbufs to load from relative paths, because I couldn’t figure out what the present working directory is on anything in Windows, so I started fooling with the resource manager.

This is a very cool thing. You can put strings or images or whatever you want in there, then access it from your app as Properties.Resources.Foo. Very nice.

However, if you’re using images then they’re obviously stored as a System.Drawing.Bitmap, and Gtk# wants to deal with things as a Gdk.Pixbuf. So here’s a quick snippet of code to deal with that:

using System;
using System.Drawing;
using System.Drawing.Imaging;

public Gdk.Pixbuf CreateFromResource( Bitmap bitmap ) {
BitmapData data = bitmap.LockBits( new Rectangle( 0, 0,
bitmap.Width, bitmap.Height,
PixelFormat.Format24bppRgb );
IntPtr scan = data.Scan0;
int size = bitmap.Width * bitmap.Height * 3;
byte[] bdata = new byte[ size ];

Gdk.Pixbuf pixbuf = null;

byte* p = (byte*)scan;
for( int i = 0; i


hacking Comments Off

So I started testing out Monodevelop for hacking on my resurrected Ludwig van. It’s pretty nice, I think. Obviously it’s pretty far from Visual Studio, but it’s not bad. The big new thing in the latest release is the integration of stetic, the user interface builder.

Maybe I’m retarded, but I just can’t ever seem to save time by using these UI builders. Glade was okay, but so far I can’t figure out how to use stetic in any remotely useful way. In this respect, I don’t feel that Visual Studio is much further along because its UI builder is pretty useless too. But as I said, maybe I’m just retarded.


hacking Comments Off

I started developing support for COLLADA in neoengine, in the form of a converter. Mattias convinced me that it’s probably pointless and
unwise to bother trying to make runtime support for it.

I’m taking the route of using Sony’s COLLADA DOM library for now, at least as a starting point. I dislike the design of it, but it’s the fastest way to get support.

One of the biggest motivations for this was knowing that NVIDIA’s upcoming tool, FX Composer 2, is going to support COLLADA documents. This will hopefully give us a very excellent material editor, at least for Windows platforms. Depending on how they design it, it would be awesome if we can get it to run on Linux. This may be possible via Mono because FX Composer 2 is being rewritten in C#. It very likely may still be impossible, depending on what external libraries they P/Invoke to. Then there is also the other obvious issue that we don’t have Managed DirectX on other


hacking Comments Off

I’m trying to help Øyvind Kolås out a little bit with Horizon, the little drawing app he’s writing for the Nokia 770. I’m beginning by converting the code over to be based upon GObject right now.

The canvas tiling architecture might lay a foundation for future work in gegl, which is the main reason I’m interested in this. I have some a big interest in doing some work on gegl, but it needs a lot of foundation work done on it before I can really begin working on the stuff I want to do. First it needs a new imaging framework, which will involve integrating babl into it for pixel format/image space conversion, and integrating whatever new image tiling stuff is made into it.

Ludwig van

hacking Comments Off

I’ve been hanging out at my mom’s house in Texas during winter break, and I took some time to do some hacking on Ludwig van. I ditched the C source code entirely and have been rewriting it using C#. The beginnings of the music notation layout engine are working horizontally, but it’s not doing any line-wrapping yet. There are still a lot of issues in the layout engine, but it’s coming along. I have a lot of work to do on the glyphs, and that’s going to consume an enormous amount of time. The glyph rendering itself is working flawlessly, and without a doubt the quality of the on-screen glyph rendering is much, much better than either Finale or Sibelius
already (thanks to Cairo, of course).

I’m probably going to stop programming on it again for awhile, because I have a lot of stuff that needs some intense practice. I have to finish learning the rest of Bartok concerto next semester, and that’s a bitch. But when I get Ludwig van further along, I’ll start making more posts about it and show off some nice screenshots.

Nokia 770

hacking Comments Off

A few days ago I finally received my 770 from Nokia. This thing is
absolutely fantastic! I haven’t had much time to play with it yet
because I have been playing with the orchestra in Sarasota this week,
and unfortunately have been driving back and forth almost every day.
The screen on this thing is fantastic, and I had no trouble getting
online using the 802.11bg adapter. Next stop: handheld Ludwig van!


hacking Comments Off

A few days ago I started working on a new GObject-based framework for doing general stuff on the GPU. It’s in the very early stages so far, and basically allows render-to-texture and readback of the textures. It’s not very portable yet, in a couple different ways. Right now the test programs require X11, and won’t work on Windows or Mac. That’s pretty minor, is easily fixed, and doesn’t really matter that much anyway. It’s also not very portable between different types of video cards yet, since it depends upon FBOs (and makes use of PBOs if they’re available). And while I was at it, I don’t check for support of rectangular, non-power-of-two textures since any video card that does FBOs and PBOs will also support that. So, basically this code will currently only run on NVIDIA cards.

I’m just now about to start working on the shader support. There are two possible approaches here. The first is to find the best existing shader and use it. The second approach is to have some general data structure describing the shader, select a shader target, and generate the source for it (GLSL, HLSL, ARBvp/ARBfp assemblies, etc) at runtime. This is sort of
what libsh does, although since it’s a C++ template metaprogramming library it generates the source at compile time. The obvious advantage of this approach is that you jump through a few extra hoops to write your shader, and it gets generated into any target you want and you don’t have to write it multiple times. The obvious disadvantage is just that it’s hard to implement, and that it conceivably doesn’t generate the highest-performing shader code. For my purposes, I don’t necessarily need the highest-performing shader code so this isn’t a problem. However, I also don’t care that strongly about the multiple targets. I’d be willing to write one shader a couple times to support different GPUs if necessary (e.g., one shader for SM3.0 and one for everything else). Also, I’d rather go with the easier-to-implement approach so I can have something working sooner rather than later.

This is my first step to World Domination!

« Previous Entries Next Entries »