Sei sulla pagina 1di 13

CONTENTS

1. INTRODUCTION ---------------------------------------------------------- 2
2. SYSTEM STUDY ---------------------------------------------------------- 3
3. SYSTEM SPECIFICATION ------------------------------------------------ 4
4. SYSTEM ANALYSIS --------------------------------------------------------- 5
5. SYSTEM DESIGN ---------------------------------------------------------- 8
6. IMPLEMENTATION AND TESTING ------------------------------------ 11
7. CONCLUSION --------------------------------------------------------------- 12
8. BIBILIOGRAPHY & REFERENCE ------------------------------------------ 13

1
INTRODUCTION

1.1 Abstract

Bouncing ball is mini project in C programming. It is simple graphics program for


running on graphics installed drivers. This project has written only for to view how the
graphics drivers are working in C programming.

Due to technical advances in graphics hardware, some areas of 3D graphics


programming have become quite complex. To simplify the process, new features were
added to graphics cards, including the ability to modify their rendering pipelines using
vertex and pixel shaders.

In the beginning, vertex and pixel shaders were programmed at a very low level with
only the assembly language of the graphics processing unit. Although using the
assembly language gave the programmer complete control over code and flexibility, it
was fairly hard to use. A portable, higher level language for programming the GPU was
needed, so Cg was created to overcome these problems and make shader
development easier.

Some of the benefits of using Cg over assembly are:

 High level code is easier to learn, program, read, and maintain than assembly
code.
 Cg code is portable to a wide range of hardware and platforms, unlike assembly
code, which usually depends on hardware and the platforms it's written for.
 The Cg compiler can optimize code and do lower level tasks automatically, which
are hard to do and error prone in assembly.

2
SYSTEM STUDY

2.1 Proposed System

The proposed system was designed to give a professional look and feeling GUI for
random bouncing ball in C programming.

The system has a splash screen, which was animated and designed with good look and
feel.
The Borland Graphics Interface, also known as BGI, is a graphics library bundled
with several Borland compilers for the DOS operating systems since 1987. BGI was
also used to provide graphics for many other Borland products including the Quattro
spreadsheet. The library loaded graphic drivers (*.BGI) and vector fonts (*.CHR) from
disk in order to provide device independent graphics support. It was possible for the
programmer to embed the graphic driver into the executable file by linking the graphic
driver as object code with the aid of a utility provided by the compiler (bgiobj.exe). There
were graphic drivers for common graphic adapters and printers of that time, such as
CGA, EGA and VGA. There also were BGI drivers for some kinds of plotters.

Mode 13h is an IBM VGA BIOS mode. It is the specific standard 256-color mode on
IBM's VGA graphics hardware. It features a resolution of 320×200 pixels. It was used
extensively in computer games and art/animation software of the late 1980s and early to
mid-1990s. Since the earlier CGA and EGA graphics standards provided a similar
resolution mode, its use simplified conversions to those formats.

Mode 13h provided programmers with a straightforward manner of accessing video


memory (nicknamed chunky graphics), at the expense of not being able to access other
useful features of the VGA hardware.

Given the aspect ratio of a 320×200 resolution screen, Mode 13h does not have square
pixels

3
SYSTEM SPECIFICATION

3.1 Software Requirements

Operating System : DOS


Developing software : Turbo C

Language used : C

Library : Graphics

3.2 Hardware Requirements

Processor : PC with a Pentium II-class.


Memory : 256 MB RAM.
Hard disk space : 2 .5 GB installation drive.
Monitor : 15 inch Color Monitor.
Keyboard : 105 Keys.
Display Type : Super VGA (800x600).

4
SYSTEM ANALYSIS

4.1 Feasibility Analysis

The main aim of the feasibility study activity is to determine whether it would be
financially and technically feasible to develop the product.

The feasibility study activity involves the analysis of the problem and collection of all
relevant information relating to the product such as the different data items which would
be input to the system, the processing required to be carried out on these data, the
output data required to be produced by the system as well as various constraints on the
behavior of the system.

4.1.1 Economic & Technical Feasibility


This is concerned with specifying equipment and software that will successfully satisfy
the user requirement, in examining technical feasibility, configuration of the system is
given more importance than the actual make of hardware.

Bouncing ball is developed for DOS operating system and most of the latest version of
Windows series OS is supported with DOS OS. Tools development for the use of the
system is Turbo C compiler.

C Programming Language

In computing, C is a general-purpose programming language initially developed


by Dennis Ritchie between 1969 and 1973 at AT&T Bell Labs.[4] Like most imperative
languages in the ALGOL tradition, C has facilities for structured programming and
allows lexical variable scope and recursion, while a static type system prevents many
unintended operations.

5
Its design provides constructs that map efficiently to typical machine instructions, and
therefore it has found lasting use in applications that had formerly been coded in
assembly, most notably system software like the Unix computer operating system.

Certain aspects of the ANSI C standard are not defined exactly by ANSI. Instead, each
implementation of a C compiler is free to define these aspects individually. This chapter
tells how Borland has chosen to define these implementation-specific standards. The
section numbers refer to the February 1990 ANSI Standard.

Programming Tools

Turbo C++ was a C++ compiler and integrated development environment and computer
language originally from Borland. Most recently it was distributed by Embarcadero
Technologies.

Graphics Library

C graphics using graphics’ functions or WinBGIM (Windows 7) can be used to draw


different shapes, display text in different fonts, change colors and many more. Using
functions of graphics.h in turbo c compiler you can make graphics programs,
animations, projects and games.

The program was completely developed with the support of Graphics.h library.
Graphics.h : Declare prototype for graphics functions

Graphics in C Language to 16 bit C programming and MS DOS environment. In a C


Program first of all you need to initialize the graphics drivers on the computer. This is
done using the initgraph method provided in graphics.h library.

Initgraph initializes the graphics system by loading a graphics driver from disk (or
validating a registered driver) then putting the system into graphics mode.Initgraph also
resets all graphics settings (color, palette, current position, viewport, etc.) to their
defaults, then resets graphresult to 0.

6
4.1.2 Social & Behavioral Feasibility
This concerned with the requirements and analysis of the program. Interface and layout
was designed in a manner that the major part of the system was allocated to the game
player board and the right side of the screen was allocated to dice running and score
board display details.

In this program, the balls are moving overall screen and there is no requirement of user
intervention.

7
SYSTEM DESIGN
Software Life Cycle:

The goal of prototyping based development is to counter the first two limitations
of the waterfall model discussed earlier. The basic idea here is that instead of freezing
the requirements before a design or coding can proceed, a throwaway prototype is built
to understand the requirements. This prototype is developed based on the currently
known requirements. Development of the prototype obviously undergoes design, coding
and testing. But each of these phases is not done very formally or thoroughly. By using
this prototype, the client can get an "actual feel" of the system, since the interactions
with prototype can enable the client to better understand the requirements of the
desired system. Prototyping is an attractive idea for complicated and large systems for
which there is no manual process or existing system to help determining the
requirements. In such situations letting the client "plan" with the prototype provides
invaluable and intangible inputs which helps in determining the requirements for the
system. It is also an effective method to demonstrate the feasibility of a certain
approach. This might be needed for novel systems where it is not clear that constraints
can be met or that algorithms can be developed to implement the requirements. The
process model of the prototyping approach is shown in the figure below.

Start

Preliminary
Investigation

Stop

Implementati Analysis
on &
Maintenance

Testing Design

8
Development
Design
Prototyping Model:

The basic reason for little common use of prototyping is the cost involved in this
built-it-twice approach. However, some argue that prototyping need not be very costly
and can actually reduce the overall development cost. The prototype are usually not
complete systems and many of the details are not built in the prototype. The goal is to
provide a system with overall functionality. In addition, the cost of testing and writing
detailed documents are reduced. These factors helps to reduce the cost of developing
the prototype. On the other hand, the experience of developing the prototype will very
useful for developers when developing the final system. This experience helps to
reduce the cost of development of the final system and results in a more reliable and
better designed system.

Diagram of Prototyping Model

Start
Requirement Quick Design Building
Gathering Prototype

Output Refining Customer


Prototype Evaluation
Stop

Advantages of Prototyping:

1. Users are actively involved in the development

2. It provides a better system to users, as users have natural tendency to change their
mind in specifying requirements and this method of developing systems supports this
user tendency.

3. Since in this methodology a working model of the system is provided, the users get a
better understanding of the system being developed.

4. Errors can be detected much earlier as the system is mode side by side.

9
5. Quicker user feedback is available leading to better solutions.

Disadvantages:
1. Leads to implementing and then repairing way of building systems.

2. Practically, this methodology may increase the complexity of the system as scope of
the system may expand beyond original plans.

Output Design:
When you run this project on your computer, you will get following output,

10
IMPLEMENTATION AND TESTING

5.1 Testing

Testing is probably the most important phase for long-term support as well as for
the reputation of the company. If you don’t control the quality of the software, it
will not be able to compete with other products on the market.
There are multiple types of testing and these are explained in this section. Each
of these has its own importance.

Unit Testing

Unit testing is testing one part or one component of the product. The developer
usually does this when he/she has completed writing code for that part o f the
product. This makes sure that the component is doing what it is intended to do.
This also saves a lot of time for software testers as well as developers by
eliminating many cycles of software being passed back and forth between the
developer and the tester. When a developer is confident that a particular part of
the software is ready, he/she can write test cases to test functionality of this part
of the software.
In our system Random Bouncing Ball each modules are designed and tested
separately. Modules designed and tested separately are

 initgraph() : Tested to initialize graphics functions and drivers


 drawBall(struct ball *b, int color): Tested to draw the ball

11
CONCLUSION

6.1 Conclusion
Throughout this thesis our aim was to develop a random bouncing ball that shows
user how to create simple graphics project.
The entire project is explained and displayed in a well arranged GUI. In this
project there is no requirement of user inputs. It is automatic runnable project.

12
BIBILIOGRAPHY & REFERENCE

References:
http://www.brackeen.com/vga/index.html

Bibliography:

Web sites

C Programming
www.cprogramming.com
www.cs.cf.ac.uk/Dave/C/CE.html
Graphics
http://www.brackeen.com/vga/index.html
www.programmingsimplified.com/c-graphics-programming-tutorial.html

C & Graphics Books

 The C Programming Language by Brian W. Kernighan, Dennis M. Ritchie


 Let Us C by Yashwant Kanetkar
 Graphics Under C by Yashwant Kanetkar

13

Potrebbero piacerti anche