I really hate to write political suff in my tech blog, This is the one and only blog that I was maintaining for my pure tech interests.

But today he owned it because what he have done.If I didn’t write this on my blog then it’s not fair thing. Because I felt this is too important and this is a big step [1000 steps] forward to a advanced civilization.

whatever he done today is going thousand steps forward to the direction where civilization getting advanced. So we should respect him and if we didn’t show respect then that means we not belongs to that advanced socieaty.

1. Thousands of Animal lives were saved.

2. The ppl who doing sin and who enjoying that inicident were saved from doing that sin.

3. The next generation and the whole chain of generations after that who will come there and do the same sin , are saved as well.

4. The new ppl who will follow this and become vicitims to this have been saved.

This is a big forward step to the direction that civilization going advanced. Good Luck and long live Mervin Silva sir, today you proved you owned that ‘sir’. I alologize I’m a person who never refer you with the word ‘sir’.Sir , now you are not a member of Avanced civilization , you are a leader for us and the civilization too.

when we store data in computer memory, there are basically two ways of storing them. Simply one way is store the big byte first or storing the small byte first.

The term “big-ending” or “little-ending” is comming from the Gulliver’s Travel Advanture movie,where the “liliputians” are divided into two camps , who start to ate the egg from little and and who start to ate the egg from the big end.

The same meaning is there on the computing world. In little ending, you first store the lowerst byte , and in the big ending you store the most significiant byte first. Computing world also politically discriminated into these two categories, discrimination is everywhere in the world where computing is not just exception to it.

To make this clear , let’t take a look at a example. Suppose you need to store 12345678H (hexadecimal) value in compuer memory. In C programming language you can simply write.

int i = 0x12345678;

If you took a logic probe and hack your computer memory and see , and if your computer is little ending you can find it like this. Please suppose that &i=0x0100h or address of i is situated at the memory location 0x0100h.

value 0x12345678h was stored in a little ending machine’s memory.

On the other hand if your machine is a big ending machine then you will see your memory like follows.

value 0x12345678h was stored in a big ending machine’s memory

And if you’r not touching assembly language/system programming or file types and I/O and you programming in a high level language like C/C++/Java probablly you don’t need to familar with the difference between little-big ends.

If you’r writing the network protocols or writing a device driver code for a networking interface then you should probablly know that all the networking communication is goes in big-ending representation. When you doing programming with sockets or higher level API you’ll met very rare cases you need to deal with this fact.

However if you want to deal with the file formats ,again this counts.For a example BMP,GIF and RTF are file formats that are examples for the “little ending” format. and JPEG is a example for “big ending”. Some file formats like AVI, WAV,TIFF supports both endings.

Here in this note I’m going to explain the first program that I published before.For the sake of convenient I’m going to list that program again here.

However before we go depth I need to explain what is Xlib. Well Xlib is a client library to the X-Server.Technically speaking like a JavaScript but not like PHP or JSP that which is runs on the server. What Xlib does is just preprocess the commands from application programs to the X Server and open a communication channel ,encode them using X protocol and send them to the server.X protocol can operate through TCP/IP where the remote machine is located at other side in the world or in the case of local machine it will use the interprocess communication mechanism.No matter what mechanism that it use it won’t violate the basic server client architecture of the windowing system.

So as I already told you Xlib is like JavaScript that is running on your web-browser not in the web server.But the difference is it’s not written with JavaScript,But with C. So it’s actually a C library.In the helder file /usr/include/ X11/ directory you can find the Xlib.h,which is the declares the main functions that you needed to talk with the X-server.By the way the gcc compilers main include path is /usr/include so therefore what we need is to add the following line in order to include the /usr/inlude/X11/Xlib.h.

#define <X11/Xlib.h>

So then we are going to write the program , below I have listed the program again.

Well you may be wonder why is this __gxx_personality_v0 ? I include that line here because some it will get a linking problem when linking with old “C” libraries.Actually it’s a patch.If you compile without this and obtains no error, then

study the source code bellow.Remember that every time that you draw again should need to load the identity matrix into the GL_MODELVIEW matrix stack.There are three matrix stacks that internally maintained by the OpenGL.the glRotatef() function will apply the rotation to the current matrix stack.But we didn’t use the glMatrixMode() to select appropriate matrix stack.So all the changes will be applied to the initial matrix stack which is GL_MODELVIEW.But as a practice try to check what matrix stack that we are going to apply some change to the current matrix mode.

The bug is marked in red.That line should be aligned with the rest of 5 lines too.
So everything in the program looks fine,and according to that imaginary something like this
cannot be happen.So where is the wrong.Can you guess?

Actually to pinpoint the error you need to lookup the preprocessor output.
This is how you should get the preprocessor output.and open it by notepad to view it.

The -E does simply said stop in the preprocessor stage.and this will output the output to the
standard output, using ‘>’ operator I just simply redirect that output to a file called preprocessed.cpp.

So let’s go and see what is the wrong at preprocessed.cpp file.Preprocessed.cpp file is around 2000
line of code.Because every opengl helder file context is there.Anyway I will show where the error
is located.

hi today I’m going to share my sourcecode with you how to draw a
circle using GL_LINE_LOOP.

This program simply does following.
1. define the PI constant
2. define number of steps that circle should be drawn.
3. divide 2*PI by number of steps and get the value of a one sector angle(angle).
4. within a for loop add another angle to the current angle(angle1).
5. Use the glVertex2d(sine(angle1),cos(angle1)
6. after the for loop come to the glEnd() and flush the buffers using glFlush().