Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: OpenGL snapshot

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2009
    Posts
    2

    OpenGL snapshot

    Hi there!
    I am trying to take a snapshot from another process, to be exact Counter-Strike.
    Under Windown XP I could take simple snapshots using GDI functions, but it doesn't work under Windows Vista/7 because of the new look of the Windows.
    I have tried getting the HDC and HRC of the other process, but it seems I cant get the HRC. I got the HDC using this code:

    hwnd = FindWindowA(0, "Counter-Strike");

    if (!hwnd)
    {
    printf("Open Counter-Strike to begin\n");
    while (1)
    {
    Sleep(1000);
    hwnd = FindWindowA(0, "Counter-Strike");
    if (hwnd) break;
    }
    }

    DWORD proc_id;
    GetWindowThreadProcessId(hwnd, &proc_id);
    hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, proc_id);

    if (!hProcess)
    {
    printf("Cant Open Process\n");
    return 2;
    }
    *hDC = GetDC( hWnd );



    now because I dont have an HRC when I am trying to use glReadPixels, it doesnt work.
    I saw this feature in a program named Fraps, and started looking for a solution some time ago, so now I thought you guys may be able to figure out how it is possible to be done.

    Boris.

  2. #2
    Advanced Member Frequent Contributor yooyo's Avatar
    Join Date
    Apr 2003
    Location
    Belgrade, Serbia
    Posts
    883

    Re: OpenGL snapshot

    Search for TAKSI project on sourceforge.. same as fraps, but opensource.

  3. #3
    Junior Member Newbie
    Join Date
    Jul 2009
    Posts
    2

    Re: OpenGL snapshot

    Thank you!
    I'll check it right now.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •