Monday, April 16, 2012

GLFW tutorial 1:Introduction to OpenGL Framework

Welcome to codeincodeblock.blogspot.com I have created this tutorial for 3D programming in OpenGL for beginners. OpenGL has wide range of use some of them is Gamming ,simulation, virtual prototyping. This tutorial provide only basic knowledge of OpenGL in brief with full source code and complete explanation so, that you can move quickly to advanced OpenGL programming. All tutorials is written in c++ so that you must know the basic c++ to understand this tutorial.
We use OpenGL for 3d programming. You may wondering what is OpenGL. OpenGL is software interface for graphics hardware in other word we can say it is language translator so that we can use only one language for different graphics hardware. OpenGL is hardware independent. We can draw both 3D and 2D stuff. For 2D their are better libraries like SDL ,Allegro. We use OpenGL basically for 3D stuff.
I use GLFW library and code::blocks IDE. You may confused reading OpenGL and using GLFW library, what does GLFW means? The creation of a window to render stuff in is not covered in the OpenGL specification. This is handled by platform-specific APIs. GLFW is one of this  APIs. It is a crossplatform windowing and keyboard/mouse/joystick handler. Contrary to GLUT, this is more aimed for creating games. Supports Windows, Mac OS X and Unix-like systems such as Linux and FreeBSD.
You don’t have code::blocks IDE then download it form Here .There are two options of download so, choose codeblocks-10.05mingw-setup.exe file in which MinGW compiler is already install. Then you need to setup the GLFW library in code::blocks. Follow my previous article Setup GLFW Project for setup.
Now you are ready for OpenGL 3d programming..
Goto tutorial 2 Drawing Basic Shape

Saturday, April 14, 2012

List of Top Ten College Mini Projects in c/c++ with full source code

If you are looking to learn techniques to develop mini-projects in C/C++ programming language through examples, then you are on the right page. On this page, I have listed the Top 10 Mini Projects written in C and C++ programming. You can choose any one of them based on your needs. The source code for all projects is also available; you can download them from GitHub, and the download link is provided inside each project page.

You will also find project videos on YouTube where I have explained the project algorithm, problem solving techniques, and source code in details. Video links are available inside project page. Please do not forget to subscribe my channel to get new videos update.

All the projects are compiled using the GCC compiler with the Code::Blocks IDE on a Windows machine. Most of the projects do not work on machines other than Windows.

All the projects are created for educational purposes. You can freely use a project or reuse parts of the source code for your college or personal projects. However, you are not allowed to distribute them for commercial purposes. If you have any queries or suggestions, you can email me at smokindinesh@gmail.com.

Projects in c
  1. Quiz Game : You will learn to break down an application into modules (functions), switch between screens based on user input, multi-dimensional array techniques, loops and so much more. Videos are also available to understand project source code in detail.
  2. Contacts Management: You will learn CRUD (Create, Read, Update, and Delete) operation in C files, and various modes of opening files. Also, you can watch video to understand source code in detail.
  3. Personal Dairy Management System: This project is very similar to Contacts Mangement. Sorce code of Contacts Management is reused. You will learn to write reusable source code and implement in another project. Project video is also available inside project page.
  4. Library management: It is larger and more complex than my other projects, such as the Quiz game, Contact Management, and Personal Diary Management. In this project, I have implemented a variety of techniques and features, including Admin and Student modes, user security, reading and writing CSV files, and many others. This project will provide you with numerous insights. If you’re aiming for the highest grade in your project/lab assignment, I recommend following this project. Project video is also available to understand source code in detail.
  5. Snake Game: This game is created without graphics library. Game window, snake, and food is created by printing * and 0 characters. It is very good project to learn game development techniques and algorithms. You can also watch video to understand project in detail. 
  6. Tic-tac-toe game: This is another game project created without graphics library. Although, looks simply, it is technically more complex than snake game. Computer player is also implemented which will play game with user. In this project you will understand techniques of implementing multiplayer, and algorithms of implementing computer player. Project videos are also available.
  7. Tetris Game: This is perfect game to understand real world game development techniques. Although it is created without using graphics, I have implemented linear algebra to rotate and translate shapes which is widely used in 2D and 3D graphics game. I suggest you follow this project to understand real world game development techniques.
  8. Department store system
  9. Telecom Billing Management System
  10. Bank Management System
  11. Medical Store Management System

Monday, February 13, 2012

Delay function in codeblocks

In code block you can use
Sleep(unsigned int miliseconds);
function for delay in execution.
delay(unsigned int miliseconds) function is used in turbo c. For codeblocks you have to add code which is given below example:
#include<stdio.h>
#include<time.h>
void delay(unsigned int mseconds)
{
    clock_t goal = mseconds + clock();
    while (goal > clock());
}
int main()
{
    int i;
    for(i=0;i<10;i++)
    {
    delay(1000);
    printf("This is delay function\n");
    }
    return 0;
}

Friday, February 3, 2012

Draw a 3D Rubik cube using OpenGL utility toolkits GLUT with source code

This article is similar  to my previous article drawing 3D chess board.To make Rubik cube real I have used texture mapping.At first I draw a one cube where I mapped texture in all six side of cube with six different color images and you can save these images from here.After that 27 cube is drawn by looping and final Rubik cube is drawn, rotating in (2,2,0) axis.For texture mapping we have to write a code to load a images and store a value of (R1,G1,B1,R2,G2,B2,……………)pixels in pixels array.In this project there is a Image class where you can see in source code below in file name imageloader.h and imageloader.cpp which I have take from a website www.videotutorialsrock.com.
All the images for this program is given below save it in your project file location.

Saturday, January 28, 2012

Mini project student database system in c++ source code download

This is simple student information system project.Wher you can do following things 1. Add    Records
          2. List   Records
          3. Modify Records
          4. Delete Records
          5. Exit   Program
to store data file is used. Download project from GitHub.

How to display a system date and time using c++

#include <ctime>
#include <iostream>
using namespace std;
 
int main() {
    time_t t = time(0);   // get time now
    struct tm * now = localtime( & t );
    cout <<  now->tm_mday << '-'//day
         << (now->tm_mon +1 )  << '-'//month
         << (now->tm_year +1900 )//year
         <<endl
         <<now->tm_hour//hour
         <<'-'<<now->tm_min//min
         <<'-'<< now->tm_sec//sec
         << endl;
 
         return 0;
}

Wednesday, January 25, 2012

Mini project Hang Man in C++ source code download

It is a simple project just to provide a Hang Man game concept.In this project I haven’t draw a man for a wrong choice so,try to draw a simple man by using “|” pattern in your project which make your project better .
Here is the source code ,copy and compile it in Code::blocks gcc compiler or Download project from GitHub.