GAME PROGRAMMING
NAME – SHIVAM
SHARMA
ROLL NO – 08
TYCS
PRACTICAL NO. 1
Aim: To Setup DirectX 11, Window Framework and Initialize Direct3D Device
Theory:
DirectX 11-
Microsoft DirectX is a collection of application programming interfaces (APIs) for handling tasks
related to multimedia, especially game programming and video, on Microsoft platforms.
Originally, the names of these APIs all began with "Direct", such as Direct3D, DirectDraw,
DirectMusic, DirectPlay, DirectSound, and so forth. The name DirectX was coined as a shorthand
term for all of these APIs (the X standing in for the particular API names) and soon became the
name of the collection. When Microsoft later set out to develop a gaming console, the X was used
as the basis of the name Xbox to indicate that the console was based on DirectX technology.[2]
The X initial has been carried forward in the naming of APIs designed for the Xbox such as XInput
and the Cross-platform Audio Creation Tool (XACT), while the DirectX pattern has been continued
for Windows APIs such as Direct2D and DirectWrite.
Microsoft unveiled DirectX 11 at the Gamefest 08 event in Seattle, with the major scheduled features
including GPGPU support (DirectCompute), and Direct3D 11 with tessellation support[28][29] and
improved multi-threading support to assist video game developers in developing games that
better utilize multi-core processors.[30] Direct3D 11 runs on Windows Vista, Windows 7, Windows
8 and Windows 10. Parts of the new API such as multi-threaded resource handling can be
supported on Direct3D 9/10/10.1-class hardware. Hardware tessellation and Shader Model 5.0
require Direct3D 11 supporting hardware.[31] Microsoft has since released the Direct3D 11
Technical Preview.[32] Direct3D 11 is a strict superset of Direct3D 10.1 — all hardware and API
features of version 10.1 are retained, and new features are added only when necessary for
exposing new functionality. This helps to keep backwards compatibility with previous versions of
InitializeComponent():
A method automatically written for you by the Form Designer when
you create/change your forms. It contains the code that creates and initializes the user
interface objects dragged on the form surface with the values provided by the programmer
using the Property Grid of the Form Designer.
PresentParameters:
Describes the presentation parameters. Properties are:
Windowed:
Boolean value that indicates whether an application is running in a
windowed mode.
SwapEffect
Retrieves or sets the swap effect.
DIRECT 3D
Direct3D is a graphics Application Programming Interface (API) for Microsoft Windows. Part of
DirectX, Direct3D is used to render three-dimensional graphics in applications where
performance is important, such as games. Direct3D uses hardware acceleration if it is available
on the graphics card, allowing for hardware acceleration of the entire 3D rendering pipeline or
even only partial acceleration. Direct3D exposes the advanced graphics capabilities of 3D
graphics hardware, including Z-buffering,[ W-buffering, stencil buffering, spatial anti-aliasing,
alpha blending, color blending, mipmapping, texture blending,[ clipping, culling, atmospheric
effects, perspective-correct texture mapping, programmable HLSL shaders and
effects.Integration with other DirectX technologies enables Direct3D to deliver such features as
video mapping, hardware 3D rendering in 2D overlay planes, and even sprites, providing the use
of 2D and 3D graphics in interactive media ties
A Direct3D device is the rendering component of Direct3D. It encapsulates and stores the rendering
state. In addition, a Direct3D device performs transformations and lighting operations and
rasterizes an image to a surface
OUTPUT
PRACTICAL NO. 2
Aim: Draw a triangle using Direct3D 11(buffers, Shaders and HLSL).
Theory:
CustomVertex class
Defines various custom fixed-format vertex types. This class is a
container of structures.
CustomVertex.TransformedColored
Describes a custom vertex format structure that
contains transformed vertices and color information
Buffer
Buffer is a software application for the web and mobile, designed to manage accounts in social
networks, by providing the means for a user to schedule posts
to Twitter, Facebook, Instagram, Instagram Stories, Pinterest, and LinkedIn, as well as analyze
their results and engage with their community. It is owned by remote company Buffer Inc.
Shader
is a type of computer program originally used for shading in 3D scenes (the production of
appropriate levels of light, darkness, and color in a rendered image). They now perform a
variety of specialized functions in various fields within the category of computer
graphics special effects, or else do video post-processing unrelated to shading, or even
perform functions unrelated to graphics.
The High-Level Shader Language(HLSL)
High-Level Shading Language (HLSL) is a proprietary shading language developed by Microsoft
for the Direct3D 9 API to augment the shader assembly language, and went on to become the
required shading language for the unified shader model of Direct3D 10 and higher.
HLSL is analogous to the GLSL shading language used with the OpenGL standard. It is very
similar to the Nvidia Cg shading language, as it was developed alongside it. Early versions of the
two languages were considered identical, only marketed differently.[3] HLSL shaders can
enable profound speed and detail increases as well as many special effects in both 2D and 3D
computer graphics
OUTPUT