   Beginner -
  Sup guys, As the title suggests I am a beginner to DirectX(C++ Win32) and will ask a lot of questions about it. To start with what exactly is an interface in DirectX?Thanks.   
  Before you dive in with DirectX, you may want to check out the portion of the DX programming guide that explains COM (Component Object Model).  It should help get you up to speed with the basic COM techniques like interfaces and reference counting, which you'll need to be familiar with for DX programming in C++.To answer your question specifically, you can think of an interface as a sort of stripped-down class that has a set of methods for you to use.  Whenever you want to do something to an object or get some information from it, you do it by calling one of the methods exposed by the object's interface pointer.  So for example let's say you want to create a texture.  Typically, you'll call a function which gives you a pointer to an interface.  Usually the code looks something like this:IDirect3DTexture9*pTexture; // Our interface pointerD3DXCreateTextureFromFile( ..., &pTexture );    // Now our pointer actually points to an interfacepTexture->GetDesc( ... );   // Call a method to get a description of the texturepDevice->SetTexture( ..., pTexture ); // You can also pass the interface to other DX interfaces, so they can use themThe key idea with interfaces is that you don't really know how the interface does its job when you ask it to do something by calling a method, nor should you care about it.  All that you should care about is that an interface has certain functions, and it will do what it claims to do when you call them.  ; Direct X tutorial by far the best beginners tutorial i've readEDIT: btw ,  for all of the difficulty i had learning win32,  its accually insanely easy to get the basics once you have it explained a bit ,  if you're having trouble with that   ;  I finally have some grasp on DirectX(3D to be precise :)) and for an unknown reason the following code does not work -#include <windows.h>#include <d3d9.h>const char *ClsName = "BasicApp";const char *WndName = "DirectX";LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);VOID initD3D(HWND hWnd);VOID render_frame();VOID cleanD3D();HINSTANCE hInstance;HWND hWnd;DWORD StartingCount;LPDIRECT3D9 d3d;LPDIRECT3DDEVICE9 d3ddev;int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow){ MSG Msg; WNDCLASSEX WndClsEx; // Create the application window WndClsEx.cbSize = sizeof(WNDCLASSEX); WndClsEx.style = CS_HREDRAW | CS_VREDRAW; WndClsEx.lpfnWndProc = WndProc; WndClsEx.cbClsExtra = 0; WndClsEx.cbWndExtra = 0; WndClsEx.hIcon = LoadIcon(NULL, IDI_APPLICATION); WndClsEx.hCursor = LoadCursor(NULL, IDC_ARROW); WndClsEx.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH); WndClsEx.lpszMenuName = NULL; WndClsEx.lpszClassName = ClsName; WndClsEx.hInstance = hInstance; WndClsEx.hIconSm = LoadIcon(NULL, IDI_APPLICATION); // Register the application RegisterClassEx(&WndClsEx); // Create the window object hWnd = CreateWindow(ClsName, WndName, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL);  // Find out if the window was created if( !hWnd ) // If the window was not created, return 0; // stop the application  // Display the window to the user ShowWindow(hWnd, SW_SHOWNORMAL); UpdateWindow(hWnd); initD3D(hWnd); // Decode and treat the messages // as long as the application is running while(true) {  StartingCount = GetTickCount();  if (PeekMessage(&Msg, NULL, 0, 0, PM_REMOVE))  {   if (Msg.message == WM_QUIT) break;   TranslateMessage(&Msg);   DispatchMessage(&Msg);  }  render_frame();  while((GetTickCount() - StartingCount) < 25); } cleanD3D(); return Msg.wParam;}LRESULT CALLBACK WndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam){ switch (Msg) {  case WM_DESTROY :   PostQuitMessage(WM_QUIT);  break;  case WM_CLOSE :   DestroyWindow(hWnd);  break; } return DefWindowProc(hWnd, Msg, wParam, lParam);}VOID initD3D(HWND hWnd){ D3DPRESENT_PARAMETERS d3dpp; d3d = Direct3DCreate9(D3D_SDK_VERSION); ZeroMemory(&d3dpp, sizeof(d3dpp)); d3dpp.Windowed = true; d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; d3dpp.hDeviceWindow = hWnd; d3d->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &d3ddev);}VOID render_frame(){ d3ddev->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(255, 0, 0), 1.0f, 0); d3ddev->BeginScene(); d3ddev->EndScene(); d3ddev->Present(NULL, NULL, NULL, NULL);}VOID cleanD3D(){ d3ddev->Release(); d3d->Release();}The returned error is a linker one and goes as follows "Unresolved external 'Direct3DCreate9' referenced"PLEASE, help me :(PS. I have to thank godsenddeath for the site!Thanks.   ;  You need to link to d3d9.lib.   ;  It didn't help :( If it helps I'm using Borland C++ Builder 6.   ;Quote:Original post by pcbrainbusterIt didn't help :( If it helps I'm using Borland C++ Builder 6.Ah. Don't do that [smile] With non-VC compilers you need to download a devpak or some app to convert libs to non-VC format. The DirectX SDK is only official supported with Visual Studio.Is there any reason you're not use VC2008 Express?   ;  Yes, its complicated for me :( But since you seem to be more superior in terms of programming I'll take your advice and try it :) Between compilers there are certain programming differences such as true in Borland is TRUE in VC++ so could please give me a sort of list of all the differences? :)   ;Quote:Original post by pcbrainbusterYes, its complicated for me :( But since you seem to be more superior in terms of programming I'll take your advice and try it :) Between compilers there are certain programming differences such as true in Borland is TRUE in VC++ so could please give me a sort of list of all the differences? :)Nope, it's true in VC++ too.The language itself is the same (Although VC++ is likely to implement it more correctly since it's more recent). If you develop a Win32 application, you'll #include windows.h, which defines TRUE as 1.   ;  I downloaded the program and then copy and pasted my code into it, but now its giving me new errors which I do not know what to do about :( There are 2 errors and they go as follows -1)c:\documents and settings\(usernamehere)\my documents\visual studio 2008\projects\directx test\main.cpp(33) : error C2440: '=' : cannot convert from 'const char *' to 'LPCWSTR'   Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast2)c:\documents and settings\(usernamehere)\my documents\visual studio 2008\projects\directx test\main.cpp(51) : error C2664: 'CreateWindowExW' : cannot convert parameter 2 from 'const char *' to 'LPCWSTR'   Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast   