Only showing blog posts from the Computing category. Reset Filtering
Posted On Thursday 14 April 2011 by Tom Leese (TomMan)
Although GIMP 2.8 is not out yet, its Single-Window mode is available for testing!
I have been using GIMP 2.7 for some time now and I much prefer the GIMP Single-Window mode.
It is still a little bit buggy in some aspects, for example, if you open a new dockable window it does not appear within the single-window mode, but I cannot wait till GIMP 2.8 is released!
You can follow the development of GIMP here: GIMP Progress Tracking
For(;;) a While(true)
Posted On Saturday 26 February 2011 by Freddie Nash (FredFace)
Incase someone is wondering, for(;;) and while(true) compile identically in CPP and C#. C# is my forte, so I'll demonstrate the intermediate code produced (the same) for each. Consider the following C# Code:
Clearly, it represents two loops which will be broken out of when a variable (bool threadBreaker) is set to true (this is just give something to look at).
After moving each loop to a separate function and compiling (without optimizatins) the IL for the functions is identical, and thus:
.locals init ( bool CS$4$0000)
IL_0001: br.s IL_0013
IL_0004: ldsfld bool ConsoleTestGround.Program::threadBreaker
IL_000e: brtrue.s IL_0012
IL_0010: br.s IL_0017
IL_0015: br.s IL_0003
A quick skim will show up how very inefficiant this is - the need for a stored local variable alone is uncalled for, but it does show that the said variable is assigned the value true (IL_0013 onwards), but it is never compared to anything.
With oprtimizations, the code size is reduced dramatically, but oddly the maxstack is quadrupled in size. Both functions are again, identical:
IL_0000: ldsfld bool ConsoleTestGround.Program::threadBreaker
IL_0005: brfalse.s IL_0000
Well, nothing more to say...
Battle of the Programming Languages
Posted On Saturday 26 February 2011 by Tom Leese (TomMan)
I recently put together a series of tests to find out which is faster between: Python, Lua, and PHP.
The tests consisted of:
- Filling a list of 3000000 integers
- Adding these integers together
- A combination of division and multiplication
Here are the results:
As you can see, Lua is the fastest language, python is the next and PHP is the slowest.
I did all these tests on an Intel Atom processor under Arch Linux. With all the tests I had: Chromimum, Kate and XChat running (and KDE).
Python Code Â· PHP Code Â· Lua Code
Posted On Thursday 21 October 2010 by Freddie Nash (FredFace)
Yes, it does exist.
Planar is a fun platformer, where you run about and are vapourised regularly inorder to reach the next level.
Its heavily under development at the moment and the game can be downloaded here: Planar.zip
It uses some slightly hacky Line Collsion detection I wrote almost a year ago, and currently adopts Glut and OpenGL for the rendering. There is a GDI+ rendering 'option', but this sequence is no longer updated.
Planar uses Tao and FreeGlut, where before it employed the 'SimpleGLControl'. This change happened only today and so it all looks a bit haphazard (2 forms, one accepts input, one render).
If you like moding games, you might as well mod Planar, is could hardly be easier. Here are some reasons why:
- Nothing is compressed
- 'Animations' comprise of string referenced PNGs
- It has a nice set of commands (the docs for which I can't be bothered to update, just read the code if you need to find something)
- Runtime console helps debugging (levels etc.) and can result in excessive amounts of fun
- As implied, I provide the source
- I'll probably write a tutoruial for moding at some point
Posted On Wednesday 1 September 2010 by Freddie Nash (FredFace)
Hello! Its another pointless test of the .NET Framework!
I ran a quick test just now, to see which is faster (without csc optimizations):
- a + b;
I won't go into detail, and shall just give you my results.
The times in Milliseconds are:
a + b: 25
No suprises there, as String.Format does a lot more then the other 2 methods, but this does show how much slower it is. I never use it now :(
What is the best way of making games in C++ in Open Source toolkits?
Posted On Thursday 5 August 2010 by Tom Leese (TomMan)
In C++ there are many ways in which you could create games. Here are your options:
There are probably some more that I've missed but these are the toolkits I am most familiar with.
Firstly, we have SDL. SDL is designed to be used for making games from the beginning. SDL is very fast and very lightweight. Unfortunately, it is low-level so it can be a hard to start programming with SDL. In general, SDL is an excellent toolkit for writing games.
Next, OpenGL. This is the best option for people who want awesome looking and extremely fast 2D games, or excellent 3D Games. OpenGL can't be used on it's own, it has to be used with a library for managing windows, etc. From what I know you can use OpenGL with Qt, SDL, Windows Forms, GTK, and GLUT.
Next, Qt! Now, Qt is by far my favorite toolkit of them all. It is fast, easy to use and has amazing documentation. Unfortunately though, Qt is not the best toolkit for making games. It has a lot of useless technologies behind it when you write games in it which can make the games slow compared to SDL or OpenGL.
Finallly, GTK. I have not really used GTK must, but I used to use PyGTK loads because I prefered it to PyQt. From what I can see GTK is not really a very good toolkit for making games, but it is an excellent toolkit for making applications.
In conclusion, I have decided that if I were writing a game I would choose SDL + OpenGL because it is fastest and although it requires some learning it is an excellent solution for creating games.
Qt and its Awesomeness!
Posted On Thursday 29 July 2010 by Tom Leese (TomMan)
I would just like to say a few things about Qt and its awesomeness :p
Ok, so everything in Qt is based around the concept of events. This means that everything from the Window Manager wanting the window to be redrawn, to a mouse button being clicked, to the window being resized is done in events.
Here is some example code of drawing a circle in the middle of the window (200x200) when the window manager wants it.
void MainWindow::paintEvent(QPaintEvent *event)
QPen pen(Qt::blue, 2);
painter.drawEllipse(20, 20, 160, 160);