最近在做一个3D游戏,对显卡内存要求很高,要求显存大于128M,才可以玩,请教各位大大,,,如何用delphi 读出显存大小呀,我只想判断电脑的显存够不够128M!

解决方案 »

  1.   

    可以用PReadMemory來獲取由於源碼過長,請提供一個油箱,我將源碼發給你
      

  2.   

    要麼你到這裡下載:  http://download.csdn.net/down/2269409/chaselife
      

  3.   

    procedure TForm1.Button1Click(Sender: TObject); 
    var gameHwnd:Hwnd; 
    pid: dword; 
    h: THandle; 
    lpNumberOfBytes: DWord; 
    buf:DWord; 
    buf2:Pointer; 
    Buffer : Array[0..3] Of DWord; 
    addr:DWORD; 
    nSize: DWORD; 
    s:WideString; 
    i:Integer; 
    begin 
    gameHwnd:=FindWindow(nil,'Element Client'); 
    if gameHwnd<>0 then 
    begin 
    GetWindowThreadProcessId(gameHwnd, @pid); 
    h:=OpenProcess(PROCESS_ALL_ACCESS, false, pid); 
    if h<>0 then 
    begin 
    addr:=$010EA0CC; 
    edit2.Text:=Inttostr(gameHwnd); 
    edit3.Text:=Inttostr(h); 
    nSize:=4; 
    ReadProcessMemory(h,Pointer(addr+$2A4),@buf,nSize,lpNumberOfBytes); 
    s:=inttoStr(buf); 
    edit1.Text:=s; 
    showmessage(s); 
    end; 
    closeHandle(h); 
    end else begin 
    showmessage('游戏未运行!'); 
    end; 
    end; 
      

  4.   

    d9的 
    var
      pD3D: IDirect3D9;
      g_pD3DDevice: IDirect3DDevice9;
      D3DPP: TD3DPresentParameters;
    begin
      pD3D := Direct3DCreate9(D3D_SDK_VERSION);
      ZeroMemory(@d3dpp,SizeOf(d3dpp));
      D3DPP.BackBufferFormat:=D3DFMT_X8R8G8B8;
      D3DPP.Windowed:=True;
      D3DPP.SwapEffect:=D3DSWAPEFFECT_DISCARD;
      pD3D.CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, GetDesktopWindow,
        D3DCREATE_SOFTWARE_VERTEXPROCESSING, @D3DPP, g_pD3DDevice);
      Edit1.Text:=IntToStr(g_pD3DDevice.GetAvailableTextureMem );
    end
      

  5.   

    http://msdn.microsoft.com/zh-cn/library/ms929093.aspx
    确实是得到总共显存大小的 得到的