guys i tried to make my form to colour as dark blue (100, 100, 100) but i failed on it in DirectX, well here is the code, can u say me where is the mistake? and what should i do?
#include <windows.h> #include <windowsx.h> #include <d3d9.h> //genel demeçler LPDIRECT3D9 d3d; //Direct3D arayüzünün pointer'ı LPDIRECT3DDEVICE9 directx; //aygıt sınıfına bir pointer //fonksiyon prototipleri void D3Dbaslat[HWND hWnd); //Direct3D'yi ayarlar ve başlatır void kare_goruntule(void); //her bir kareyi görüntüler void D3Dtemizle(void); //Direct3D'yi kapatır ve hafızayı temizler //bu fonksiyon Direct3D'yi başlatır ve kullanılması için hazırlar void D3Dbaslat(HWND hWnd) { d3d = Direct3DCreate9(D3D_SDK_VERSION); //Direct3D arayüzünü oluşturur D3DPRESENT_PARAMETERS direct3d; //farklı bir yapı aygıt bilgilerini tutacak bir yapı oluşturur ZeroMemory(&direct3d, sizeof(direct3d)); //yapıyı kullanılması için temizle direct3d.Windowed = TRUE; //program pencere modunda, tam ekran değil direct3d.SwapEffect = D3DSWAPEFFECT_DISCARD; //eski kareleri ıskartaya çıkart(fırlat at) direct3d.hDeviceWindow = hWnd; //pencereyi Direct3D tarafından kullanılması için hazırla //bu bilgiyi ve direct3d yapısındaki bilgiyi kullancak bir aygıt sınıfı yarat d3d->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &direct3d, &directx); return; } void kare_goruntule(void) { //simdi ekrana biraz koyu mavi katıp ortalıga haraket getirek :D :D directx->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(100, 100, 100,), 1.0f, 0); directx->BeginScene(); //3 boyutlu sahnemiz başlıyor //arkaplandaki 3 boyutlu görüntülenmeyi yap directx->EndScene(); //3B sahneyi bitir directx->Present(NULL, NULL, NULL, NULL); // yaratılmış kareyi görüntüle return; } //Direct3D ve COM temizlenir void D3Dtemizle(void) { ditectx->Release(); //aygıtımız kapatılır ve serbest bırakılır d3d->Release(); //Direct^d kapatılır ve serbest bırakılır return, } // WindowPRoc fonksiyonunun prototipi LRESULT CALLBACK WindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); //her Windows Programı için geçerli olan giriş int WINAPI WinMain(HINSTANCE HInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { HWND hWnd; WNDCLASSEX ps; ZeroMemory(&ps, sizeof(WNDCLASSEX)); ps.cbSize = sizeof(WNDCLASSEX); ps.style = CS_HREDRAW | CS_VREDRAW; ps.lpfnWndProc = (WNDPROC)WindowProc; ps.hInstance = hInstance; ps.hCursor = LoadCursor(NULL, IDC_ARROW); ps.hbrBackground = (HBRUSH)COLOR_WINDOW; ps.lpszClassName = L"PencereSinifi01"; RegisterClassEx(&ps); hWnd = CreateWindowEx(NULL, L"PencereSinifi01", L"Ilk Direct3d Programimiz", WS_OVERLAPPEDWINDOW, 300, 300, 640, 480, NULL, NULL, hInstance, NULL); ShowWindow(hWnd, nCmdShow); //Ditect3D'yi ayarla ve başlat D3Dbaslat(hWnd); //analoopu gir: MSG mesaj; while(TRUE) { DWORD baslangic_noktasi = GetTickCoundt(); if (PeekMessage(&mesaj,NULL,0,0,PM_REMOVE)) break; TranslateMessage(&mesaj); DispatchMessage(&mesaj); } kare_goruntule(); while ((GetTickCount() - baslangic_noktasi) < 25); } //DirectX ve COM'u temzle D3Dtemizle(); return mesaj.wParam; } LRESULT CALLBACK WindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { switch(message) { case WM_DESTROY: { PostQuitMessage(0); return 0; } break; } return DefWindowProc(hWnd, message, wParam, lParam); }
you are using the internet for these type of codes
you mean? , i wrote these on my own -.-'
then ask your teacher
its says "Invalid character"
nono, i fixed all the character errors, nevermind of these D or d mistakes :D but it gaves the same error, and i don'T have a teacher, i am 14 years old, started to work on programmingwhen i was 12 years old with QBASIC, solved over 6.000 algoright questions, learned Vb.NET C#, C++, now working on game progrmaming in C++ before it worked on C#, XNa and coded over 3 or 4 2D games in it... now trying to learn DirectX and how its used in C++ ^.^ i learn all on my own -.-'
and if u are not going to be helpful, then stop to make a mess under my question...
Join our real-time social learning platform and learn together with your friends!