Archive for the ‘Development’ Category

OpenTK – C# and OpenGL made easy

Monday, September 8th, 2008

One of the major side projects we are working on requires the use of the real-time 3D graphics using OpenGL technology. Normally this type of project would be the preserve of the C++ developer. However C++ is renowned for its difficult and lengthy development time which was something we wished to avoid.

By using C# we hoped to be able to rapidly develop our 3D app whilst also giving us easy portability between Windows and Linux systems though the mono project.

The established major OpenGL binding for C# is the Tao Framework. This framework has been around for a number of years and includes a number of additional bindings. However it has several major problems; the first of which is the design of libraries API is non-intuitive and adds lot of unnecessary typing. The second and most important factor for me is its missing the ability to easily write text to the screen, something you think should be remarkably simple.

Of cource the arguement is that Tao is just a direct binding to the C libraries, this is where OpenTK steps in. It provides the low level OpenGL access you need as well as higher level helper functions for faster and easier development.

So how does OpenTK compare to the Tao Framework? Interestingly OpenTK is acctually based on the Tao Framework, so you get the same underlying code. The biggest difference to me has been the ease of writing code. OpenTK has much better type safety compared to Tao and the API is by far more logical. This makes writing the code a pleasure compare to Tao. The most useful aspect by far of OpenTk is its helper libraries, these save you from having to reinvent the wheel and include Vectors, Matrix and Quaternions as well as the all important printing text to the screen!

If you are considering working with OpenGL and C# I would highly recommend investigating OpenTK as one of your options.

Above is a little teaser from the project we are working on. If you do a little bit of research you should be able to track it down…

No Comments »Tags: ,
Posted in Development |

GetTickCount in Linux

Thursday, August 21st, 2008

Took me ages to find the EXACT equivalent but this seems to do the trick.

uint32_t GetTickCount(void)
{
tms tm;
return times(&tm)*10;
}

At least it did on my port of ddirserv from Windows to Linux.

No Comments »Tags: , , ,
Posted in Development |

Centos 5 and mpm-itk

Saturday, July 12th, 2008

EDIT: If you just want to get on and use mpm-itk on Centos 5 please check the comments as Sascha Schieferdecker has very kindly compiled some up to date binaries.

A long time ago someone got fed up with suexec suphp and other methods of preventing virtual hosting users messing each others accounts up. They realised that the real problem was not that there was a module missing from Apache to do it, but rather the design of Apache is such that its impossible to make it secure in a per user way. After reading Stuart Herbert discussion of the pros and cons of different solutions to this problem and his evaluation of mpm-itk i decided to look into it further.

On nice solution that has been developed is mpm-peruser but that seemed to spawn a great many processes and have performance issues so I took a look at the much simpler mpm-itk. Fortunately on Debian this module is already prepackaged, unfortunately CentOS does not have a rpm for it, nor could I find one by searching. The only option left was to patch the source httpd rpm myself.

(more…)

16 Comments »Tags: , ,
Posted in Development |