Rosario 3D

My developer blog

Monthly Archives: February 2010

Glus for linux

Recently Norbert Nopper have released GLUS, a framework similar to (free)Glut. The first version was only for windows, but recently Pablo Alonso-Villaverde Roza wrote a version that work with X11.

I have tested this evening on Ubuntu 9.10 with a G8800 and it works perfectly.

How to build the code

GLUS use Glew to load all the openGL extension, the Glus packet that you download from the site already include Glew. But if you have Glew already installed it can generate some conflict. The Glew library that came with Ubuntu is not the most recently updated and support openGL up to 3.0. So you can remove Glew and use the one that came with Glus or download the latest Glew source and build it by yourself (it take 5 min.)

svn co https://glew.svn.sourceforge.net/svnroot/glew/trunk/glew glew
cd glew
#Probably you will need these package
sudo apt-get install libxmu-dev xorg-dev
make extensions
sudo make install

Now you can go in you Glus directory and type

make all

Now you can run the examples, make sure you have the latest driver installed.

About Glus

I’m not a big fan of Glut, it imposes a programming style that leads to a tons of global variables (I’ll write an article about that)  but is very simple and for a rough test is very good. Glus use the same program style but removing all the deprecated stuff and add some utility function to:

  • create openGL 3.2 context
  • read and create shaders from files
  • operate on matrix and vector
  • load TGA texture
  • create some basic shapes (cubes, sphere, plane)

Pro:

  • Very easy to learn, if you already had programmed with glut you don’t have to learn anything new.
  • First framework that support openGL 3.2 natively.

Cons:

  • Very young, no documentation yet.
  • It’s not object oriented
  • No support for multi-threading
  • No license… MIT? ZLIB? Need to ask.

I still don’t know why people in 2010 don’t program with object, but I think it’s a matter of taste. The lack of documentation is fullfilled by some example. I’m a bit worried about the license I hope it will adopt LGPL3.

Conclusion

IMHO Glus is very good to create some basic example, with the utility function you don’t have to bother about texture loading or shader creation, making prototyping faster. I don’t know if it’s good to create more complex program. In this case you usually create your own code for matrix, image and shader manipulation, also it lack of multi-thread support that really limit the possibilities.

Another developement blog?

When you create something new you always must ask yourself “We really need that stuff? Is original? Why I can’t use $otherProduct instead?”

We really need another blog?

Well I think that the world can survive even without my effort but that will be less funny for me, and maybe someone can find this blog useful.

Is original?

No, there is a tons of developer blogs that speak about every part of programming, and a lot of them are much more expert than me. But sometime I found some hole in the Web knowledge, in that case I try to fill that hole. This blog is my 2 cent on computer graphics, I won’t try to be the new openGL guru that know everything about graphics, but just a place when I can share and discuss about my project and my ideas.

Why I can’t follow other blogs/web pages?

Yes you can.. no you must!! I’ll give reference when I extract some part of article from another site. Internet is for collaboration 😉

I only hope that if somebody use my stuff will give me a reference.

What will you talking about in this blog? And why in English?

About the development of my project hosted in my site, some basic tutorial and news about programming, graphics and maybe maths.

I choose English cause almost every programmer (can|should) read English even Italian one. Is also a good exercise for me.

What will you not talking about?

Obsolete stuff. The main reason I open this blog is cause on the Web you can find a lot of tutorial about openGL 1972 and very few tutorial about openGL 3.x. OpenGL will not evolve if users keep using the obsolete stuff.

Can I comment your post?

Yes, but I have to approve your comment before it’s show. Don’t worry I’ll approve every comment that don’t look like spam and is somewhat in topic.

Why you create your site in you living room server? Is full of free host out there.

Cause I’m a nerd… ehm… cause I already have a SVN server for my project, and I don’t want to use another server for the blog in this way I can install any plug-in I find useful.

Sometime you can find the server off-line (cause ADSL problem, power supply problem or hardware failure). Don’t panic!!

Twitter connection active

Here a new post, this one should be visible on twitter… facebook and linkeding.

I still have problem with wp-syntax stylesheet. 😦

Hello world!

//
One two three test, this is my new blog hosted in my living room.

I’ll basically post some code, news and idea about programming and openGL

Test for wp-syntax

template<typename T, unsigned int Size>
void identity(T* matrix)
{
  for(unsigned int i = 0; i < Size; i++)
    for(unigned int j = 0; j < Size; j++)
      matrix[i+j*size] = (i==j)?T(1):T(0);
}

The post are also connected with twitter, so you can follow my activity without problem (and I can follow you).

Test Latex for wordpress:
delim{[}{matrix{3}{3}{1 2 3 4 5 6 7 8 9}}{]}
S(f)(t)=a_{0}+sum{n=1}{+infty}{a_{n} cos(n omega t)+b_{n} sin(n omega t)}

If you see a green rectangle wegGL is working. Otherwise read this.
[wgl id=’wglcontex’ width=500]