May 16, 2015

Useful GIT commands

Install GIT on your PC.
First thing you need to do is customize git environment.

$ git config --global "Dasun"
$ git config --global
Now it is the time for your first commit...
Create a file called main.cpp. On the same directory do basic commands using Git bash.
$ git status
$ git add main.cpp
$ git commit -m "First commit"
Now I modify main.cpp content and do a commit over same branch. Still this is master.
$ git status
$ git add main.cpp
$ git commit -m "changed in main.cpp"

Now we need to do certain changes in main.cpp but we are not sure about these changes. Hence I create different branch and do my testing there.
$ git branch dev
$ git checkout dev

Suppose, I do several commits on this branch. Now I am confident that my testing was fine. Hence I need to merge these changes with original and I did my change liner. This is what we called fast forwarding. 

Now we need to do certain changes in main.cpp but we are not sure about these changes. Hence I create differen

May 15, 2015

Lat's Play with OpenGL - 1

OpenGL Introduction

OpenGL is graphic library for cross platform 3D graphics. This is same as Direct3D in directx library. There are many tutorials and example videos to learn OpenGL. In this post I am trying to make a short note to cover up most import points, I have learnt. 


Glut is tool for creating windows and handling inputs. Use FreeGlut pre build libs for your projects. 


This is openGL extension manager and lat us easily call openGL extensions without having declare DLL entry points.

May 10, 2015

Problem with Visual Studio Immediate Exit ?


I have faced this problem many times. Specially in visual C++ programming.
Here, few things we can to avoid this issue.

  1. Simple, cool way is press CTRL + F5. This is also known Debug-> Start without debugging.
  2. Add  system("pause"); at the end of your code.
  3. This is also mentioned in many places over the web. Somehow I tested this on my Visual C++ console application and it wasn't work for me. I am leaving this to you for trying out...            
properties -> configuration proprieties -> linker -> system
select CONSOLE(/SUBSYSTEM:CONSOLE) in subsystem option.

Also I have seen added logically correct coding tips end of the code. But according to me those looks like unprofessional !

while(1) { }
for(;;) ;