Posts

Showing posts from June, 2012

Simple Multitouch on Windows

Image
Quickliy coded a dll ( packaged as a Game Maker extension here , but can be used with any HWND) that gives a simple interface to multi touch handling on Windows. All source files included.

NVIDIA GPU-accelerated Path / SVG Vector Graphics Rendering

Image
This definitely needs attention: (video with link without slides: http://www.youtube.com/watch?v=bCrohG6PJQE ) Try viewing for example this svg image in your browser - it'll definately kill it. This particular image renders at 35 FPS on my GPU (GTX 260) in NVIDIAs svg viewer which uses their quite new (June 2011) GL_NV_path_rendering OpenGL extension. Remarkable. The GPU implementation doesn't implement the filters - blurring in this example - (neither does IE). I'll try to add these, I don't think they'll slow it down too much. Read more at http://developer.nvidia.com/nv-path-rendering Note: Many browsers claim to have GPU accelerated rendering, but this mostly only applies to the final composition of different elements (though some do have GPU text rendering). Edit: After looking at the specification and some samples , I see that this is actually pretty complex: You can define various intermediate targets and in and outputs for filters. The easiest w...

Some Java Bit Functions and easy syntax hightlighting of various languages in html

Use  http://tohtml.com/  and  http://bedaux.net/cpp2html/  for easy syntax highlighting in your blogger posts. (I tried this  with that  but it doesn't seem to work). Now the Java stuff (easily portable to C, C++ and many other languages): // Returs bit a to b (> a). lsb is bit 0, msb is 63, is returned as String in normal order (msb first) public static String getBits(long n, int a, int b) { String bs = "" ; for ( int i = a ; i < = b ; i + + ) bs = ( 1 & ( n > > i ) ) + bs ; return bs ; } // Calculates floored log2 by finding position of highest set bit. // Ignores very highest bit of long (63rd). public static int log2(long n) { long m = 1 L < < 62 ; int i = 62 ; while ( ( n & m ) = = 0 & & i > 0 ) { m = m > > 1 ; i - - ; } return i ; } /**    ...