Wednesday, December 11, 2013

Basic .Net Socket Class Implementation in C#


The .Net Framework provides a Socket class which has the all properties of TcpClient , TcpListener and UdpClient and plus its own methods. For details of .Net Socket class you can see here. In my previous articles I have shown you the basic implementation of TcpClient, TcpListener and UdpClient class. Here we are going to use the Socket class. Many things are same as previous articles so I like to discuss only Socket class implementation and ignore other things

Downloading the source code

Download complete source code from below:

Basic UDP socket echo client server program in C#


This program is same as previous chapter TCP Echo client server only difference is implementation of UDP socket. This chapter highlight the difference between TCP and UDP connection. TCP is analogous to telephone communication but UDP is analogous to mail box communication. TCP socket is required to establish a connection before data transfer where as UDP does not required to establish a connection before communication but we have to specify the destination address for each one i.e message called a datagram carries its own address information and is independent of all others. Message send through UDP can lost but in TCP doesn't. Data transfer rate is faster in UDP connection rather than TCP connection. So, UDP socket is used in such area where higher Data transfer rate is important rather than accurate data transfer for example live video telecast.

Download Source code

You can download the complete source code below:

Basic TCP socket echo client server program in C#


Here we will create a simple echo client and echo server program where client send the message string to the server and server echoed back the same message string to the client. Download the both client and server source code compile it and run both in command window. IP address , port and message are passed through command line argument.

Download Source Code

You can download the complete source code form below.

Saturday, August 31, 2013

OpenGL with Qt tutorial Creating OpenGL Widget with Qt Creator

In this articles, we will discuss about using the OpenGL with Qt GUI application. We just create the OpenGL window with Qt GUI application using Qt creator. In upcoming tutorials series I will show rendering the 3D object , event handling and other with OpenGL and Qt GUI application.

Download Qt creator

Qt 5.1.0 for Windows 32-bit (MinGW 4.8, OpenGL, 666 MBform


This tutorial provides basic implementation of OpenGL with Qt GUI application. It shows how to integrate the OpenGL with Qt GUI application. Qt provides a widget called QGLWidget for rendering graphics which enables you to easily integrate OpenGL with Qt. This tutorials only includes OpenGL widget and related class to integrate with Qt. It doesn’t include the details of OpenGL rendering pipeline and Qt GUI. To learn and understand this tutorial you must have basic knowledge of Qt GUI and OpenGL rendering pipeline.  In this tutorial, we will use modern OpenGL version 3.2 and GLSL 1.5 as a shader language.

Monday, August 26, 2013

Basic GLFW Tutorials with C++

GLFW (OpenGL FrameWork) is open source library to create OpenGL Window and multi-platform  too. Very easy to manage OpenGL context and event with GLFW. It is specially suitable for game development. GLFW doesn't render 3D scene for that you have to use OpenGL library function. GLFW help to create window , handle keyboard , mouse and joystick events. This tutorials is for those who are new to OpenGL and GLFW. By the end of this tutoirals series understand the basic knowledge about OpenGL and handling events with GLFW.

Tutorials 1: Setup GLFW in Code::Blocks IDE in Windows Machine

Tutorials 2:  Introduction to GLFW

Tutorials 3: Drawing Basic Shapes

Tutorials 4: Transformation: Translation, Rotation and Scalling

Tutorials 5: Texture Mapping 

Saturday, July 27, 2013

Modern OpenGL Tutorial Series

Modern OpenGL are different than ancient opengl version before 2.0. After opengl 2.0 vetex shader and fragment shader became compulsory. It is little bit difficult for beginner to start.

All chapter include basic concept of Modern OpenGL and especially focus on beginner. After going through all the chapter user can get concept of shader, drawing shapes, perspective projection, transformation, color, texture mapping and load 3D model wavefront OBJ.

Download all the code as a zip from here:

All the code in this series of articles is available from github: You can download a zip of all the files from that page, or you can clone the repository if you are familiar with git.

Modern OpenGL tutorial 3D model .obj loader/parser with C++ and GLM

When you need to draw a more advanced object like character, house, terrain, vehicles we can't pass the vertices by ourselves for these object so we have to use the 3D model and model are simply the meshes made of one or more number of vertices. There are many 3D modeling software one of them is blender which is open source also. Blender help to create the model and export it into different file format like .obj, 3ds, md2 etc among them I choose the .obj (wave front obj) file which is very simple. OBJ only contain vertex, normal, texture and other material information. It doesn't support animation for animation we can use  3ds, md2  3Dmodel. There are many library to load 3D model.

All the code in this series of articles is available from github:  You can download a zip of all the files from that page, or you can clone the repository if you are familiar with git.

 In this articles I will show you how to write your own .obj model parser.