Writing tetris - part 3

May 19th, 2008

Most of a game mechanics are ready. It’s time for tuning visual part.
The playfield has been added and blocks have better texture now.
It is looking better and better :)

tetris - nice

Writing tetris - part 2

May 18th, 2008

Every game goes better during development…
So does mine :)

tetris - better

Notice, that a game can display MP3 tag which is currently playing - simple feature but looks nice.

Writing tetris - part 1

May 17th, 2008

Some time ago, I started writing simple casual game - tetris :) Idea of a game is nearly the same age as me, but I decided to create a 3D variation of it.
At the begining every game look like a crap, so does mine.

tetris - crap

Disaster :D

My workshop and some technical info:

  • Operating system - Linux, it also smoothly works on Windows :)
  • Programming language: C++
  • Libraries used: OpenGL, nVidia Cg, boost, SDL, GLee, FreeType, FmodEx, id3lib
  • IDE: Eclipse CDT and Vim
  • Other tools: Blender, GIMP

AirFramework - short video

January 8th, 2008

I would like to show you my simple, portable OpenGL framework in action. I work on it in my spare time. It’s nothing special but it is not developed to write a computer game. It mainly helps me learning how to create various 3D effects using shaders. I decided not to write an engine or something which is very trendy (I hate that word) - just a simple framework which is able to render models in my own format, render textures available in memory, change render states and write text. Also an interactive console which can change many internal options and print debug information.

Below there is a simple, diffuse lighting model computed per fragment.

Here are two screenshots presenting difference between vertex and fragment computations:

Interactive console and wireframed rendering:

Rendering text and textures from memory:

Sorry for the poor quality of the movie but it’s youtube only :D

No source code or binaries, I’m sorry. The code isn’t tested well and in fact shaders look lame (I created them in a hurry) - please, forgive me this time ;)

Practical use of mutable

January 3rd, 2008

I have finally found a practical use of mutable keyword in C++ :D

Suppose we have a class and we want to do some "lazy loading":

C++:
class Foo
{
    private:
        Bar *bar;
    public:
        const Bar& GetBar() const;
};

const Bar& Foo::GetBar() const
{
    // lazy loading
    if(bar == NULL)
    {
        bar = new Bar();
    }
}

Everything would be fine but the const keyword does not allow us to change a value of a bar pointer.
That's the place where mutable is useful :)

C++:
class Foo
{
    private:
        mutable Bar *bar;
    public:
        const Bar& GetBar() const;
};

const Bar& Foo::GetBar() const
{
    // lazy loading
    if(bar == NULL)
    {
        bar = new Bar();
    }
}

Happy coding :)

Designed by SirMike © All rights reserved

Valid XHTML 1.0! Valid CSS!