Thursday, June 30, 2011

Sample Calculator with windows form application in c# sharp using visual studio source code

Hi! friends do you want to learn windows form application in visual studio then this sample calculator project may provide hits and idea about event handling in windows form application.Code is written in c#.Here is there file for this copy one by one or Download complete project from GitHub.
You can also see other sample projects here the lists of other projects.
List of windows form sample projects.


BItmap maping and texture map in OpenGL

This the sample code for texture map in teapot and bit map is used to draw chess board.Code is compiled in codeblocks you can copy and paste this code for your study or project.Please use your own image for texture map.Image must be in bmp formate.


#include <windows.h>
#include <GL/glut.h>
#include <stdio.h>
GLuint texture[2];
GLint slices=16;
GLint stacks=16;
struct Image {
    unsigned long sizeX;
    unsigned long sizeY;
    char *data;
};
typedef struct Image Image;

Saturday, June 25, 2011

wxWidget sample project Puzzel source code

This is interesting game developed using wxWidget graphic library and c++ programming language compiled in gcc compiler with code::blocks IDE. You can download the complete project.At first to run this project you have to setup the wxWidget graphics library in code::blocks. All the instruction for wxWidget setup is given in this article setup wxWidget .You can make this game as your college mini projects.wxWidget is very old and popular GUI graphics library and knowledge of its is very important for student. Other GUI like windows form where you can drag and drops the control directly which make designing easy but we can't understand the actual programming so by using wiWidget we can understand complete GUI design and add the method for event handling.GUI of  Code::Blocks IDE which we use is also design in wxWidget. In this program wxWidget library is used to make a game rather than for GUI.
you can  download sourcecode here all the image file required for the project is also provide.This game is built in code::blocks IDE using C++ with wxWidget library.

Thursday, June 23, 2011

Mini project tic-tac-toe game source code in C

Hi this is a tic-tac-toe game you can copy sourcecode here or Download from GitHub.
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include <windows.h>

Tuesday, June 21, 2011

Mini project Quiz in C

Welcome to Mini Project Quiz in C! This article is about creating a simple quiz game in the C programming language. Target readers of this article are students and absolute beginner C programmer. If you are an experienced C programmer then it is not for you.

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.

Like in other my sample mini-projects, I have not used a file handling system to store information to make it simple and easy to understand basic techniques.
After finishing this article, you will:

  • Truly understand how to break down the application and create a flow chart.
  • Be able to convert the flow chart processes into C functions.
  • Learn techniques to switch between processes based on user input. 
  • Have mastered the usages of multi-dimensional C array and loops.


You can download the final version of the application from GitHub Download from Github.

I have divided this article into 3 parts:
Part 1: Flow Chart and Main Menu: In this lesson, you will learn to create an application flow chart and create a welcome menu screen of the game.
Part 2: Multi-dimensional C array: In this lesson, you will understand techniques to create a function and switching between multiple functions as per user choice. You will master to use one dimension, two dimensions and three-dimension C array to store questions, question options, and answer. 
Part 3: Gameplay and the final score: You will learn to use a loop to display questions one by one, check the user correct answer and calculate the final score.

mini project Department store source code


This mini project is about department store all features required for department store are added in this programe.You can copy the source code and compile it in a code block.This project is perfect for your college mini project in C. Download Project from Github


#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<string.h>
#include<ctype.h>
#include<windows.h>

#define ANS 15
#define ACS 4
 COORD coord={0,0}; // this is global variable
                                    //center of axis is set to the top left cornor of the screen
void gotoxy(int x,int y)
{
    coord.X=x;
    coord.Y=y;
    SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),coord);
}
/*declaration of checking functions*/
void c_code(char[]);
int check(char[]);

/*structure declaration*/
typedef struct{
char name[ANS],code[ACS];
float rate;
int quantity;
}rec;
rec item;

/*declaration of display functions*/
void curser(int);
void dbill();
void d_mainmenu();
void display(rec *,int,int);
void window(int,int,int,int);
void dis_con();
void d_search();
void highlight(int,int);

/*declaration of main menu functions*/
void bill() ;
void edit();
void add();
void del();
void exit();

/*declaration of display submenu functions*/
void d_code();
void d_rate();
void d_quan();
void d_all();

/*start of main*/
int main()
{
d_mainmenu();
return 0;
}

Sunday, June 19, 2011

Mini project snake game in c

Mini project in C many Student do management project like library management ,Hotel management etc.But Snake Game is mini project of first semester build by my friend which is very different.It is console application without graphic library that's why it is more interesting.This game is perfect without any error and better user interface.It is complied in code::block using c language.Here goes a source code you can copy and compiled it in code::block.I hope it can help and become a reference for your project. Download Project from Github.

Friday, June 17, 2011

Video game teheran in OpenGL

Teheran is importantor 3D game.You can donwload it source code form this link  download .For teheran you have to use gray code image.All source is written in c++ using OpenGL library.

Mini project "3D Bounce " in OpenGL

This project is my second-year mini-project. I have use the GLUT(OpenGL) library in c++.3D Bounce is a game in which we have to bounce the ball to collect the floating star,after collecting all star then a door opens for the next room. Due to lack of time, I can't complete this project but all image drawing part is completed and I hope you will complete it for your collage project.You can download it source code from this link http://www.4shared.com/file/J-cjGaN-/bounce.html .This program is written in complete object oriented environment ,I have made different class in different file and It's code is very lengthy so  I can't give source code here.

Wednesday, June 15, 2011

Drawing a snowman using OpenGL source code


This source code is written in c using the OpenGL library. This program is just a demo to draw a different shape object and I draw a man like an object in this program. I have also added a keyboard event in this program.

#include <math.h>
#include <GL/glut.h>
#include <stdio.h>
#include <string.h>
//#include <cstdlib>
//if you got error in exit() by compiler then does not incluede stdlib.h because //exit() is also defined in glut.h file.

float angle=0.0,deltaAngle = 0.0,ratio;
float x=0.0f,y=1.75f,z=5.0f;
float lx=0.0f,ly=0.0f,lz=-1.0f;
int deltaMove = 0,h,w;
int font=(int)GLUT_BITMAP_8_BY_13;
static GLint snowman_display_list;
int bitmapHeight=13;

int frame,time,timebase=0;
char s[30];

void initWindow();

void changeSize(int w1, int h1)
{

// Prevent a divide by zero, when window is too short
// (you cant make a window of zero width).
if(h1 == 0)
h1 = 1;

w = w1;
h = h1;
ratio = 1.0f * w / h;
// Reset the coordinate system before modifying
glMatrixMode(GL_PROJECTION);
glLoadIdentity();

// Set the viewport to be the entire window
    glViewport(0, 0, w, h);

// Set the clipping volume
gluPerspective(45,ratio,0.1,1000);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
gluLookAt(x, y, z,
     x + lx,y + ly,z + lz,
 0.0f,1.0f,0.0f);


}


Sunday, June 12, 2011

Mouse event handling source code in OpenGL



This source code is written in C++ with OpenGL.It is just a demo for mouse event handling you can use this code for your project. In this example void motionPassive(int x, int y) to find out the cursor position in the window. By finding the difference between the previous and initial position the direction of the camera is changed.

Texture map in solid sphere using GLUT(OpenGL)


This source code is written in C used to draw a solid sphere using OpenGL and you can map texture in it. Create a project for OpenGL and copy and paste this code and use your desire image file for texture mapping.

//main.c

#include <GL/gl.h>
#include <GL/glut.h>
#include <windows.h>
#include <stdio.h>
#include <math.h>
GLuint texture;
double angle = 0;
typedef struct
{
    int X;
    int Y;
    int Z;
    double U;
    double V;
}VERTICES;

const double PI = 3.1415926535897;
const int space = 10;
const int VertexCount = (90 / space) * (360 / space) * 4;
VERTICES VERTEX[VertexCount];
GLuint LoadTextureRAW( const char * filename );