diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index cdb91a54..285ab4f6 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,7 +1,15 @@ { - "name": "ubuntu-jammy", - "image": "ubuntu-latest", + "name": "ubuntu", + "image": "docker.io/library/ubuntu", + "customizations": { + "vscode": { + "extensions": [ + "ms-vscode.cpptools-extension-pack" + ] + } + }, "features": { }, + "onCreateCommand": "apt update && apt install sudo git", "postCreateCommand": "sudo ./build.sh" -} +} \ No newline at end of file diff --git a/include/config.hpp b/include/config.hpp index cea063b6..5b071b03 100644 --- a/include/config.hpp +++ b/include/config.hpp @@ -3,4 +3,4 @@ #define DEBUG true //PREPROCESSING ONLY!!! -#define PROJECT_SOURCE_DIR "/home/eduardo/Documentos/proj/OpenDX/" +#define PROJECT_SOURCE_DIR "/workspaces/OpenDX/" diff --git a/libs/d3d9/d3d9.cpp b/libs/d3d9/d3d9.cpp index bff407a0..d5407a5e 100644 --- a/libs/d3d9/d3d9.cpp +++ b/libs/d3d9/d3d9.cpp @@ -12,6 +12,9 @@ #include #include +//TODO: add ifdefs when implementing another gpu +#include + IDirect3D9::IDirect3D9 (UINT SDKVersion) { #ifdef DEBUG std::cout << "libd3d9.so: IDirect3D9::IDirect3D9()" << std::endl; @@ -93,7 +96,13 @@ HRESULT IDirect3D9::CreateDevice( D3DPRESENT_PARAMETERS *pPresentationParameters, IDirect3DDevice9 **ppReturnedDeviceInterface ) { - return 0; + #ifdef DEBUG + std::cout << "libd3d9.so: IDirect3D9::CreateDevice()" << std::endl; + #endif + + //get hwnd size + RECT rect; + GetClientRect(hFocusWindow, &rect); } ULONG IDirect3D9::Release() { diff --git a/tests/basic_window.cpp b/tests/basic_window.cpp index 0cc5b0bc..44fd8c9d 100644 --- a/tests/basic_window.cpp +++ b/tests/basic_window.cpp @@ -28,7 +28,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine //ZeroMemory(&pp, sizeof(pp)); pp.Windowed = TRUE; pp.SwapEffect = D3DSWAPEFFECT_DISCARD; - //pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, &pp, &pDevice); + pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, 0/*D3DCREATE_HARDWARE_VERTEXPROCESSING*/, &pp, &pDevice); // Enter the message loop MSG msg;