DirectX in C# in Brief

DirectX in C# in BriefSeveral techniques of implementing DirectX functionality into C# application will be presented. Their common attribute is an idea of component object model (COM) because DirectX is based on component technology. This paper will be focused on use of DirectX graphical capabilities within the C# code of the Microsoft .NET Framework. Three main techniques will be described. First, COM interoperability which allows us to decide what specific functionality to use. There will be also mentioned some basic principles like memory management and garbage collector (GC) and some approaches based on wrapper classes. Second, Visual Basic type library that includes all the functionality, and third, the complete solution known as DirectX 9.0. Each technique will be supported with a code snippet and with several reasons stating its suitability. Nowadays, the need for security can be more important than for the efficiency. This also gives a right answer for the question of how good is solution provided by use of DirectX and .NET Framework.
Read more

Using DirectX in Windows Forms

Using DirectX in Windows FormsWindows Forms is a Microsoft technology that provides a clean and easy framework for building graphical user interfaces (GUIs) and is both extensible and componentized. However, it is sometimes desirable to have a rich 3D user interface to display 3D data or to allow the user to interact in 3D. DirectX, another Microsoft technology, is a graphics framework with support for 2D and 3D graphics, which supplies an abstraction layer between low-level system components (such as drivers) and high-level applications (such as a GUI or a game). This document will discuss the process of hosting DirectX inside of a Windows Forms application in order to provide seamless integration between the two frameworks for use in GUIs that may be graphics intensive.
Read more

Introducing the XNA Framework and XNA Game Studio Express

Introducing the XNA Framework and XNA Game Studio ExpressMost developers I know decided to enter the computer field and specifically programming because of computer games. Game development can be one of the most challenging disciplines of software engineering-it can also be the most rewarding! Never before has it been possible for the masses to create games for a game console, much less a next generation game console. We are coming in on the ground floor of a technology that is going to experience tremendous growth. Microsoft is leading the way into how content will be created for game consoles. Soon other game console manufacturers will be jumping at a way to allow the public to create content for their machines. The great news for the Xbox 360 is that Microsoft has spent so much time over the years creating productive and stable development environments for programmers. We will be installing one of Microsoft’s latest integrated development environments (IDEs) in this chapter. Before we get to that, let’s take a look at the technology we discuss in this book-XNA.
Read more

GPU programming using .NET languages

GPU programming using .NET languagesOur project, which is called IL Shader, allows writing vertex and fragment programs using general purpose programming languages on .NET platform. Our project is based on three-stage translation. First, MSIL bytecode is translated to assembly language of abstract machine with vector registers. Then we perform some optimization and finally translate abstract machine code to one of assembly language shaders (currently DirectX pixel and vertex shaders). We provide infrastructure that allows using .NET classes as shaders. This project is supported by Microsoft Research grant.
Read more

Multicore and GPU Programming for Video Games

Multicore and GPU Programming for Video GamesWhy Programmable Shaders
. Hardwired pipeline
- Produces limited effects
- Effects look the same
- Gamers want unique look-n-feel
- Multi-texturing somewhat alleviates this, but not enough
- Less interoperable, less portable
. Programmable Shaders
- Vertex Shader
- Pixel or Fragment Shader
- Starting from DX 8.0 (assembly)
- DX 9.0 added HLSL (High Level Shading Language)
- HLSL (MS) is compatible with Cg (Nvidia)
Read more

Next Page →