------

[ AD ] Port Monitor ( Try to use a Best WebSite Monitoring Tool )

------
SlimDX slimdx.org

DirectX 응용 프로그램을 쉽게 개발 할 수 있는 무료 오픈 소스

c#, vb.net , ironpython같은 .net언어를 사용

microsoft게임 및 멀티미디어 기술을 모두 포함해서 .net환경에서 사용 할 수 있도록 해주는
효율적이고 쉬운 wrapper


http://tramper2.blog.me/100108660645 한글 번역 개발자 블로그

'온라인게임 > DirectX' 카테고리의 다른 글

Lesson 2 - 풀 스크린 만들기  (0) 2010.09.03
Direct 3D Basics  (0) 2010.09.03
Lesson Overview
 

Making your game fullscreen is easy, but requires changing a few details of the program,

as well as adding a couple lines of code.

 

In this lesson we will cover two things. 

First, we will go over how to globalize your screen resolution and why you would do this.  Second, we'll cover the mechanics of making a window go into fullscreen mode.

 

Setting Up the Screen Size 


// define the screen resolution
#define SCREEN_WIDTH  800
#define SCREEN_HEIGHT 600

 

 

 hWnd = CreateWindowEx(NULL,
                          L"WindowClass",
                          L"Our Direct3D Program",
                          WS_OVERLAPPEDWINDOW,
                          300, 300,
                          SCREEN_WIDTH, SCREEN_HEIGHT,   

                          NULL,
                          NULL,
                          hInstance,
                          NULL);



Changing to Fullscreen Mode


hWnd = CreateWindowEx(NULL,
                          L"WindowClass",
                          L"Our Direct3D Program",
                          WS_EX_TOPMOST | WS_POPUP,    // fullscreen values
                          0, 0,    // the starting x and y positions should be 0
                          SCREEN_WIDTH, SCREEN_HEIGHT,
                          NULL,
                          NULL,
                          hInstance,
                          NULL);

 

Next, we have to tell DirectX about our new screen resolution. 

We do this by making a few changes to the d3dpp struct we built in the last
lesson. 

Let's look at what they are before we see what they do.


D3DPRESENT_PARAMETERS d3dpp;    // create a struct to hold various device information

ZeroMemory(&d3dpp, sizeof(d3dpp));    // clear out the struct for use
d3dpp.Windowed = FALSE;    // program fullscreen, not windowed
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;    // discard old frames
d3dpp.hDeviceWindow = hWnd;    // set the window to be used by Direct3D
d3dpp.BackBufferFormat = D3DFMT_X8R8G8B8;  //set the back buffer format to 32-bit
d3dpp.BackBufferWidth = SCREEN_WIDTH;    //set the width of the buffer
d3dpp.BackBufferHeight = SCREEN_HEIGHT;   //set the height of the buffer

'온라인게임 > DirectX' 카테고리의 다른 글

SlimDX  (0) 2010.10.07
Direct 3D Basics  (0) 2010.09.03

Prerequisite

Before you can do this tutorial, you will need the following:

1.  Visual Studio 2005 (or Visual C++ 2005 Express Edition)*.
2.  A knowledge of basic C++ and Win32 programming.
3.  DirectX SDK (February 2005 or later)
4.  A burning desire to make games.

 

* - other versions of C++ compilers will also run DirectX, however, there are some language specific changes you may need to make in each of the demo applications.

 

In this first DirectX lesson we will go over how to build a basic Direct3D application.  We will also cover a couple of theoretical concepts underlying DirectX which are useful to know.  Don't worry, nothing too theoretical.

 

1.  Create global variables and function prototypes
2.  Create a function to initialize Direct3D and create the Direct3D Device
3.  Create a function to render a frame
4.  Create a function to close Direct3D

 

 

d3d->CreateDevice()

d3d->Release()

 

#include <d3d9.h>

 

#pragma comment (lib, "d3d9.lib")

 

LPDIRECT3D9 d3d;

LPDIRECT3DDEVICE9 d3ddev;

 

 

 

Imagine only being able to play Half-Life 2 or Halo in a 400x400 pixel window.  Kinda lame?  I thought so myself.  In this lesson we will modify our Direct3D program to be in Fullscreen mode.

More important than knowing the code of Direct3D is having a very fundamental understanding of 3D and how it works.  This lesson will go briefly over 3D coordinate systems, how 3D models are constructed, lighting, color and more.  If you already know these things, I recommed you go over this to make sure there isn't anything else you might learn.  Otherwise, you should do this lesson in full.

Triangles do not make the world go round.  They are the world.  Because triangles can be combined to form pretty much any shape known to man, games tend to be made out of triangles.  In this lesson we will learn how to draw a simple triangle and color it.

So far, our triangle does nothing.  It sits still, and even if you got it to move, it wasn't in 3D.  You made a boring, flat triangle.  Now let's bring this triangle to life by transforming it into a 3D triangle, rotating it, moving it around, and even scaling it to a different size.

Now our triangle can rotate, can be resized and can move.  Our camera can zoom, pan, and change direction.  We've got everything set to go.  However, there is one problem that must be solved before we go too far...

We're getting pretty good with triangles, but triangles by themselves are no fun.  Let's learn how to make simple shapes out of triangles, and transform each shape as a whole.

In the previous lessons we have turned lighting off for simplicity.  However, no lights in a 3D world makes everything look fake.  Lights add good effects to your game, even if they are as simple as day and night.  This lesson will cover the basics of lighting and show how to make a simple light.

There is more to lighting than a simple Directional Light.  This lesson covers more types of lights you can use.

Sometimes you wish to have objects be see-through.  This includes windows, glass objects, clouds, and much more.  These effects are achieved by blending colors together, the color of what you are drawing and what is in the background.  This lesson will cover how to do simple color blending.

'온라인게임 > DirectX' 카테고리의 다른 글

SlimDX  (0) 2010.10.07
Lesson 2 - 풀 스크린 만들기  (0) 2010.09.03

+ Recent posts