School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 307,096 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,023 people online right now. Registration is fast and FREE... Join Now!




DirectX 10 Tutorials

 

DirectX 10 Tutorials, can i have some links?

iphoneorange

6 Oct, 2009 - 04:24 PM
Post #1

D.I.C Head
Group Icon

Joined: 20 Aug, 2008
Posts: 145



Thanked: 17 times
Dream Kudos: 75
My Contributions
Ok, i know a little DirectX 9, (i can do the basics in Direct3D, and some DirectInput, etc), but i really wanna learn DirectX 10. I got the latest version of the SDK, but i can't seem to find any tutorials...at least not free ones...and i really don't wanna buy a book; thus i came to the experts biggrin.gif

hope you can help me biggrin.gif

User is offlineProfile CardPM
+Quote Post


magius96

RE: DirectX 10 Tutorials

7 Oct, 2009 - 05:22 AM
Post #2

D.I.C Head
Group Icon

Joined: 15 Apr, 2009
Posts: 82



Thanked: 5 times
Dream Kudos: 50
My Contributions
Absolutely. Here's all the link you'll really ever need:

The Ultimate DirectX 10 Reference

As for not finding free ones...what keywords are you searching for? I can't seem to find paid tutorials.

This post has been edited by magius96: 7 Oct, 2009 - 05:24 AM
User is offlineProfile CardPM
+Quote Post

iphoneorange

RE: DirectX 10 Tutorials

7 Oct, 2009 - 01:49 PM
Post #3

D.I.C Head
Group Icon

Joined: 20 Aug, 2008
Posts: 145



Thanked: 17 times
Dream Kudos: 75
My Contributions
Thanks for the link biggrin.gif

as for paid tutorials, i was talking about directxtutorial.com, and a few others

also, is DirectX 10 supposed to be slower than 9? I mean, I've run a few examples, and they take several seconds longer than DirectX 9 :?
User is offlineProfile CardPM
+Quote Post

magius96

RE: DirectX 10 Tutorials

8 Oct, 2009 - 12:03 PM
Post #4

D.I.C Head
Group Icon

Joined: 15 Apr, 2009
Posts: 82



Thanked: 5 times
Dream Kudos: 50
My Contributions
I'm not entirely sure about the speed differences, as I haven't really tested the two out on the same machine, but it's my understanding that dx10 is supposed to be more optimized than dx9 and therefor run faster and smoother. Of course since dx is a library to be used with code you write, I guess it all comes down to how you write your code, and in what language you write it.
User is offlineProfile CardPM
+Quote Post

iphoneorange

RE: DirectX 10 Tutorials

8 Oct, 2009 - 03:39 PM
Post #5

D.I.C Head
Group Icon

Joined: 20 Aug, 2008
Posts: 145



Thanked: 17 times
Dream Kudos: 75
My Contributions
OK, well this is an example of what i compiled (i got it from here: http://wiki.directxers.com/index.php?title...ct3D_10_Device)

C++
  #include "windows.h"
#include "d3d10.h"

bool g_bContinue = true;

//Besides the main function, there must be a message processing function
LRESULT WINAPI MsgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
switch( msg )
{
case WM_DESTROY:
PostQuitMessage( 0 );
g_bContinue = false;
return 0;
}
return DefWindowProc( hWnd, msg, wParam, lParam );
}

//The entry point of a windows application is the WinMain function
INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR, INT )
{
//Create a window class.
WNDCLASSEX wc = { sizeof(WNDCLASSEX), CS_CLASSDC, MsgProc, 0L, 0L,
GetModuleHandle(NULL), NULL, NULL, NULL, NULL,
"Direct3D Window", NULL };
//Register the window class.
RegisterClassEx( &wc );
//Create the application's window.
HWND hWnd = CreateWindow( "Direct3D Window", "DirectX Wiki - D3D10 Tutorial 1",
WS_OVERLAPPEDWINDOW, 100, 100, 400, 400,
GetDesktopWindow(), NULL, wc.hInstance, NULL );

ShowWindow(hWnd,SW_SHOW);

//Create the Direct3D Device and Swap Chain
DXGI_SWAP_CHAIN_DESC sd;
ZeroMemory( &sd, sizeof(sd) );
sd.BufferCount = 1;
sd.BufferDesc.Width = 640;
sd.BufferDesc.Height = 480;
sd.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
sd.BufferDesc.RefreshRate.Numerator = 60;
sd.BufferDesc.RefreshRate.Denominator = 1;
sd.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
sd.OutputWindow = hWnd;
sd.SampleDesc.Count = 1;
sd.SampleDesc.Quality = 0;
sd.Windowed = TRUE;

IDXGISwapChain* pSwapChain = NULL;
ID3D10Device* pd3dDevice = NULL;
if( FAILED( D3D10CreateDeviceAndSwapChain( NULL,
D3D10_DRIVER_TYPE_REFERENCE,
NULL,
0,
D3D10_SDK_VERSION,
&sd,
&pSwapChain,
&pd3dDevice ) ) )
{
return FALSE;
}

// Create a render target view(from Backbuffer)
ID3D10Texture2D *pBackBuffer = NULL;
ID3D10RenderTargetView *pRenderTargetView = NULL;
if( FAILED( pSwapChain->GetBuffer( 0, __uuidof( ID3D10Texture2D ), (LPVOID*)&pBackBuffer ) ) )
return FALSE;
HRESULT hr = pd3dDevice->CreateRenderTargetView( pBackBuffer, NULL, &pRenderTargetView );
pBackBuffer->Release();
if( FAILED( hr ) )
return FALSE;
pd3dDevice->OMSetRenderTargets( 1, &pRenderTargetView, NULL );

//In D3D10 this must be done, because there is no default Viewport
D3D10_VIEWPORT vp;
vp.Width = 640;
vp.Height = 480;
vp.MinDepth = 0.0f;
vp.MaxDepth = 1.0f;
vp.TopLeftX = 0;
vp.TopLeftY = 0;
pd3dDevice->RSSetViewports( 1, &vp );

MSG msg;
while( g_bContinue )
{
//Clear render region with blue
float ClearColor[4] = { 0.0f, 0.0f, 1.0f, 1.0f }; //red,green,blue,alpha
pd3dDevice->ClearRenderTargetView( pRenderTargetView, ClearColor );

pSwapChain->Present( 0, 0 );

// A window has to handle its messages.
TranslateMessage( &msg );
DispatchMessage( &msg );
PeekMessage(&msg, 0, 0, 0, PM_REMOVE);
}

//Do not forget to clean up here
pSwapChain->Release();
pSwapChain = NULL;
pRenderTargetView->Release();
pRenderTargetView = NULL;
pd3dDevice->Release();
pd3dDevice = NULL;

return 0;
}


Basically when i run that, it takes about 3-5 seconds to work, and i messed around with it, to no avail

hope ya can help biggrin.gif
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 11:51AM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month